	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43_gphy_channel_switch        ## -- Begin function b43_gphy_channel_switch
	.p2align	4, 0x90
_b43_gphy_channel_switch:               ## @b43_gphy_channel_switch
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_b43_synth_pu_workaround
LBB0_2:
	movq	_B43_MMIO_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%ebx, %edi
	callq	_channel2freq_bg
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_b43_write16
	cmpl	$14, %ebx
	jne	LBB0_4
## %bb.3:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
	movq	_SSB_SPROM1CCODE_JAPAN@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_b43_hf_read
	movq	_B43_HF_ACPR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %ecx
	orl	%eax, %ecx
	notl	%esi
	andl	%eax, %esi
	cmpq	%rbx, %r15
	cmovnel	%ecx, %esi
	movq	%r14, %rdi
	callq	_b43_hf_write
	movq	_B43_MMIO_CHANNEL_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_b43_read16
	orl	$2048, %eax                     ## imm = 0x800
	jmp	LBB0_5
LBB0_4:
	movq	_B43_MMIO_CHANNEL_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_b43_read16
	andl	$63423, %eax                    ## imm = 0xF7BF
LBB0_5:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_b43_write16                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_B43_MMIO_CHANNEL,4,2           ## @B43_MMIO_CHANNEL
	.comm	_SSB_SPROM1CCODE_JAPAN,8,3      ## @SSB_SPROM1CCODE_JAPAN
	.comm	_B43_HF_ACPR,4,2                ## @B43_HF_ACPR
	.comm	_B43_MMIO_CHANNEL_EXT,4,2       ## @B43_MMIO_CHANNEL_EXT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43_gphy_channel_switch        ; -- Begin function b43_gphy_channel_switch
	.p2align	2
_b43_gphy_channel_switch:               ; @b43_gphy_channel_switch
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	cbz	w2, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_b43_synth_pu_workaround
LBB0_2:
Lloh0:
	adrp	x8, _B43_MMIO_CHANNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _B43_MMIO_CHANNEL@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_channel2freq_bg
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_b43_write16
	cmp	w20, #14
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _SSB_SPROM1CCODE_JAPAN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSB_SPROM1CCODE_JAPAN@GOTPAGEOFF]
Lloh5:
	ldr	x21, [x8]
	mov	x0, x19
	bl	_b43_hf_read
Lloh6:
	adrp	x8, _B43_HF_ACPR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _B43_HF_ACPR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w9, w8, w0
	bic	w8, w0, w8
	cmp	x20, x21
	csel	w1, w8, w9, eq
	mov	x0, x19
	bl	_b43_hf_write
Lloh9:
	adrp	x8, _B43_MMIO_CHANNEL_EXT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B43_MMIO_CHANNEL_EXT@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_b43_read16
	orr	w2, w0, #0x800
	b	LBB0_5
LBB0_4:
Lloh12:
	adrp	x8, _B43_MMIO_CHANNEL_EXT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _B43_MMIO_CHANNEL_EXT@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_b43_read16
	mov	w8, #63423
	and	w2, w0, w8
LBB0_5:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_b43_write16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_B43_MMIO_CHANNEL,4,2           ; @B43_MMIO_CHANNEL
	.comm	_SSB_SPROM1CCODE_JAPAN,8,3      ; @SSB_SPROM1CCODE_JAPAN
	.comm	_B43_HF_ACPR,4,2                ; @B43_HF_ACPR
	.comm	_B43_MMIO_CHANNEL_EXT,4,2       ; @B43_MMIO_CHANNEL_EXT
.subsections_via_symbols
