	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_korg1212_downloadDSPCode
_snd_korg1212_downloadDSPCode:          ## @snd_korg1212_downloadDSPCode
	.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
	movq	%rdi, %rbx
	movq	_stateName@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rdi), %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_K1212_DEBUG_PRINTK
	movq	_K1212_STATE_DSP_IN_PROCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$1, %r14d
	cmpq	%rsi, (%rbx)
	jae	LBB0_6
## %bb.1:
	movq	%rbx, %rdi
	callq	_snd_korg1212_setCardState
	movq	_K1212_DB_StartDSPDownload@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	20(%rbx), %edi
	callq	_UpperWordSwap
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_snd_korg1212_Send1212Command
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movq	(%r15), %rcx
	movq	(%rbx), %rdx
	movl	(%rcx,%rdx,4), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_K1212_DEBUG_PRINTK
LBB0_3:
	movq	$0, 8(%rbx)
	movl	16(%rbx), %edi
	movq	_HZ@GOTPCREL(%rip), %rax
	movq	_CARD_BOOT_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	imull	(%rax), %edx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_wait_event_timeout
	cmpq	$0, 8(%rbx)
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_snd_korg1212_OnDSPDownloadComplete
	jmp	LBB0_6
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_6:
	movl	%r14d, %eax
	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: DSP download is starting... [%s]\n"

	.comm	_stateName,8,3                  ## @stateName
	.comm	_K1212_STATE_DSP_IN_PROCESS,8,3 ## @K1212_STATE_DSP_IN_PROCESS
	.comm	_K1212_DB_StartDSPDownload,4,2  ## @K1212_DB_StartDSPDownload
L_.str.1:                               ## @.str.1
	.asciz	"K1212_DEBUG: Start DSP Download RC = %d [%s]\n"

	.comm	_HZ,4,2                         ## @HZ
	.comm	_CARD_BOOT_TIMEOUT,4,2          ## @CARD_BOOT_TIMEOUT
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_snd_korg1212_downloadDSPCode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_korg1212_downloadDSPCode
_snd_korg1212_downloadDSPCode:          ; @snd_korg1212_downloadDSPCode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	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
	ldr	x8, [x19]
Lloh4:
	adrp	x9, _K1212_STATE_DSP_IN_PROCESS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _K1212_STATE_DSP_IN_PROCESS@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x9]
	cmp	x8, x1
	b.hs	LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_snd_korg1212_setCardState
Lloh7:
	adrp	x8, _K1212_DB_StartDSPDownload@GOTPAGE
Lloh8:
	ldr	x8, [x8, _K1212_DB_StartDSPDownload@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	ldr	w0, [x19, #20]
	bl	_UpperWordSwap
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_snd_korg1212_Send1212Command
	cbz	w0, LBB0_3
; %bb.2:
	mov	x1, x0
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	w8, [x8, x9, lsl #2]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_K1212_DEBUG_PRINTK
LBB0_3:
	str	xzr, [x19, #8]
Lloh12:
	adrp	x8, _HZ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
	ldr	w0, [x19, #16]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _CARD_BOOT_TIMEOUT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CARD_BOOT_TIMEOUT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	mul	w2, w9, w8
	mov	x1, #0
	bl	_wait_event_timeout
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_snd_korg1212_OnDSPDownloadComplete
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	mov	w0, #1
	b	LBB0_7
LBB0_6:
Lloh18:
	adrp	x8, _EBUSY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"K1212_DEBUG: DSP download is starting... [%s]\n"

	.comm	_stateName,8,3                  ; @stateName
	.comm	_K1212_STATE_DSP_IN_PROCESS,8,3 ; @K1212_STATE_DSP_IN_PROCESS
	.comm	_K1212_DB_StartDSPDownload,4,2  ; @K1212_DB_StartDSPDownload
l_.str.1:                               ; @.str.1
	.asciz	"K1212_DEBUG: Start DSP Download RC = %d [%s]\n"

	.comm	_HZ,4,2                         ; @HZ
	.comm	_CARD_BOOT_TIMEOUT,4,2          ; @CARD_BOOT_TIMEOUT
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_snd_korg1212_downloadDSPCode
.subsections_via_symbols
