	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43legacy_radio_selectchannel  ## -- Begin function b43legacy_radio_selectchannel
	.p2align	4, 0x90
_b43legacy_radio_selectchannel:         ## @b43legacy_radio_selectchannel
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	cmpl	$255, %esi
	jne	LBB0_4
## %bb.1:
	movl	8(%r12), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_3
## %bb.2:
	movq	_B43legacy_RADIO_DEFAULT_CHANNEL_BG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_4:
	testl	%r15d, %r15d
	je	LBB0_6
LBB0_5:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_b43legacy_synth_pu_workaround
LBB0_6:
	movq	_B43legacy_MMIO_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_channel2freq_bg
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_b43legacy_write16
	cmpl	$14, %r14d
	jne	LBB0_8
## %bb.7:
	movq	(%r12), %rax
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	cmpl	$5, (%rax)
	setne	%bl
	movq	_B43legacy_SHM_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_B43legacy_UCODEFLAGS_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_b43legacy_shm_read32
	andl	$-129, %eax
	shll	$7, %ebx
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	callq	_b43legacy_shm_write32
	movq	_B43legacy_MMIO_CHANNEL_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_b43legacy_read16
	orl	$2048, %eax                     ## imm = 0x800
	jmp	LBB0_9
LBB0_8:
	movq	_B43legacy_MMIO_CHANNEL_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_b43legacy_read16
	andl	$63423, %eax                    ## imm = 0xF7BF
LBB0_9:
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_b43legacy_write16
	movl	%r14d, 12(%r12)
	movl	$8, %edi
	callq	_msleep
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	$1, %edi
	callq	_B43legacy_WARN_ON
	movl	$255, %r14d
	testl	%r15d, %r15d
	jne	LBB0_5
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_B43legacy_RADIO_DEFAULT_CHANNEL_BG,4,2 ## @B43legacy_RADIO_DEFAULT_CHANNEL_BG
	.comm	_B43legacy_MMIO_CHANNEL,4,2     ## @B43legacy_MMIO_CHANNEL
	.comm	_B43legacy_SHM_SHARED,4,2       ## @B43legacy_SHM_SHARED
	.comm	_B43legacy_UCODEFLAGS_OFFSET,4,2 ## @B43legacy_UCODEFLAGS_OFFSET
	.comm	_B43legacy_MMIO_CHANNEL_EXT,4,2 ## @B43legacy_MMIO_CHANNEL_EXT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43legacy_radio_selectchannel  ; -- Begin function b43legacy_radio_selectchannel
	.p2align	2
_b43legacy_radio_selectchannel:         ; @b43legacy_radio_selectchannel
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	cmp	w1, #255
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x19, #8]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_9
; %bb.2:
Lloh0:
	adrp	x8, _B43legacy_RADIO_DEFAULT_CHANNEL_BG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _B43legacy_RADIO_DEFAULT_CHANNEL_BG@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
LBB0_3:
	cbz	w21, LBB0_5
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_b43legacy_synth_pu_workaround
LBB0_5:
Lloh3:
	adrp	x8, _B43legacy_MMIO_CHANNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _B43legacy_MMIO_CHANNEL@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_channel2freq_bg
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_b43legacy_write16
	cmp	w20, #14
	b.ne	LBB0_7
; %bb.6:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #5
	cset	w23, ne
Lloh6:
	adrp	x8, _B43legacy_SHM_SHARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _B43legacy_SHM_SHARED@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
Lloh9:
	adrp	x8, _B43legacy_UCODEFLAGS_OFFSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B43legacy_UCODEFLAGS_OFFSET@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_b43legacy_shm_read32
	mov	x3, x0
	bfi	w3, w23, #7, #1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_b43legacy_shm_write32
Lloh12:
	adrp	x8, _B43legacy_MMIO_CHANNEL_EXT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _B43legacy_MMIO_CHANNEL_EXT@GOTPAGEOFF]
Lloh14:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_b43legacy_read16
	orr	w2, w0, #0x800
	b	LBB0_8
LBB0_7:
Lloh15:
	adrp	x8, _B43legacy_MMIO_CHANNEL_EXT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _B43legacy_MMIO_CHANNEL_EXT@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_b43legacy_read16
	mov	w8, #63423
	and	w2, w0, w8
LBB0_8:
	mov	x0, x19
	mov	x1, x21
	bl	_b43legacy_write16
	str	w20, [x19, #12]
	mov	w0, #8
	bl	_msleep
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	w0, #1
	bl	_B43legacy_WARN_ON
	mov	w20, #255
	cbnz	w21, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_B43legacy_RADIO_DEFAULT_CHANNEL_BG,4,2 ; @B43legacy_RADIO_DEFAULT_CHANNEL_BG
	.comm	_B43legacy_MMIO_CHANNEL,4,2     ; @B43legacy_MMIO_CHANNEL
	.comm	_B43legacy_SHM_SHARED,4,2       ; @B43legacy_SHM_SHARED
	.comm	_B43legacy_UCODEFLAGS_OFFSET,4,2 ; @B43legacy_UCODEFLAGS_OFFSET
	.comm	_B43legacy_MMIO_CHANNEL_EXT,4,2 ; @B43legacy_MMIO_CHANNEL_EXT
.subsections_via_symbols
