	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_chip_set_channel            ## -- Begin function zd_chip_set_channel
	.p2align	4, 0x90
_zd_chip_set_channel:                   ## @zd_chip_set_channel
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_zd_chip_lock_phy_regs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	leaq	4(%r12), %rdi
	movl	%r14d, %esi
	callq	_zd_rf_set_channel
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_update_channel_integration_and_calibration
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	%r12, %rdi
	callq	_patch_cck_gain
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_patch_6m_band_edge
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	_CR_CONFIG_PHILIPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_zd_iowrite32_locked
	movl	%eax, %r15d
LBB0_6:
	movq	%r12, %rdi
	callq	_zd_chip_unlock_phy_regs
	testl	%r15d, %r15d
	movl	%eax, %ebx
	cmovnel	%r15d, %ebx
	testl	%eax, %eax
	cmovel	%r15d, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CR_CONFIG_PHILIPS,4,2          ## @CR_CONFIG_PHILIPS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_chip_set_channel            ; -- Begin function zd_chip_set_channel
	.p2align	2
_zd_chip_set_channel:                   ; @zd_chip_set_channel
	.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
	bl	_mutex_lock
	mov	x0, x19
	bl	_zd_chip_lock_phy_regs
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.1:
	add	x0, x19, #4
	mov	x1, x20
	bl	_zd_rf_set_channel
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_update_channel_integration_and_calibration
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_patch_cck_gain
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_patch_6m_band_edge
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _CR_CONFIG_PHILIPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CR_CONFIG_PHILIPS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_zd_iowrite32_locked
	mov	x21, x0
LBB0_6:
	mov	x0, x19
	bl	_zd_chip_unlock_phy_regs
	cmp	w21, #0
	ccmp	w0, #0, #4, eq
	csel	w21, w21, w0, eq
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CR_CONFIG_PHILIPS,4,2          ; @CR_CONFIG_PHILIPS
.subsections_via_symbols
