	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hulusb_set_channel
_hulusb_set_channel:                    ## @hulusb_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	(%rdi), %rbx
	xorl	%edx, %edx
	testq	%r14, %r14
	setne	%dl
	movq	_SR_SUB_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_atusb_write_subreg
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	xorl	%edx, %edx
	testq	%r15, %r15
	setne	%dl
	movq	_SR_BPSK_QPSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_atusb_write_subreg
	testl	%eax, %eax
	js	LBB0_3
## %bb.2:
	xorl	%esi, %esi
	testq	%r15, %r15
	setne	%sil
	addl	%esi, %esi
	orl	$-100, %esi
	movq	%rbx, %rdi
	callq	_hulusb_set_cca_ed_level
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	testq	%r15, %r15
	movl	$50, %eax
	movl	$25, %ecx
	cmovel	%eax, %ecx
	movl	$40, %eax
	movl	$16, %edx
	cmovel	%eax, %edx
	testq	%r14, %r14
	movq	(%rbx), %rax
	movq	(%rax), %rax
	cmovel	%ecx, %edx
	movl	%edx, (%rax)
	movq	_IEEE802154_LIFS_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%edx, %ecx
	movl	%ecx, 4(%rax)
	movq	_IEEE802154_SIFS_PERIOD@GOTPCREL(%rip), %rcx
	imull	(%rcx), %edx
	movl	%edx, 8(%rax)
	movq	_SR_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atusb_write_subreg             ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SR_SUB_MODE,4,2                ## @SR_SUB_MODE
	.comm	_SR_BPSK_QPSK,4,2               ## @SR_BPSK_QPSK
	.comm	_IEEE802154_LIFS_PERIOD,4,2     ## @IEEE802154_LIFS_PERIOD
	.comm	_IEEE802154_SIFS_PERIOD,4,2     ## @IEEE802154_SIFS_PERIOD
	.comm	_SR_CHANNEL,4,2                 ## @SR_CHANNEL
	.no_dead_strip	_hulusb_set_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hulusb_set_channel
_hulusb_set_channel:                    ; @hulusb_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	x19, x2
	mov	x21, x1
	ldr	x20, [x0]
	cmp	x2, #0
	cset	w2, ne
Lloh0:
	adrp	x8, _SR_SUB_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SR_SUB_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atusb_write_subreg
	tbnz	w0, #31, LBB0_4
; %bb.1:
	cmp	x21, #0
	cset	w2, ne
Lloh3:
	adrp	x8, _SR_BPSK_QPSK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SR_BPSK_QPSK@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atusb_write_subreg
	tbnz	w0, #31, LBB0_4
; %bb.2:
	cmp	x21, #0
	mov	w8, #-98
	mov	w9, #-100
	csel	w1, w9, w8, eq
	mov	x0, x20
	bl	_hulusb_set_cca_ed_level
	tbnz	w0, #31, LBB0_4
; %bb.3:
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x21, #0
	mov	w9, #25
	mov	w10, #50
	csel	w9, w10, w9, eq
	mov	w10, #16
	mov	w11, #40
	csel	w10, w11, w10, eq
	cmp	x19, #0
	csel	w9, w9, w10, eq
	str	w9, [x8]
Lloh6:
	adrp	x10, _IEEE802154_LIFS_PERIOD@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IEEE802154_LIFS_PERIOD@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	mul	w10, w9, w10
Lloh9:
	adrp	x11, _IEEE802154_SIFS_PERIOD@GOTPAGE
Lloh10:
	ldr	x11, [x11, _IEEE802154_SIFS_PERIOD@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	mul	w9, w11, w9
	stp	w10, w9, [x8, #4]
Lloh12:
	adrp	x8, _SR_CHANNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SR_CHANNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	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	_atusb_write_subreg
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SR_SUB_MODE,4,2                ; @SR_SUB_MODE
	.comm	_SR_BPSK_QPSK,4,2               ; @SR_BPSK_QPSK
	.comm	_IEEE802154_LIFS_PERIOD,4,2     ; @IEEE802154_LIFS_PERIOD
	.comm	_IEEE802154_SIFS_PERIOD,4,2     ; @IEEE802154_SIFS_PERIOD
	.comm	_SR_CHANNEL,4,2                 ; @SR_CHANNEL
	.no_dead_strip	_hulusb_set_channel
.subsections_via_symbols
