	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function issuecommand
_issuecommand:                          ## @issuecommand
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_EVSTAT@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_IN4500
	movq	_EV_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_2
## %bb.1:
	movq	_EVACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_OUT4500
LBB0_2:
	movq	_PARAM0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movq	_PARAM1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movq	_PARAM2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movq	_COMMAND@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	12(%r15), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movl	$599999, %r12d                  ## imm = 0x927BF
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	addl	$-1, %r12d
	jae	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movq	_EV_CMD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	cmpl	12(%r15), %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_OUT4500
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_in_atomic
	movzbl	%r12b, %ecx
	orl	%eax, %ecx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	jmp	LBB0_8
LBB0_11:
	movq	_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, (%r14)
	movq	_RESP0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movl	%eax, 4(%r14)
	movq	_RESP1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movl	%eax, 8(%r14)
	movq	_RESP2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movl	%eax, 12(%r14)
	movl	(%r14), %ecx
	testl	$65280, %ecx                    ## imm = 0xFF00
	je	LBB0_14
## %bb.12:
	movl	12(%r15), %edx
	movq	_CMD_SOFTRESET@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	je	LBB0_14
## %bb.13:
	movq	(%rbx), %rsi
	movl	(%rsi), %edi
	movl	4(%r14), %r8d
	movl	8(%r14), %r9d
	movl	%eax, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_airo_print_err
LBB0_14:
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movq	_COMMAND_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.15:
	movq	_EVACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EV_CLEARCOMMANDBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
LBB0_16:
	movq	_EVACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EV_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movq	_SUCCESS@GOTPCREL(%rip), %r14
	jmp	LBB0_17
LBB0_9:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_airo_print_err
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_IN4500
	movq	_COMMAND_BUSY@GOTPCREL(%rip), %rcx
	movq	_ERROR@GOTPCREL(%rip), %r14
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.10:
	movq	_EVACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EV_CLEARCOMMANDBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
LBB0_17:
	movl	(%r14), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVSTAT,4,2                     ## @EVSTAT
	.comm	_EV_CMD,4,2                     ## @EV_CMD
	.comm	_EVACK,4,2                      ## @EVACK
	.comm	_PARAM0,4,2                     ## @PARAM0
	.comm	_PARAM1,4,2                     ## @PARAM1
	.comm	_PARAM2,4,2                     ## @PARAM2
	.comm	_COMMAND,4,2                    ## @COMMAND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Max tries exceeded when issuing command"

	.comm	_COMMAND_BUSY,4,2               ## @COMMAND_BUSY
	.comm	_EV_CLEARCOMMANDBUSY,4,2        ## @EV_CLEARCOMMANDBUSY
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_STATUS,4,2                     ## @STATUS
	.comm	_RESP0,4,2                      ## @RESP0
	.comm	_RESP1,4,2                      ## @RESP1
	.comm	_RESP2,4,2                      ## @RESP2
	.comm	_CMD_SOFTRESET,4,2              ## @CMD_SOFTRESET
