	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b43legacy_wireless_core_attach
_b43legacy_wireless_core_attach:        ## @b43legacy_wireless_core_attach
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	8(%rax), %r14
	movq	(%r14), %rax
	movq	_SSB_BUSTYPE_PCI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	8(%r14), %r13
	jmp	LBB0_3
LBB0_1:
	xorl	%r13d, %r13d
LBB0_3:
	movq	24(%r12), %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ssb_bus_powerup
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_b43legacyerr
	jmp	LBB0_27
LBB0_5:
	movq	(%r12), %rdi
	movl	(%rdi), %eax
	cmpl	$5, %eax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jl	LBB0_7
## %bb.6:
	movq	_SSB_TMSHIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ssb_read32
	movq	_B43legacy_TMSHIGH_GPHY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	setne	%al
	jmp	LBB0_8
LBB0_7:
	cmpl	$4, %eax
	sete	%al
LBB0_8:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 12(%r12)
	movq	_B43legacy_TMSLOW_GMODE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_b43legacy_wireless_core_reset
	movq	%r12, %rdi
	callq	_b43legacy_phy_versioning
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_26
## %bb.9:
	testq	%r13, %r13
	je	LBB0_13
## %bb.10:
	movl	$-17170, %eax                   ## imm = 0xBCEE
	addl	(%r13), %eax
	cmpl	$18, %eax
	ja	LBB0_13
## %bb.11:
	movl	$262273, %ecx                   ## imm = 0x40081
	btl	%eax, %ecx
	jae	LBB0_13
## %bb.12:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %r13d
	xorb	$1, %r13b
	jmp	LBB0_19
LBB0_13:
	movl	20(%r12), %eax
	cmpl	$129, %eax
	je	LBB0_14
## %bb.15:
	cmpl	$128, %eax
	jne	LBB0_17
## %bb.16:
	movb	$1, %cl
	xorl	%r13d, %r13d
	jmp	LBB0_19
LBB0_14:
	movb	$1, %r13b
	jmp	LBB0_18
LBB0_17:
	movl	$1, %edi
	callq	_B43legacy_BUG_ON
	xorl	%r13d, %r13d
LBB0_18:
	xorl	%ecx, %ecx
LBB0_19:
	movl	%r13d, %eax
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	orb	%cl, %al
	movzbl	%al, %eax
	movl	%eax, 12(%r12)
	xorl	%esi, %esi
	testb	%al, %al
	je	LBB0_21
## %bb.20:
	movl	(%r15), %esi
LBB0_21:
	movq	%r12, %rdi
	callq	_b43legacy_wireless_core_reset
	movq	%r12, %rdi
	callq	_b43legacy_validate_chipaccess
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_26
## %bb.22:
	movzbl	%r13b, %esi
	movzbl	-44(%rbp), %edx                 ## 1-byte Folded Reload
	movq	%r12, %rdi
	callq	_b43legacy_setup_modes
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_26
## %bb.23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_25
## %bb.24:
	movq	%r12, (%rax)
LBB0_25:
	leaq	8(%r12), %rdi
	movq	_b43legacy_chip_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_b43legacy_radio_turn_off
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_b43legacy_switch_analog
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	_ssb_device_disable
LBB0_26:
	movq	%r14, %rdi
	callq	_ssb_bus_may_powerdown
LBB0_27:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSB_BUSTYPE_PCI,8,3            ## @SSB_BUSTYPE_PCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bus powerup failed\n"

	.comm	_SSB_TMSHIGH,4,2                ## @SSB_TMSHIGH
	.comm	_B43legacy_TMSHIGH_GPHY,4,2     ## @B43legacy_TMSHIGH_GPHY
	.comm	_B43legacy_TMSLOW_GMODE,4,2     ## @B43legacy_TMSLOW_GMODE
	.comm	_b43legacy_chip_reset,4,2       ## @b43legacy_chip_reset
	.no_dead_strip	_b43legacy_wireless_core_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function b43legacy_wireless_core_attach
