#include "zasm_GOOS_GOARCH.h"
#include "../../cmd/ld/textflag.h"
#define SYS_BASE 0x0
#define SYS_exit (SYS_BASE + 1)
#define SYS_read (SYS_BASE + 3)
#define SYS_write (SYS_BASE + 4)
#define SYS_open (SYS_BASE + 5)
#define SYS_close (SYS_BASE + 6)
#define SYS_sigaltstack (SYS_BASE + 53)
#define SYS_munmap (SYS_BASE + 73)
#define SYS_madvise (SYS_BASE + 75)
#define SYS_setitimer (SYS_BASE + 83)
#define SYS_fcntl (SYS_BASE + 92)
#define SYS_getrlimit (SYS_BASE + 194)
#define SYS___sysctl (SYS_BASE + 202)
#define SYS_nanosleep (SYS_BASE + 240)
#define SYS_clock_gettime (SYS_BASE + 232)
#define SYS_sched_yield (SYS_BASE + 331)
#define SYS_sigprocmask (SYS_BASE + 340)
#define SYS_kqueue (SYS_BASE + 362)
#define SYS_kevent (SYS_BASE + 363)
#define SYS_sigaction (SYS_BASE + 416)
#define SYS_thr_exit (SYS_BASE + 431)
#define SYS_thr_self (SYS_BASE + 432)
#define SYS_thr_kill (SYS_BASE + 433)
#define SYS__umtx_op (SYS_BASE + 454)
#define SYS_thr_new (SYS_BASE + 455)
#define SYS_mmap (SYS_BASE + 477)
TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW 12(FP), R3
ADD $20, R13
MOVW $SYS__umtx_op, R7
SWI $0
SUB $20, R13
RET
TEXT runtime·thr_new(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW $SYS_thr_new, R7
SWI $0
RET
TEXT runtime·thr_start(SB),NOSPLIT,$0
MOVW R0, m
MOVW m_g0(m), g
BL runtime·emptyfunc(SB)
BL runtime·mstart(SB)
MOVW $2, R8
MOVW R8, (R8)
RET
TEXT runtime·exit(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW $SYS_exit, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·exit1(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW $SYS_thr_exit, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·open(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_open, R7
SWI $0
RET
TEXT runtime·read(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_read, R7
SWI $0
RET
TEXT runtime·write(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_write, R7
SWI $0
RET
TEXT runtime·close(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW $SYS_close, R7
SWI $0
RET
TEXT runtime·getrlimit(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW $SYS_getrlimit, R7
SWI $0
RET
TEXT runtime·raise(SB),NOSPLIT,$8
MOVW $4(R13), R0
MOVW $SYS_thr_self, R7
SWI $0
MOVW 4(R13), R0
MOVW sig+0(FP), R1
MOVW $SYS_thr_kill, R7
SWI $0
RET
TEXT runtime·setitimer(SB), NOSPLIT, $-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_setitimer, R7
SWI $0
RET
TEXT time·now(SB), NOSPLIT, $32
MOVW $0, R0
MOVW $8(R13), R1
MOVW $SYS_clock_gettime, R7
SWI $0
MOVW 8(R13), R0
MOVW 12(R13), R1
MOVW 16(R13), R2
MOVW R0, 0(FP)
MOVW R1, 4(FP)
MOVW R2, 8(FP)
RET
TEXT runtime·nanotime(SB), NOSPLIT, $32
MOVW $4, R0
MOVW $8(R13), R1
MOVW $SYS_clock_gettime, R7
SWI $0
MOVW 8(R13), R0
MOVW 12(R13), R4
MOVW 16(R13), R2
MOVW $1000000000, R3
MULLU R0, R3, (R1, R0)
MUL R3, R4
ADD.S R2, R0
ADC R4, R1
MOVW 0(FP), R3
MOVW R0, 0(R3)
MOVW R1, 4(R3)
RET
TEXT runtime·sigaction(SB),NOSPLIT,$-8
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_sigaction, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$24
MOVW R0, 4(R13)
MOVB runtime·iscgo(SB), R0
CMP $0, R0
BL.NE runtime·load_gm(SB)
CMP $0, m
BNE 4(PC)
MOVW $runtime·badsignal(SB), R11
BL (R11)
RET
MOVW g, R4
MOVW g, 20(R13)
MOVW m_gsignal(m), g
MOVW R1, 8(R13)
MOVW R2, 12(R13)
MOVW R4, 16(R13)
BL runtime·sighandler(SB)
MOVW 20(R13), g
RET
TEXT runtime·mmap(SB),NOSPLIT,$16
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW 12(FP), R3
MOVW 16(FP), R4
MOVW R4, 4(R13)
MOVW 20(FP), R5
MOVW R5, 12(R13)
MOVW $0, R6
MOVW R6, 16(R13)
ADD $4, R13
MOVW $SYS_mmap, R7
SWI $0
SUB $4, R13
RET
TEXT runtime·munmap(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW $SYS_munmap, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·madvise(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW $SYS_madvise, R7
SWI $0
RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVW new+0(FP), R0
MOVW old+4(FP), R1
MOVW $SYS_sigaltstack, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·usleep(SB),NOSPLIT,$16
MOVW usec+0(FP), R0
MOVW R0, R2
MOVW $1000000, R1
DIV R1, R0
MOVW R0, 4(R13)
MOVW $0, R0
MOVW R0, 8(R13)
MOD R1, R2
MOVW $1000, R1
MUL R1, R2
MOVW R2, 12(R13)
MOVW $4(R13), R0
MOVW $0, R1
MOVW $SYS_nanosleep, R7
SWI $0
RET
TEXT runtime·sysctl(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW 12(FP), R3
ADD $20, R13
MOVW $SYS___sysctl, R7
SWI $0
SUB.CS $0, R0, R0
SUB $20, R13
RET
TEXT runtime·osyield(SB),NOSPLIT,$-4
MOVW $SYS_sched_yield, R7
SWI $0
RET
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
MOVW $3, R0
MOVW 0(FP), R1
MOVW 4(FP), R2
MOVW $SYS_sigprocmask, R7
SWI $0
MOVW.CS $0, R8
MOVW.CS R8, (R8)
RET
TEXT runtime·kqueue(SB),NOSPLIT,$0
MOVW $SYS_kqueue, R7
SWI $0
RSB.CS $0, R0
RET
TEXT runtime·kevent(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
MOVW 8(FP), R2
MOVW 12(FP), R3
ADD $20, R13
MOVW $SYS_kevent, R7
SWI $0
RSB.CS $0, R0
SUB $20, R13
RET
TEXT runtime·closeonexec(SB),NOSPLIT,$0
MOVW 0(FP), R0
MOVW $2, R1
MOVW $1, R2
MOVW $SYS_fcntl, R7
SWI $0
RET
TEXT runtime·casp(SB),NOSPLIT,$0
B runtime·cas(SB)
TEXT runtime·cas(SB),NOSPLIT,$0
B runtime·armcas(SB)
TEXT runtime·read_tls_fallback(SB),NOSPLIT,$-4
WORD $0xee1d0f70
RET