	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_hw_rf_gainf_adjust
_ath5k_hw_rf_gainf_adjust:              ## @ath5k_hw_rf_gainf_adjust
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	(%rdi), %eax
	cmpl	$129, %eax
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	cmpl	$128, %eax
	jne	LBB0_21
## %bb.3:
	movq	_rfgain_opt_5112@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movq	_rfgain_opt_5111@GOTPCREL(%rip), %rax
LBB0_4:
	movq	8(%rax), %rcx
	movq	8(%rdi), %r8
	movl	16(%rdi), %r9d
	movl	20(%rdi), %edx
	cmpl	%edx, %r9d
	jge	LBB0_5
## %bb.10:
	movl	28(%rdi), %r10d
	cmpl	%r10d, %r9d
	jle	LBB0_12
## %bb.11:
	movl	24(%rdi), %eax
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_5:
	testq	%r8, %r8
	je	LBB0_6
## %bb.7:
	movl	%r9d, %eax
	movq	%r8, %rsi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	subq	$1, %rsi
	jb	LBB0_9
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rsi, 8(%rdi)
	movl	(%rcx,%r8,4), %ebx
	subl	(%rcx,%rsi,4), %ebx
	leal	(%rax,%rbx,2), %eax
	movq	%rsi, %r8
	cmpl	%edx, %eax
	jge	LBB0_8
	jmp	LBB0_19
LBB0_12:
	movslq	(%rax), %rsi
	decq	%rsi
	movl	$-2, %ebx
	cmpq	%rsi, %r8
	je	LBB0_21
## %bb.13:
	movl	%r9d, %eax
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, %r8
	jae	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movl	(%rcx,%r8,4), %ebx
	subl	4(%rcx,%r8,4), %ebx
	leal	(%rax,%rbx,2), %eax
	movq	%rdx, %r8
	cmpl	%r10d, %eax
	jle	LBB0_14
	jmp	LBB0_17
LBB0_6:
	movl	$-1, %ebx
	jmp	LBB0_21
LBB0_9:
	xorl	%esi, %esi
LBB0_19:
	movl	%eax, 24(%rdi)
	movl	$1, %ebx
	movq	%rsi, %r8
	jmp	LBB0_20
LBB0_15:
	movq	%r8, %rdx
LBB0_17:
	movl	%eax, 24(%rdi)
	movl	$2, %ebx
	movq	%rdx, %r8
LBB0_20:
	movq	_ATH5K_DEBUG_CALIBRATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %ecx
	callq	_ATH5K_DBG
LBB0_21:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rfgain_opt_5111,16,3           ## @rfgain_opt_5111
	.comm	_rfgain_opt_5112,16,3           ## @rfgain_opt_5112
	.comm	_ATH5K_DEBUG_CALIBRATE,4,2      ## @ATH5K_DEBUG_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ret %d, gain step %u, current gain %u, target gain %u\n"

	.no_dead_strip	_ath5k_hw_rf_gainf_adjust
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_hw_rf_gainf_adjust
_ath5k_hw_rf_gainf_adjust:              ; @ath5k_hw_rf_gainf_adjust
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cmp	w8, #129
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.2:
Lloh0:
	adrp	x10, _rfgain_opt_5112@GOTPAGE
Lloh1:
	ldr	x10, [x10, _rfgain_opt_5112@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x10, _rfgain_opt_5111@GOTPAGE
Lloh3:
	ldr	x10, [x10, _rfgain_opt_5111@GOTPAGEOFF]
LBB0_4:
	ldr	x8, [x10, #8]
	ldr	x4, [x0, #8]
	ldp	w5, w9, [x0, #16]
	cmp	w5, w9
	b.ge	LBB0_7
; %bb.5:
	ldr	w9, [x0, #28]
	cmp	w5, w9
	b.le	LBB0_12
; %bb.6:
	mov	w19, #0
	ldr	w6, [x0, #24]
	b	LBB0_22
LBB0_7:
	cbz	x4, LBB0_14
; %bb.8:
	mov	x6, x5
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x4, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sub	x10, x4, #1
	str	x10, [x0, #8]
	add	x11, x8, x4, lsl #2
	ldp	w12, w11, [x11, #-4]
	sub	w11, w11, w12
	add	w6, w6, w11, lsl #1
	mov	x4, x10
	cmp	w6, w9
	b.ge	LBB0_9
	b	LBB0_16
LBB0_11:
	mov	w19, #0
	b	LBB0_23
LBB0_12:
	ldrsw	x10, [x10]
	sub	x10, x10, #1
	cmp	x4, x10
	b.ne	LBB0_17
; %bb.13:
	mov	w19, #-2
	b	LBB0_23
LBB0_14:
	mov	w19, #-1
	b	LBB0_23
LBB0_15:
	mov	x10, #0
LBB0_16:
	str	w6, [x0, #24]
	mov	w19, #1
	mov	x4, x10
	b	LBB0_22
LBB0_17:
	csel	x10, x4, x10, hi
	mov	x6, x5
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	cmp	x10, x4
	b.eq	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x11, x4, #1
	str	x11, [x0, #8]
	add	x12, x8, x4, lsl #2
	ldp	w12, w13, [x12]
	sub	w12, w12, w13
	add	w6, w6, w12, lsl #1
	mov	x4, x11
	cmp	w6, w9
	b.le	LBB0_18
	b	LBB0_21
LBB0_20:
	mov	x11, x10
LBB0_21:
	str	w6, [x0, #24]
	mov	w19, #2
	mov	x4, x11
LBB0_22:
Lloh4:
	adrp	x8, _ATH5K_DEBUG_CALIBRATE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ATH5K_DEBUG_CALIBRATE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x19
	bl	_ATH5K_DBG
LBB0_23:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_rfgain_opt_5111,16,3           ; @rfgain_opt_5111
	.comm	_rfgain_opt_5112,16,3           ; @rfgain_opt_5112
	.comm	_ATH5K_DEBUG_CALIBRATE,4,2      ; @ATH5K_DEBUG_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ret %d, gain step %u, current gain %u, target gain %u\n"

	.no_dead_strip	_ath5k_hw_rf_gainf_adjust
.subsections_via_symbols
