	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function typhoon_issue_command
_typhoon_issue_command:                 ## @typhoon_issue_command
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	40(%rdi), %r13
	addq	$4, %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	%r14, %rdi
	callq	_typhoon_num_free_cmd
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_typhoon_num_free_resp
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	cmpl	%r15d, %ebx
	jl	LBB0_2
## %bb.1:
	cmpl	%r12d, %eax
	jl	LBB0_2
## %bb.3:
	movq	_TYPHOON_CMD_RESPOND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	leaq	-96(%rbp), %rax
	cmoveq	%rax, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	$1, (%r14)
	movl	$1, %eax
	cmovel	%eax, %r12d
LBB0_5:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	leal	(,%rbx,4), %eax
	leaq	24(%r14), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movslq	%eax, %r12
	movq	24(%r14), %rax
	addq	%r12, %rax
	movq	_COMMAND_RING_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setg	%dil
	callq	_unlikely
	movq	24(%r14), %rdi
	leal	(%rdi,%rbx,4), %r15d
	movq	_COMMAND_RING_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	subl	%ecx, %r15d
	subl	%edi, %ecx
	xorl	%ebx, %ebx
	testq	%rax, %rax
	cmovnel	%ecx, %r12d
	cmovel	%ebx, %r15d
	addq	32(%r14), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	movl	%r15d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movslq	%r12d, %rsi
	andq	$-4, %rsi
	addq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	32(%r14), %rdi
	movl	%r15d, %edx
	callq	_memcpy
LBB0_7:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_typhoon_inc_cmd_index
	xorl	%eax, %eax
	callq	_wmb
	movl	24(%r14), %edi
	movq	_TYPHOON_REG_CMD_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_iowrite32
	movq	8(%r14), %rdi
	callq	_typhoon_post_pci_writes
	movq	_TYPHOON_CMD_RESPOND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_20
## %bb.8:
	movq	_TYPHOON_WAIT_TIMEOUT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_15
## %bb.9:
	movl	$1, %ebx
	movq	_TYPHOON_UDELAY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	xorl	%r12d, %r12d
	cmpq	8(%r13), %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_typhoon_process_response
	movl	%eax, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	(%r15), %edi
	callq	_udelay
	movq	_TYPHOON_WAIT_TIMEOUT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	testl	%r12d, %r12d
	je	LBB0_10
