	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_hw_rf5112_channel
_ath5k_hw_rf5112_channel:               ## @ath5k_hw_rf5112_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
	movq	%rdi, %r14
	movl	(%rsi), %eax
	cmpl	$4799, %eax                     ## imm = 0x12BF
	jg	LBB0_6
## %bb.1:
	imull	$-858993459, %eax, %ecx         ## imm = 0xCCCCCCCD
	leal	-429497175(%rcx), %edx
	cmpl	$858993459, %edx                ## imm = 0x33333333
	jb	LBB0_2
## %bb.3:
	addl	$2147483209, %ecx               ## imm = 0x7FFFFE49
	cmpl	$858993459, %ecx                ## imm = 0x33333333
	jae	LBB0_16
## %bb.4:
	xorl	%r12d, %r12d
	movl	$-4384, %ecx                    ## imm = 0xEEE0
	jmp	LBB0_5
LBB0_6:
	movl	%eax, %edx
	movl	$3435973837, %esi               ## imm = 0xCCCCCCCD
	movq	%rdx, %rcx
	imulq	%rsi, %rcx
	shrq	$34, %rcx
	leal	(%rcx,%rcx,4), %edi
	movl	%eax, %ecx
	subl	%edi, %ecx
	cmpl	$5435, %eax                     ## imm = 0x153B
	ja	LBB0_8
## %bb.7:
	cmpl	$2, %ecx
	jne	LBB0_8
## %bb.17:
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	addl	$17516, %eax                    ## imm = 0x446C
	cwtl
	imull	$5243, %eax, %eax               ## imm = 0x147B
	movl	%eax, %ecx
	sarl	$17, %ecx
	shrl	$31, %eax
	addl	%ecx, %eax
	incl	%eax
	movzwl	%ax, %edi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %r15d
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	movl	$2, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %ebx
	jmp	LBB0_18
LBB0_8:
	cmpl	$5120, %eax                     ## imm = 0x1400
	jb	LBB0_11
## %bb.9:
	imulq	%rsi, %rdx
	shrq	$36, %rdx
	shll	$2, %edx
	leal	(%rdx,%rdx,4), %edx
	movl	%eax, %esi
	subl	%edx, %esi
	jne	LBB0_11
## %bb.10:
	addl	$-4800, %eax                    ## imm = 0xED40
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
	andl	$-4, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %r15d
	movl	$3, %edi
	jmp	LBB0_15
LBB0_2:
	movl	$2, %r12d
	movl	$-4448, %ecx                    ## imm = 0xEEA0
LBB0_5:
	leal	(%rcx,%rax,2), %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$34, %rax
	addl	%ecx, %eax
	shll	$2, %eax
	movzbl	%al, %edi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_11:
	imull	$-858993459, %eax, %edx         ## imm = 0xCCCCCCCD
	rorl	%edx
	cmpl	$429496729, %edx                ## imm = 0x19999999
	jbe	LBB0_12
## %bb.13:
	testl	%ecx, %ecx
	je	LBB0_14
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_19
LBB0_12:
	addl	$-4800, %eax                    ## imm = 0xED40
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
	andl	$-2, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %r15d
	movl	$2, %edi
	jmp	LBB0_15
LBB0_14:
	addl	$-4800, %eax                    ## imm = 0xED40
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %r15d
	movl	$1, %edi
LBB0_15:
	movl	$2, %esi
	callq	_ath5k_hw_bitswap
	movl	%eax, %ebx
	xorl	%r12d, %r12d
LBB0_18:
	shll	$4, %r15d
	orl	%r12d, %r15d
	shll	$2, %ebx
	orl	%r15d, %ebx
	orl	$4097, %ebx                     ## imm = 0x1001
	movzbl	%bl, %esi
	movq	_AR5K_RF_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ath5k_hw_reg_write
	shrl	$8, %ebx
	andl	$127, %ebx
	movq	_AR5K_RF_BUFFER_CONTROL_5@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ath5k_hw_reg_write
	xorl	%eax, %eax
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AR5K_RF_BUFFER,4,2             ## @AR5K_RF_BUFFER
	.comm	_AR5K_RF_BUFFER_CONTROL_5,4,2   ## @AR5K_RF_BUFFER_CONTROL_5
	.no_dead_strip	_ath5k_hw_rf5112_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_hw_rf5112_channel
