	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwlagn_gain_computation
_iwlagn_gain_computation:               ## @iwlagn_gain_computation
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdi, %r13
	leal	1(%rdx), %eax
	movq	_NUM_RX_CHAINS@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jge	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movslq	%edx, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movslq	%eax, %rbx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r13), %rcx
	movl	$0, (%rcx,%rbx,4)
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rax
	cmpq	$0, (%rax,%rbx,8)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%r14,%rax,8), %eax
	subl	(%r14,%rbx,8), %eax
	movq	8(%r13), %rcx
	imull	(%rcx), %eax
	movslq	%eax, %r12
	imulq	$91625969, %r12, %rax           ## imm = 0x57619F1
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movl	%eax, %edi
	negl	%edi
	cmovsl	%eax, %edi
	movq	_CHAIN_NOISE_MAX_DELTA_GAIN_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movq	16(%r13), %rcx
	movl	%eax, (%rcx,%rbx,4)
	cmpl	$-1500, %r12d                   ## imm = 0xFA24
	jg	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	orl	$4, %eax
	movl	%eax, (%rcx,%rbx,4)
	jmp	LBB0_7
LBB0_1:
	movq	16(%r13), %rcx
LBB0_8:
	movl	4(%rcx), %edx
	movl	8(%rcx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_IWL_DEBUG_CALIB
	cmpl	$0, 24(%r13)
	jne	LBB0_10
## %bb.9:
	leaq	-56(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	leaq	-48(%rbp), %rdi
	movl	(%r13), %esi
	callq	_iwl_set_calib_hdr
	movq	16(%r13), %rax
	movl	4(%rax), %ecx
	movl	%ecx, -56(%rbp)
	movl	8(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_REPLY_PHY_CALIBRATION_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CMD_ASYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	$12, %ecx
	movq	%r14, %r8
	callq	_iwl_dvm_send_cmd_pdu
	movl	$1, 24(%r13)
	movq	_IWL_CHAIN_NOISE_CALIBRATED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r13)
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_RX_CHAINS,4,2              ## @NUM_RX_CHAINS
	.comm	_CHAIN_NOISE_MAX_DELTA_GAIN_CODE,4,2 ## @CHAIN_NOISE_MAX_DELTA_GAIN_CODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Delta gains: ANT_B = %d  ANT_C = %d\n"

	.comm	_REPLY_PHY_CALIBRATION_CMD,4,2  ## @REPLY_PHY_CALIBRATION_CMD
	.comm	_CMD_ASYNC,4,2                  ## @CMD_ASYNC
	.comm	_IWL_CHAIN_NOISE_CALIBRATED,4,2 ## @IWL_CHAIN_NOISE_CALIBRATED
	.no_dead_strip	_iwlagn_gain_computation
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwlagn_gain_computation
_iwlagn_gain_computation:               ; @iwlagn_gain_computation
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
                                        ; kill: def $w2 killed $w2 def $x2
	mov	x19, x0
	add	w8, w2, #1
Lloh0:
	adrp	x21, _NUM_RX_CHAINS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NUM_RX_CHAINS@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.1:
	mov	x20, x1
	sxtw	x9, w2
	sxtw	x22, w8
	lsl	x23, x9, #3
	mov	w24, #6641
	movk	w24, #1398, lsl #16
Lloh2:
	adrp	x25, _CHAIN_NOISE_MAX_DELTA_GAIN_CODE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CHAIN_NOISE_MAX_DELTA_GAIN_CODE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	str	wzr, [x8, x22, lsl #2]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldrsw	x9, [x21]
	cmp	x22, x9
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x8, [x8, x22, lsl #3]
	cbnz	x8, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x20, x23]
	ldr	x10, [x20, x22, lsl #3]
	sub	w9, w9, w10
	mul	w26, w9, w8
	smull	x8, w26, w24
	lsr	x9, x8, #63
	asr	x8, x8, #37
	adds	w8, w8, w9
	cneg	w0, w8, mi
	ldr	w1, [x25]
	bl	_min
	ldr	x8, [x19, #16]
	str	w0, [x8, x22, lsl #2]
	cmn	w26, #1500
	b.gt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	orr	w9, w0, #0x4
	str	w9, [x8, x22, lsl #2]
	b	LBB0_3
LBB0_7:
	ldr	x8, [x19, #16]
LBB0_8:
	ldp	w2, w3, [x8, #4]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_CALIB
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_10
; %bb.9:
	mov	x20, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	add	x0, x20, #8
	ldr	w1, [x19]
	bl	_iwl_set_calib_hdr
	ldr	x8, [x19, #16]
	ldur	d0, [x8, #4]
	str	d0, [sp]
Lloh6:
	adrp	x8, _REPLY_PHY_CALIBRATION_CMD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REPLY_PHY_CALIBRATION_CMD@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _CMD_ASYNC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMD_ASYNC@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x4, sp
	mov	x0, x19
	mov	w3, #12
	bl	_iwl_dvm_send_cmd_pdu
	mov	w8, #1
Lloh12:
	adrp	x9, _IWL_CHAIN_NOISE_CALIBRATED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IWL_CHAIN_NOISE_CALIBRATED@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #24]
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_RX_CHAINS,4,2              ; @NUM_RX_CHAINS
	.comm	_CHAIN_NOISE_MAX_DELTA_GAIN_CODE,4,2 ; @CHAIN_NOISE_MAX_DELTA_GAIN_CODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Delta gains: ANT_B = %d  ANT_C = %d\n"

	.comm	_REPLY_PHY_CALIBRATION_CMD,4,2  ; @REPLY_PHY_CALIBRATION_CMD
	.comm	_CMD_ASYNC,4,2                  ; @CMD_ASYNC
	.comm	_IWL_CHAIN_NOISE_CALIBRATED,4,2 ; @IWL_CHAIN_NOISE_CALIBRATED
	.no_dead_strip	_iwlagn_gain_computation
.subsections_via_symbols