L_.str.1:                               ## @.str.1
	.asciz	"cmd:%x status:%x rsp0:%x rsp1:%x rsp2:%x"

	.comm	_SUCCESS,4,2                    ## @SUCCESS
	.no_dead_strip	_issuecommand
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function issuecommand
_issuecommand:                          ; @issuecommand
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x25, _EVSTAT@GOTPAGE
Lloh1:
	ldr	x25, [x25, _EVSTAT@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_IN4500
Lloh2:
	adrp	x23, _EV_CMD@GOTPAGE
Lloh3:
	ldr	x23, [x23, _EV_CMD@GOTPAGEOFF]
	ldr	w2, [x23]
Lloh4:
	adrp	x22, _EVACK@GOTPAGE
Lloh5:
	ldr	x22, [x22, _EVACK@GOTPAGEOFF]
	tst	w2, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_OUT4500
LBB0_2:
Lloh6:
	adrp	x8, _PARAM0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PARAM0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_OUT4500
Lloh9:
	adrp	x8, _PARAM1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PARAM1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x21, #4]
	mov	x0, x19
	bl	_OUT4500
Lloh12:
	adrp	x8, _PARAM2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PARAM2@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [x21, #8]
	mov	x0, x19
	bl	_OUT4500
Lloh15:
	adrp	x24, _COMMAND@GOTPAGE
Lloh16:
	ldr	x24, [x24, _COMMAND@GOTPAGEOFF]
	ldr	w1, [x24]
	ldr	w2, [x21, #12]
	mov	x0, x19
	bl	_OUT4500
	mov	w26, #10175
	movk	w26, #9, lsl #16
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	w26, w26, #1
	cmn	w26, #1
	b.eq	LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_IN4500
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_IN4500
	ldr	w8, [x21, #12]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, x0
	ldr	w1, [x24]
	mov	x0, x19
	bl	_OUT4500
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_in_atomic
	and	w8, w26, #0xff
	orr	w8, w0, w8
	cbnz	w8, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_schedule
	b	LBB0_3
LBB0_9:
Lloh17:
	adrp	x8, _STATUS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STATUS@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_IN4500
	str	w0, [x20]
Lloh20:
	adrp	x8, _RESP0@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RESP0@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_IN4500
	str	w0, [x20, #4]
Lloh23:
	adrp	x8, _RESP1@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RESP1@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_IN4500
	str	w0, [x20, #8]
Lloh26:
	adrp	x8, _RESP2@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RESP2@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_IN4500
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x20, #12]
	ldr	w9, [x20]
	tst	w9, #0xff00
	b.eq	LBB0_12
; %bb.10:
	ldr	w10, [x21, #12]
Lloh29:
	adrp	x8, _CMD_SOFTRESET@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CMD_SOFTRESET@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w10, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	x8, [x19]
	ldr	w8, [x8]
	ldp	w11, w12, [x20, #4]
	stp	x12, x0, [sp, #24]
	stp	x9, x11, [sp, #8]
	str	x10, [sp]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_airo_print_err
LBB0_12:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_IN4500
Lloh34:
	adrp	x8, _COMMAND_BUSY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _COMMAND_BUSY@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_14
; %bb.13:
	ldr	w1, [x22]
Lloh37:
	adrp	x8, _EV_CLEARCOMMANDBUSY@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EV_CLEARCOMMANDBUSY@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OUT4500
LBB0_14:
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_OUT4500
Lloh40:
	adrp	x8, _SUCCESS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SUCCESS@GOTPAGEOFF]
	b	LBB0_18
LBB0_15:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh42:
	adrp	x1, l_.str@PAGE
Lloh43:
	add	x1, x1, l_.str@PAGEOFF
	bl	_airo_print_err
	ldr	w1, [x24]
	mov	x0, x19
	bl	_IN4500
Lloh44:
	adrp	x8, _COMMAND_BUSY@GOTPAGE
Lloh45:
	ldr	x8, [x8, _COMMAND_BUSY@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_17
; %bb.16:
	ldr	w1, [x22]
Lloh47:
	adrp	x8, _EV_CLEARCOMMANDBUSY@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EV_CLEARCOMMANDBUSY@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OUT4500
LBB0_17:
Lloh50:
	adrp	x8, _ERROR@GOTPAGE
Lloh51:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
LBB0_18:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_EVSTAT,4,2                     ; @EVSTAT
	.comm	_EV_CMD,4,2                     ; @EV_CMD
	.comm	_EVACK,4,2                      ; @EVACK
	.comm	_PARAM0,4,2                     ; @PARAM0
	.comm	_PARAM1,4,2                     ; @PARAM1
	.comm	_PARAM2,4,2                     ; @PARAM2
	.comm	_COMMAND,4,2                    ; @COMMAND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Max tries exceeded when issuing command"

	.comm	_COMMAND_BUSY,4,2               ; @COMMAND_BUSY
	.comm	_EV_CLEARCOMMANDBUSY,4,2        ; @EV_CLEARCOMMANDBUSY
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_STATUS,4,2                     ; @STATUS
	.comm	_RESP0,4,2                      ; @RESP0
	.comm	_RESP1,4,2                      ; @RESP1
	.comm	_RESP2,4,2                      ; @RESP2
	.comm	_CMD_SOFTRESET,4,2              ; @CMD_SOFTRESET
l_.str.1:                               ; @.str.1
	.asciz	"cmd:%x status:%x rsp0:%x rsp1:%x rsp2:%x"

	.comm	_SUCCESS,4,2                    ; @SUCCESS
	.no_dead_strip	_issuecommand
.subsections_via_symbols
