	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function if_sdio_prog_firmware
_if_sdio_prog_firmware:                 ## @if_sdio_prog_firmware
	.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	8(%rdi), %rdi
	callq	_sdio_claim_host
	movq	8(%rbx), %rdi
	movq	_IF_SDIO_H_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %r14
	xorl	%esi, %esi
	movq	%r14, %rcx
	callq	_sdio_writeb
	movq	8(%rbx), %rdi
	callq	_sdio_release_host
	movq	8(%rbx), %rdi
	callq	_sdio_claim_host
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_if_sdio_read_scratch
	movl	%eax, %r14d
	movq	8(%rbx), %rdi
	callq	_sdio_release_host
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_lbs_deb_sdio
	movl	-28(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_lbs_deb_sdio
	movl	-28(%rbp), %r15d
	testl	%r15d, %r15d
	jne	LBB0_8
## %bb.1:
	movq	_IF_SDIO_FIRMWARE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_4
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_4:
	movq	(%rbx), %rdx
	movq	_MODEL_8686@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_7
## %bb.5:
	andl	$32767, %r14d                   ## imm = 0x7FFF
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
LBB0_3:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_lbs_deb_sdio
	movq	%rbx, %rdi
	callq	_if_sdio_finish_power_on
	jmp	LBB0_8
LBB0_7:
	movl	16(%rbx), %edi
	movq	8(%rbx), %rsi
	movq	_fw_table@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_if_sdio_do_prog_firmware@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_lbs_get_firmware_async
	movl	%eax, %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IF_SDIO_H_INT_MASK,4,2         ## @IF_SDIO_H_INT_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware status = %#x\n"

L_.str.1:                               ## @.str.1
	.asciz	"scratch ret = %d\n"

	.comm	_IF_SDIO_FIRMWARE_OK,4,2        ## @IF_SDIO_FIRMWARE_OK
L_.str.2:                               ## @.str.2
	.asciz	"firmware already loaded\n"

	.comm	_MODEL_8686,8,3                 ## @MODEL_8686
L_.str.3:                               ## @.str.3
	.asciz	"firmware may be running\n"

	.comm	_fw_table,4,2                   ## @fw_table
	.comm	_if_sdio_do_prog_firmware,4,2   ## @if_sdio_do_prog_firmware
	.no_dead_strip	_if_sdio_prog_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function if_sdio_prog_firmware
_if_sdio_prog_firmware:                 ; @if_sdio_prog_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_sdio_claim_host
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x8, _IF_SDIO_H_INT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IF_SDIO_H_INT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w1, #0
	bl	_sdio_writeb
	ldr	x0, [x19, #8]
	bl	_sdio_release_host
	ldr	x0, [x19, #8]
	bl	_sdio_claim_host
	add	x1, sp, #12
	mov	x0, x19
	bl	_if_sdio_read_scratch
	mov	x20, x0
	ldr	x0, [x19, #8]
	bl	_sdio_release_host
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lbs_deb_sdio
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_lbs_deb_sdio
	ldr	w0, [sp, #12]
	cbnz	w0, LBB0_7
; %bb.1:
Lloh7:
	adrp	x8, _IF_SDIO_FIRMWARE_OK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IF_SDIO_FIRMWARE_OK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_3
; %bb.2:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_3:
	ldr	x2, [x19]
Lloh12:
	adrp	x8, _MODEL_8686@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MODEL_8686@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	and	w9, w20, #0x7fff
	cmp	x2, x8
	ccmp	w9, #0, #4, eq
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [x19, #16]
	ldr	x1, [x19, #8]
Lloh15:
	adrp	x8, _fw_table@GOTPAGE
Lloh16:
	ldr	x8, [x8, _fw_table@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
Lloh18:
	adrp	x8, _if_sdio_do_prog_firmware@GOTPAGE
Lloh19:
	ldr	x8, [x8, _if_sdio_do_prog_firmware@GOTPAGEOFF]
Lloh20:
	ldr	w4, [x8]
	bl	_lbs_get_firmware_async
	b	LBB0_7
LBB0_5:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_6:
	bl	_lbs_deb_sdio
	mov	x0, x19
	bl	_if_sdio_finish_power_on
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_IF_SDIO_H_INT_MASK,4,2         ; @IF_SDIO_H_INT_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware status = %#x\n"

l_.str.1:                               ; @.str.1
	.asciz	"scratch ret = %d\n"

	.comm	_IF_SDIO_FIRMWARE_OK,4,2        ; @IF_SDIO_FIRMWARE_OK
l_.str.2:                               ; @.str.2
	.asciz	"firmware already loaded\n"

	.comm	_MODEL_8686,8,3                 ; @MODEL_8686
l_.str.3:                               ; @.str.3
	.asciz	"firmware may be running\n"

	.comm	_fw_table,4,2                   ; @fw_table
	.comm	_if_sdio_do_prog_firmware,4,2   ; @if_sdio_do_prog_firmware
	.no_dead_strip	_if_sdio_prog_firmware
.subsections_via_symbols
