	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_emu10k1_spi_write          ## -- Begin function snd_emu10k1_spi_write
	.p2align	4, 0x90
_snd_emu10k1_spi_write:                 ## @snd_emu10k1_spi_write
	.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, %r12d
	movq	%rdi, %r13
	callq	_spin_lock
	movl	$1, %r14d
	cmpl	$65535, %r12d                   ## imm = 0xFFFF
	ja	LBB0_6
## %bb.1:
	movq	8(%r13), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.2:
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	callq	_snd_emu10k1_ptr20_read
	andl	$-262144, %eax                  ## imm = 0xFFFC0000
	orl	%eax, %r12d
	movl	%r12d, %r15d
	orl	$131072, %r15d                  ## imm = 0x20000
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_snd_emu10k1_ptr20_write
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	callq	_snd_emu10k1_ptr20_read
	orl	$196608, %r12d                  ## imm = 0x30000
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	movl	%r12d, %ecx
	callq	_snd_emu10k1_ptr20_write
	movl	$100, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10, %edi
	callq	_udelay
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	callq	_snd_emu10k1_ptr20_read
	testl	$65536, %eax                    ## imm = 0x10000
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	decl	%ebx
	jne	LBB0_4
	jmp	LBB0_6
LBB0_5:
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_snd_emu10k1_ptr20_write
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	callq	_snd_emu10k1_ptr20_read
LBB0_6:
	movq	%r13, %rdi
	callq	_spin_unlock
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_emu10k1_spi_write          ; -- Begin function snd_emu10k1_spi_write
	.p2align	2
_snd_emu10k1_spi_write:                 ; @snd_emu10k1_spi_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_spin_lock
	mov	w21, #1
	lsr	w8, w20, #16
	cbnz	w8, LBB0_7
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.2:
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_snd_emu10k1_ptr20_read
	and	w8, w0, #0xfffc0000
	orr	w21, w8, w20
	orr	w20, w21, #0x20000
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	mov	x3, x20
	bl	_snd_emu10k1_ptr20_write
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_snd_emu10k1_ptr20_read
	orr	w3, w21, #0x30000
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_snd_emu10k1_ptr20_write
	mov	w21, #100
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10
	bl	_udelay
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_snd_emu10k1_ptr20_read
	tbz	w0, #16, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	w21, w21, #1
	b.ne	LBB0_3
; %bb.5:
	mov	w21, #1
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	mov	x3, x20
	bl	_snd_emu10k1_ptr20_write
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_snd_emu10k1_ptr20_read
	mov	w21, #0
LBB0_7:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