_ath5k_hw_rf5112_channel:               ; @ath5k_hw_rf5112_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, x0
	ldr	w8, [x1]
	mov	w9, #4799
	cmp	w8, w9
	b.gt	LBB0_4
; %bb.1:
	sub	w11, w8, #2224
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	mov	w10, #39321
	movk	w10, #6553, lsl #16
	madd	w12, w11, w9, w10
	mov	w11, #858993459
	cmp	w12, w11
	b.lo	LBB0_10
; %bb.2:
	sub	w12, w8, #2192
	madd	w9, w12, w9, w10
	cmp	w9, w11
	b.hs	LBB0_15
; %bb.3:
	mov	w21, #0
	mov	w9, #-4384
	b	LBB0_11
LBB0_4:
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x10, w8, w9
	lsr	x9, x10, #34
	add	w9, w9, w9, lsl #2
	sub	w9, w8, w9
	lsr	w11, w8, #2
	cmp	w11, #1358
	ccmp	w9, #2, #0, ls
	b.eq	LBB0_8
; %bb.5:
	lsr	w11, w8, #10
	cmp	w11, #5
	b.lo	LBB0_13
; %bb.6:
	lsr	x10, x10, #36
	mov	w11, #20
	msub	w10, w10, w11, w8
	cbnz	w10, LBB0_13
; %bb.7:
	mov	w9, #-4800
	add	w8, w8, w9
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #34
	and	w0, w8, #0x3ffffffc
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	x20, x0
	mov	w0, #3
	b	LBB0_9
LBB0_8:
	mov	w9, #10
	mov	w10, #17516
	madd	w8, w8, w9, w10
	sxth	w8, w8
	mov	w9, #5243
	mul	w8, w8, w9
	asr	w9, w8, #17
	add	w8, w9, w8, lsr #31
	add	w8, w8, #1
	and	w0, w8, #0xffff
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	x20, x0
	mov	w0, #0
LBB0_9:
	mov	w1, #2
	bl	_ath5k_hw_bitswap
	mov	w21, #0
	b	LBB0_12
LBB0_10:
	mov	w21, #2
	mov	w9, #-4448
LBB0_11:
	add	w8, w9, w8, lsl #1
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #34
	add	w8, w8, w9
	ubfiz	w0, w8, #2, #6
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	x20, x0
	mov	w0, #0
LBB0_12:
	bfi	w21, w20, #4, #28
	orr	w8, w21, w0, lsl #2
	mov	w9, #4097
	orr	w20, w8, w9
	and	w1, w20, #0xff
Lloh0:
	adrp	x8, _AR5K_RF_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR5K_RF_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ath5k_hw_reg_write
	ubfx	w1, w20, #8, #7
Lloh3:
	adrp	x8, _AR5K_RF_BUFFER_CONTROL_5@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR5K_RF_BUFFER_CONTROL_5@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ath5k_hw_reg_write
	mov	w0, #0
	b	LBB0_16
LBB0_13:
	mov	w10, #52429
	movk	w10, #52428, lsl #16
	mul	w11, w8, w10
	ror	w11, w11, #1
	mov	w12, #39321
	movk	w12, #6553, lsl #16
	cmp	w11, w12
	b.ls	LBB0_17
; %bb.14:
	cbz	w9, LBB0_18
LBB0_15:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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
LBB0_17:
	mov	w9, #-4800
	add	w8, w8, w9
	umull	x8, w8, w10
	lsr	x8, x8, #34
	and	w0, w8, #0x3ffffffe
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	x20, x0
	mov	w0, #2
	b	LBB0_9
LBB0_18:
	mov	w9, #-4800
	add	w8, w8, w9
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x8, w8, w9
	lsr	x0, x8, #34
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	x20, x0
	mov	w0, #1
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AR5K_RF_BUFFER,4,2             ; @AR5K_RF_BUFFER
	.comm	_AR5K_RF_BUFFER_CONTROL_5,4,2   ; @AR5K_RF_BUFFER_CONTROL_5
	.no_dead_strip	_ath5k_hw_rf5112_channel
.subsections_via_symbols
