	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl12xx_fetch_firmware
_wl12xx_fetch_firmware:                 ## @wl12xx_fetch_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movq	_WL12XX_FW_TYPE_PLT@GOTPCREL(%rip), %rax
	movq	%r14, %rcx
	jmp	LBB0_6
LBB0_2:
	cmpl	$2, 8(%r14)
	jl	LBB0_5
## %bb.3:
	movq	16(%r14), %r15
	testq	%r15, %r15
	je	LBB0_5
## %bb.4:
	movq	_WL12XX_FW_TYPE_MULTI@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	leaq	24(%r14), %rcx
	movq	_WL12XX_FW_TYPE_NORMAL@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rcx), %r15
LBB0_7:
	movl	(%rax), %r12d
	xorl	%ebx, %ebx
	cmpl	%r12d, 32(%r14)
	je	LBB0_17
## %bb.8:
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_wl1271_debug
	movl	44(%r14), %edx
	leaq	-40(%rbp), %rdi
	movq	%r15, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movq	-40(%rbp), %rax
	movl	(%rax), %esi
	testb	$3, %sil
	je	LBB0_12
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wl1271_error
	movq	_EILSEQ@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_wl1271_error
	jmp	LBB0_17
LBB0_12:
	movl	40(%r14), %edi
	callq	_vfree
	movq	_WL12XX_FW_TYPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movq	-40(%rbp), %rax
	movl	(%rax), %edi
	movl	%edi, 36(%r14)
	callq	_vmalloc
	movl	%eax, 40(%r14)
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movq	-40(%rbp), %rcx
	movl	4(%rcx), %esi
	movl	36(%r14), %edx
	movl	%eax, %edi
	callq	_memcpy
	movl	%r12d, 32(%r14)
	xorl	%ebx, %ebx
LBB0_16:
	movq	-40(%rbp), %rdi
	callq	_release_firmware
LBB0_17:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wl1271_error
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_WL12XX_FW_TYPE_PLT,4,2         ## @WL12XX_FW_TYPE_PLT
	.comm	_WL12XX_FW_TYPE_MULTI,4,2       ## @WL12XX_FW_TYPE_MULTI
	.comm	_WL12XX_FW_TYPE_NORMAL,4,2      ## @WL12XX_FW_TYPE_NORMAL
	.comm	_DEBUG_BOOT,4,2                 ## @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"booting firmware %s"

L_.str.1:                               ## @.str.1
	.asciz	"could not get firmware %s: %d"

L_.str.2:                               ## @.str.2
	.asciz	"firmware size is not multiple of 32 bits: %zu"

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_WL12XX_FW_TYPE_NONE,4,2        ## @WL12XX_FW_TYPE_NONE
L_.str.3:                               ## @.str.3
	.asciz	"could not allocate memory for the firmware"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_wl12xx_fetch_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl12xx_fetch_firmware
_wl12xx_fetch_firmware:                 ; @wl12xx_fetch_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	w1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _WL12XX_FW_TYPE_PLT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WL12XX_FW_TYPE_PLT@GOTPAGEOFF]
	mov	x9, x19
	b	LBB0_6
LBB0_2:
	ldr	w8, [x19, #8]
	cmp	w8, #2
	b.lt	LBB0_5
; %bb.3:
	ldr	x20, [x19, #16]
	cbz	x20, LBB0_5
; %bb.4:
Lloh2:
	adrp	x8, _WL12XX_FW_TYPE_MULTI@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WL12XX_FW_TYPE_MULTI@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	add	x9, x19, #24
Lloh4:
	adrp	x8, _WL12XX_FW_TYPE_NORMAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WL12XX_FW_TYPE_NORMAL@GOTPAGEOFF]
LBB0_6:
	ldr	x20, [x9]
LBB0_7:
	ldr	w22, [x8]
	ldr	w8, [x19, #32]
	cmp	w8, w22
	b.ne	LBB0_9
; %bb.8:
	mov	w21, #0
	b	LBB0_17
LBB0_9:
Lloh6:
	adrp	x8, _DEBUG_BOOT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEBUG_BOOT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_wl1271_debug
	ldr	w2, [x19, #44]
	add	x0, sp, #24
	mov	x1, x20
	bl	_request_firmware
	tbnz	w0, #31, LBB0_13
; %bb.10:
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	tst	w8, #0x3
	b.eq	LBB0_14
; %bb.11:
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_wl1271_error
Lloh13:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_16
LBB0_13:
	mov	x21, x0
	stp	x20, x21, [sp]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_wl1271_error
	b	LBB0_17
LBB0_14:
	ldr	w0, [x19, #40]
	bl	_vfree
Lloh17:
	adrp	x8, _WL12XX_FW_TYPE_NONE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _WL12XX_FW_TYPE_NONE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	x9, [sp, #24]
	ldr	w0, [x9]
	stp	w8, w0, [x19, #32]
	bl	_vmalloc
	str	w0, [x19, #40]
	cbz	w0, LBB0_18
; %bb.15:
	ldr	x8, [sp, #24]
	ldr	w1, [x8, #4]
	ldr	w2, [x19, #36]
	bl	_memcpy
	mov	w21, #0
	str	w22, [x19, #32]
LBB0_16:
	ldr	x0, [sp, #24]
	bl	_release_firmware
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_wl1271_error
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_WL12XX_FW_TYPE_PLT,4,2         ; @WL12XX_FW_TYPE_PLT
	.comm	_WL12XX_FW_TYPE_MULTI,4,2       ; @WL12XX_FW_TYPE_MULTI
	.comm	_WL12XX_FW_TYPE_NORMAL,4,2      ; @WL12XX_FW_TYPE_NORMAL
	.comm	_DEBUG_BOOT,4,2                 ; @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"booting firmware %s"

l_.str.1:                               ; @.str.1
	.asciz	"could not get firmware %s: %d"

l_.str.2:                               ; @.str.2
	.asciz	"firmware size is not multiple of 32 bits: %zu"

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_WL12XX_FW_TYPE_NONE,4,2        ; @WL12XX_FW_TYPE_NONE
l_.str.3:                               ; @.str.3
	.asciz	"could not allocate memory for the firmware"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_wl12xx_fetch_firmware
.subsections_via_symbols
