	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_korg1212_prepare
_snd_korg1212_prepare:                  ## @snd_korg1212_prepare
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_snd_pcm_substream_chip
	movq	%rax, %rbx
	movq	_stateName@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	L_.str(%rip), %rdi
	callq	_K1212_DEBUG_PRINTK
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	cmpq	$0, 8(%rbx)
	jle	LBB0_2
## %bb.1:
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_K1212_DEBUG_PRINTK
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_snd_korg1212_SetupForPlay
	movl	%eax, %r15d
	movq	$0, 24(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	testl	%r15d, %r15d
	cmovel	%r15d, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"K1212_DEBUG: snd_korg1212_prepare [%s]\n"

	.comm	_stateName,8,3                  ## @stateName
L_.str.1:                               ## @.str.1
	.asciz	"K1212_DEBUG: snd_korg1212_prepare - Stop is pending... [%s]\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_snd_korg1212_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_korg1212_prepare
_snd_korg1212_prepare:                  ; @snd_korg1212_prepare
	.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
	bl	_snd_pcm_substream_chip
	mov	x19, x0
Lloh0:
	adrp	x21, _stateName@GOTPAGE
Lloh1:
	ldr	x21, [x21, _stateName@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x0]
	ldr	w1, [x8, x9, lsl #2]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_K1212_DEBUG_PRINTK
	add	x20, x19, #16
	mov	x0, x20
	bl	_spin_lock_irq
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	w1, [x8, x9, lsl #2]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_K1212_DEBUG_PRINTK
	mov	x0, x20
	bl	_spin_unlock_irq
Lloh6:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_snd_korg1212_SetupForPlay
	mov	x21, x0
	str	xzr, [x19, #24]
	mov	x0, x20
	bl	_spin_unlock_irq
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w0, wzr, w8, eq
LBB0_3:
	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
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"K1212_DEBUG: snd_korg1212_prepare [%s]\n"

	.comm	_stateName,8,3                  ; @stateName
l_.str.1:                               ; @.str.1
	.asciz	"K1212_DEBUG: snd_korg1212_prepare - Stop is pending... [%s]\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_snd_korg1212_prepare
.subsections_via_symbols
