	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl1251_chip_wakeup
_wl1251_chip_wakeup:                    ## @wl1251_chip_wakeup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_wl1251_power_on
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movq	_WL1251_POWER_ON_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	_REGISTERS_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_REGISTERS_DOWN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_wl1251_set_partition
	movq	%rbx, %rdi
	callq	_wl1251_fw_wakeup
	movq	_CHIP_ID_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_reg_read32
	movl	%eax, (%rbx)
	cmpl	$129, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.3:
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	$128, %edx
	jmp	LBB0_5
LBB0_4:
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$129, %edx
LBB0_5:
	callq	_wl1251_debug
	cmpq	$0, 8(%rbx)
	jne	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_wl1251_fetch_firmware          ## TAILCALL
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_wl1251_error
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WL1251_POWER_ON_SLEEP,4,2      ## @WL1251_POWER_ON_SLEEP
	.comm	_REGISTERS_BASE,4,2             ## @REGISTERS_BASE
	.comm	_REGISTERS_DOWN_SIZE,4,2        ## @REGISTERS_DOWN_SIZE
	.comm	_CHIP_ID_B,4,2                  ## @CHIP_ID_B
	.comm	_DEBUG_BOOT,4,2                 ## @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chip id 0x%x (1251 PG12)"

L_.str.1:                               ## @.str.1
	.asciz	"chip id 0x%x (1251 PG11)"

L_.str.2:                               ## @.str.2
	.asciz	"unsupported chip id: 0x%x"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_wl1251_chip_wakeup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl1251_chip_wakeup
_wl1251_chip_wakeup:                    ; @wl1251_chip_wakeup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_wl1251_power_on
	mov	x19, x0
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _WL1251_POWER_ON_SLEEP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WL1251_POWER_ON_SLEEP@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msleep
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
Lloh3:
	adrp	x8, _REGISTERS_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REGISTERS_BASE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
Lloh6:
	adrp	x8, _REGISTERS_DOWN_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REGISTERS_DOWN_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_wl1251_set_partition
	mov	x0, x20
	bl	_wl1251_fw_wakeup
Lloh9:
	adrp	x8, _CHIP_ID_B@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CHIP_ID_B@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_reg_read32
	str	w0, [x20]
	cmp	w0, #129
	b.eq	LBB0_4
; %bb.2:
	mov	x1, x0
	cmp	w0, #128
	b.ne	LBB0_7
; %bb.3:
Lloh12:
	adrp	x8, _DEBUG_BOOT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEBUG_BOOT@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #128
	b	LBB0_5
LBB0_4:
Lloh17:
	adrp	x8, _DEBUG_BOOT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DEBUG_BOOT@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #129
LBB0_5:
	bl	_wl1251_debug
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_8
; %bb.6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_wl1251_fetch_firmware
LBB0_7:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_wl1251_error
Lloh24:
	adrp	x8, _ENODEV@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_WL1251_POWER_ON_SLEEP,4,2      ; @WL1251_POWER_ON_SLEEP
	.comm	_REGISTERS_BASE,4,2             ; @REGISTERS_BASE
	.comm	_REGISTERS_DOWN_SIZE,4,2        ; @REGISTERS_DOWN_SIZE
	.comm	_CHIP_ID_B,4,2                  ; @CHIP_ID_B
	.comm	_DEBUG_BOOT,4,2                 ; @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chip id 0x%x (1251 PG12)"

l_.str.1:                               ; @.str.1
	.asciz	"chip id 0x%x (1251 PG11)"

l_.str.2:                               ; @.str.2
	.asciz	"unsupported chip id: 0x%x"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_wl1251_chip_wakeup
.subsections_via_symbols