_b43legacy_wireless_core_attach:        ; @b43legacy_wireless_core_attach
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	ldr	x21, [x0, #24]
	ldr	x8, [x0]
	ldr	x19, [x8, #8]
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _SSB_BUSTYPE_PCI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SSB_BUSTYPE_PCI@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x23, [x19, #8]
	b	LBB0_3
LBB0_2:
	mov	x23, #0
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	bl	_ssb_bus_powerup
	cbz	w0, LBB0_5
; %bb.4:
	mov	x24, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_b43legacyerr
	b	LBB0_21
LBB0_5:
	ldr	x0, [x20]
	ldr	w8, [x0]
	cmp	w8, #5
	b.lt	LBB0_7
; %bb.6:
Lloh5:
	adrp	x8, _SSB_TMSHIGH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SSB_TMSHIGH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_ssb_read32
Lloh8:
	adrp	x8, _B43legacy_TMSHIGH_GPHY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _B43legacy_TMSHIGH_GPHY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w22, ne
	b	LBB0_8
LBB0_7:
	cmp	w8, #4
	cset	w22, eq
LBB0_8:
	movi.2s	v0, #1
	stur	d0, [x20, #12]
Lloh11:
	adrp	x25, _B43legacy_TMSLOW_GMODE@GOTPAGE
Lloh12:
	ldr	x25, [x25, _B43legacy_TMSLOW_GMODE@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_b43legacy_wireless_core_reset
	mov	x0, x20
	bl	_b43legacy_phy_versioning
	mov	x24, x0
	cbnz	w0, LBB0_20
; %bb.9:
	cbz	x23, LBB0_13
; %bb.10:
	ldr	w8, [x23]
	mov	w9, #-17170
	add	w8, w8, w9
	cmp	w8, #18
	b.hi	LBB0_13
; %bb.11:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #129
	movk	w9, #4, lsl #16
	tst	w8, w9
	b.eq	LBB0_13
; %bb.12:
	eor	w23, w22, #0x1
	b	LBB0_18
LBB0_13:
	ldr	w8, [x20, #20]
	cmp	w8, #129
	b.eq	LBB0_16
; %bb.14:
	cmp	w8, #128
	b.ne	LBB0_17
; %bb.15:
	mov	w23, #0
	mov	w22, #1
	b	LBB0_18
LBB0_16:
	mov	w22, #0
	mov	w23, #1
	b	LBB0_18
LBB0_17:
	mov	w0, #1
	bl	_B43legacy_BUG_ON
	mov	w23, #0
	mov	w22, #0
LBB0_18:
	orr	w8, w23, w22
	str	w8, [x20, #12]
	ldr	w9, [x25]
	cmp	w8, #0
	csel	w1, w9, wzr, ne
	mov	x0, x20
	bl	_b43legacy_wireless_core_reset
	mov	x0, x20
	bl	_b43legacy_validate_chipaccess
	mov	x24, x0
	cbnz	w0, LBB0_20
; %bb.19:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_b43legacy_setup_modes
	mov	x24, x0
	cbz	w0, LBB0_22
LBB0_20:
	mov	x0, x19
	bl	_ssb_bus_may_powerdown
LBB0_21:
	mov	x0, x24
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
	ldr	x8, [x21]
	cbnz	x8, LBB0_24
; %bb.23:
	str	x20, [x21]
LBB0_24:
	add	x0, x20, #8
Lloh13:
	adrp	x8, _b43legacy_chip_reset@GOTPAGE
Lloh14:
	ldr	x8, [x8, _b43legacy_chip_reset@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_INIT_WORK
	mov	x0, x20
	mov	w1, #1
	bl	_b43legacy_radio_turn_off
	mov	x0, x20
	mov	w1, #0
	bl	_b43legacy_switch_analog
	ldr	x0, [x20]
	mov	w1, #0
	bl	_ssb_device_disable
	mov	x0, x19
	bl	_ssb_bus_may_powerdown
	mov	w24, #0
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SSB_BUSTYPE_PCI,8,3            ; @SSB_BUSTYPE_PCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bus powerup failed\n"

	.comm	_SSB_TMSHIGH,4,2                ; @SSB_TMSHIGH
	.comm	_B43legacy_TMSHIGH_GPHY,4,2     ; @B43legacy_TMSHIGH_GPHY
	.comm	_B43legacy_TMSLOW_GMODE,4,2     ; @B43legacy_TMSLOW_GMODE
	.comm	_b43legacy_chip_reset,4,2       ; @b43legacy_chip_reset
	.no_dead_strip	_b43legacy_wireless_core_attach
.subsections_via_symbols