LBB0_14:
	testl	%r12d, %r12d
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_15
## %bb.16:
	movq	_TYPHOON_RESP_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.18:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_2:
	movl	16(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%eax, %r8d
	movl	%r12d, %r9d
	callq	_netdev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	cmpl	$0, (%r14)
	jne	LBB0_21
	jmp	LBB0_23
LBB0_15:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_19:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	cmpl	$0, (%r14)
	je	LBB0_23
LBB0_21:
	movl	$0, (%r14)
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	(%r13), %rax
	cmpq	8(%r13), %rax
	je	LBB0_23
## %bb.22:
	movq	_TYPHOON_REG_SELF_INTERRUPT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	$1, %edi
	callq	_iowrite32
LBB0_23:
	movq	%r15, %rdi
	callq	_spin_unlock
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	xorl	%ebx, %ebx
	cmpl	$0, (%r14)
	jne	LBB0_21
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no descs for cmd, had (needed) %d (%d) cmd, %d (%d) resp\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TYPHOON_CMD_RESPOND,4,2        ## @TYPHOON_CMD_RESPOND
	.comm	_COMMAND_RING_SIZE,8,3          ## @COMMAND_RING_SIZE
	.comm	_TYPHOON_REG_CMD_READY,8,3      ## @TYPHOON_REG_CMD_READY
	.comm	_TYPHOON_WAIT_TIMEOUT,4,2       ## @TYPHOON_WAIT_TIMEOUT
	.comm	_TYPHOON_UDELAY,4,2             ## @TYPHOON_UDELAY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_TYPHOON_RESP_ERROR,4,2         ## @TYPHOON_RESP_ERROR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TYPHOON_REG_SELF_INTERRUPT,8,3 ## @TYPHOON_REG_SELF_INTERRUPT
	.no_dead_strip	_typhoon_issue_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function typhoon_issue_command
_typhoon_issue_command:                 ; @typhoon_issue_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x28, [x0, #40]
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock
	mov	x0, x20
	bl	_typhoon_num_free_cmd
	mov	x25, x0
	mov	x0, x20
	bl	_typhoon_num_free_resp
	mov	x4, x0
	cmp	w25, w24
	b.lt	LBB0_13
; %bb.1:
	cmp	w4, w21
	b.lt	LBB0_13
; %bb.2:
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _TYPHOON_CMD_RESPOND@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TYPHOON_CMD_RESPOND@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	w8, #1
	str	w8, [x20]
	add	x8, sp, #8
	cmp	x22, #0
	csel	x22, x8, x22, eq
	csinc	w21, w21, wzr, ne
LBB0_4:
	lsl	w26, w24, #2
	mov	x25, x20
	ldr	x8, [x25, #24]!
	add	x8, x8, w26, sxtw
Lloh3:
	adrp	x27, _COMMAND_RING_SIZE@GOTPAGE
Lloh4:
	ldr	x27, [x27, _COMMAND_RING_SIZE@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	x8, x9
	cset	w0, gt
	bl	_unlikely
	ldr	w8, [x27]
	ldp	x9, x10, [x25]
	add	w11, w9, w26
	sub	w11, w11, w8
	sub	w8, w8, w9
	cmp	x0, #0
	csel	w27, w26, w8, eq
	csel	w26, wzr, w11, eq
	add	x0, x9, x10
	mov	x1, x23
	mov	x2, x27
	bl	_memcpy
	mov	x0, x26
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.5:
	sxtw	x8, w27
	and	x8, x8, #0xfffffffffffffffc
	add	x1, x23, x8
	ldr	x0, [x20, #32]
	mov	x2, x26
	bl	_memcpy
LBB0_6:
	mov	x0, x25
	mov	x1, x24
	bl	_typhoon_inc_cmd_index
	bl	_wmb
	ldr	w0, [x20, #24]
	ldr	x8, [x20, #8]
Lloh5:
	adrp	x9, _TYPHOON_REG_CMD_READY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TYPHOON_REG_CMD_READY@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x0, [x20, #8]
	bl	_typhoon_post_pci_writes
	ldr	w8, [x23]
Lloh8:
	adrp	x9, _TYPHOON_CMD_RESPOND@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TYPHOON_CMD_RESPOND@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.7:
Lloh11:
	adrp	x24, _TYPHOON_WAIT_TIMEOUT@GOTPAGE
Lloh12:
	ldr	x24, [x24, _TYPHOON_WAIT_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.8:
	mov	w25, #1
Lloh13:
	adrp	x26, _TYPHOON_UDELAY@GOTPAGE
Lloh14:
	ldr	x26, [x26, _TYPHOON_UDELAY@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_typhoon_process_response
	mov	x23, x0
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [x26]
	bl	_udelay
	ldr	w8, [x24]
	cmp	w25, w8
	add	w25, w25, #1
	ccmp	w23, #0, #0, lt
	b.ne	LBB0_14
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	x8, x9, [x28]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w23, #0
	b	LBB0_10
LBB0_13:
	ldr	w0, [x20, #16]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x25
	mov	x3, x24
	mov	x5, x21
	bl	_netdev_err
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_19
LBB0_14:
	cbz	w23, LBB0_18
; %bb.15:
	ldr	w8, [x22]
Lloh19:
	adrp	x9, _TYPHOON_RESP_ERROR@GOTPAGE
Lloh20:
	ldr	x9, [x9, _TYPHOON_RESP_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_19
LBB0_17:
	mov	w21, #0
	ldr	w8, [x20]
	cbnz	w8, LBB0_20
	b	LBB0_22
LBB0_18:
Lloh24:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w8, [x20]
	cbz	w8, LBB0_22
LBB0_20:
	str	wzr, [x20]
	bl	_smp_wmb
	ldp	x8, x9, [x28]
	cmp	x8, x9
	b.eq	LBB0_22
; %bb.21:
	ldr	x8, [x20, #8]
Lloh26:
	adrp	x9, _TYPHOON_REG_SELF_INTERRUPT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _TYPHOON_REG_SELF_INTERRUPT@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #1
	bl	_iowrite32
LBB0_22:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no descs for cmd, had (needed) %d (%d) cmd, %d (%d) resp\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TYPHOON_CMD_RESPOND,4,2        ; @TYPHOON_CMD_RESPOND
	.comm	_COMMAND_RING_SIZE,8,3          ; @COMMAND_RING_SIZE
	.comm	_TYPHOON_REG_CMD_READY,8,3      ; @TYPHOON_REG_CMD_READY
	.comm	_TYPHOON_WAIT_TIMEOUT,4,2       ; @TYPHOON_WAIT_TIMEOUT
	.comm	_TYPHOON_UDELAY,4,2             ; @TYPHOON_UDELAY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_TYPHOON_RESP_ERROR,4,2         ; @TYPHOON_RESP_ERROR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TYPHOON_REG_SELF_INTERRUPT,8,3 ; @TYPHOON_REG_SELF_INTERRUPT
	.no_dead_strip	_typhoon_issue_command
.subsections_via_symbols
