	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function azx_corb_send_cmd
_azx_corb_send_cmd:                     ## @azx_corb_send_cmd
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	(%rdi), %rbx
	movl	%esi, %edi
	callq	_azx_command_addr
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	_CORBWP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_azx_readw
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	incl	%eax
	movq	_ICH6_MAX_CORB_ENTRIES@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	divl	(%rcx)
	movl	%edx, %r13d
	movq	_CORBRP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_azx_readw
	cmpl	%eax, %r13d
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_5:
	movq	16(%rbx), %rax
	movl	%r12d, %ecx
	incl	(%rax,%rcx,4)
	movl	%r15d, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movl	%r13d, %edx
	movl	%eax, (%rcx,%rdx,4)
	movq	_CORBWP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_azx_writel
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CORBWP,4,2                     ## @CORBWP
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ICH6_MAX_CORB_ENTRIES,4,2      ## @ICH6_MAX_CORB_ENTRIES
	.comm	_CORBRP,4,2                     ## @CORBRP
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_azx_corb_send_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function azx_corb_send_cmd
_azx_corb_send_cmd:                     ; @azx_corb_send_cmd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	ldr	x19, [x0]
	mov	x0, x1
	bl	_azx_command_addr
	mov	x21, x0
	mov	x0, x19
	bl	_spin_lock_irq
Lloh0:
	adrp	x23, _CORBWP@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CORBWP@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_azx_readw
	mov	w8, #65535
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_spin_unlock_irq
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	add	w8, w0, #1
Lloh4:
	adrp	x9, _ICH6_MAX_CORB_ENTRIES@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ICH6_MAX_CORB_ENTRIES@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	udiv	w10, w8, w9
	msub	w22, w10, w9, w8
Lloh7:
	adrp	x8, _CORBRP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CORBRP@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_azx_readw
	cmp	w22, w0
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_spin_unlock_irq
Lloh10:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	ldr	x8, [x19, #16]
	mov	w9, w21
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	mov	x0, x20
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	w0, [x8, w22, uxtw #2]
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x22
	bl	_azx_writel
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CORBWP,4,2                     ; @CORBWP
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ICH6_MAX_CORB_ENTRIES,4,2      ; @ICH6_MAX_CORB_ENTRIES
	.comm	_CORBRP,4,2                     ; @CORBRP
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_azx_corb_send_cmd
.subsections_via_symbols
