	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_calc_iq_corr
_ar9003_hw_calc_iq_corr:                ## @ar9003_hw_calc_iq_corr
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -152(%rbp)                ## 8-byte Spill
	movq	%rdx, %r13
	movl	%esi, -132(%rbp)                ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -144(%rbp)                ## 8-byte Spill
	callq	_ath9k_hw_common
	movl	(%r13), %edi
	movl	4(%r13), %ebx
	movl	%edi, %esi
	movl	%ebx, %edx
	shldl	$8, %edi, %edx
	andl	$4095, %esi                     ## imm = 0xFFF
	shrl	$12, %edi
	andl	$4095, %edi                     ## imm = 0xFFF
	andl	$4095, %edx                     ## imm = 0xFFF
	movq	%rsi, %rcx
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	cmpl	$2049, %esi                     ## imm = 0x801
	setb	-128(%rbp)                      ## 1-byte Folded Spill
	xorl	%ecx, %ecx
	cmpl	$2049, %edi                     ## imm = 0x801
	setb	%cl
	shll	$12, %ecx
	orl	%edi, %ecx
	leal	-4096(%rdx), %edi
	cmpl	$2049, %edx                     ## imm = 0x801
	cmovbl	%edx, %edi
	movl	%edi, -120(%rbp)                ## 4-byte Spill
	shrl	$4, %ebx
	andl	$4095, %ebx                     ## imm = 0xFFF
	movl	8(%r13), %edi
	movl	%edi, %r8d
	andl	$4095, %r8d                     ## imm = 0xFFF
	movl	%edi, %r11d
	shrl	$12, %r11d
	andl	$4095, %r11d                    ## imm = 0xFFF
	movq	%rbx, %rdx
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	cmpl	$2049, %ebx                     ## imm = 0x801
	setb	-68(%rbp)                       ## 1-byte Folded Spill
	cmpl	$2049, %r11d                    ## imm = 0x801
	setb	-67(%rbp)                       ## 1-byte Folded Spill
	movl	12(%r13), %r12d
	shrdl	$24, %r12d, %edi
	andl	$4095, %edi                     ## imm = 0xFFF
	shrl	$4, %r12d
	andl	$4095, %r12d                    ## imm = 0xFFF
	movl	16(%r13), %r15d
	movl	%r15d, %edx
	andl	$4095, %edx                     ## imm = 0xFFF
	cmpl	$2049, %edi                     ## imm = 0x801
	leal	-4096(%rdi), %esi
	cmovbl	%edi, %esi
	movl	%esi, -80(%rbp)                 ## 4-byte Spill
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%r14d, %r14d
	cmpl	$2049, %r12d                    ## imm = 0x801
	setb	%r14b
	shll	$12, %r14d
	movq	%rdx, %rax
	movq	%rdx, -160(%rbp)                ## 8-byte Spill
	cmpl	$2049, %edx                     ## imm = 0x801
	setb	%sil
	movl	%r15d, %r10d
	shrl	$12, %r10d
	movl	20(%r13), %r13d
	shrdl	$24, %r13d, %r15d
	andl	$4095, %r10d                    ## imm = 0xFFF
	andl	$4095, %r15d                    ## imm = 0xFFF
	shrl	$4, %r13d
	andl	$4095, %r13d                    ## imm = 0xFFF
	xorl	%edi, %edi
	cmpl	$2049, %r10d                    ## imm = 0x801
	setb	%dl
	cmpl	$2049, %r15d                    ## imm = 0x801
	leal	-4096(%r15), %ebx
	cmovbl	%r15d, %ebx
	cmpl	$2049, %r13d                    ## imm = 0x801
	leal	-4096(%r14,%r12), %r9d
	setb	%al
	addl	$-4096, %ecx                    ## imm = 0xF000
	je	LBB0_20
## %bb.1:
	testl	%r8d, %r8d
	je	LBB0_20
## %bb.2:
	testl	%r9d, %r9d
	je	LBB0_20
## %bb.3:
	testl	%ebx, %ebx
	je	LBB0_20
## %bb.4:
	movb	%al, -65(%rbp)                  ## 1-byte Spill
	movb	%dl, -66(%rbp)                  ## 1-byte Spill
	movl	%r9d, -92(%rbp)                 ## 4-byte Spill
	leal	-2048(%rcx), %edx
	cmpl	$-1024, %edx                    ## imm = 0xFC00
	jb	LBB0_37
## %bb.5:
	cmpl	$2048, %r12d                    ## imm = 0x800
	ja	LBB0_37
## %bb.6:
	cmpl	$2048, %r15d                    ## imm = 0x800
	ja	LBB0_37
## %bb.7:
	movl	%esi, %r15d
	xorl	%esi, %esi
	movb	-128(%rbp), %dl                 ## 1-byte Reload
	movb	%dl, %sil
	shll	$12, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	leal	(%rsi,%rdx), %eax
	addl	$-4096, %eax                    ## imm = 0xF000
	cmpl	%eax, %ecx
	jle	LBB0_37
## %bb.8:
	movl	-120(%rbp), %r12d               ## 4-byte Reload
	cmpl	%r12d, %ecx
	jle	LBB0_37
## %bb.9:
	movl	%r8d, %r14d
	xorl	%esi, %esi
	movb	-68(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %sil
	shll	$12, %esi
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	leal	(%rsi,%rdx), %r8d
	addl	$-4096, %r8d                    ## imm = 0xF000
	cmpl	%r8d, %r14d
	jle	LBB0_37
## %bb.10:
	xorl	%esi, %esi
	movb	-67(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %sil
	shll	$12, %esi
	leal	(%rsi,%r11), %r9d
	addl	$-4096, %r9d                    ## imm = 0xF000
	cmpl	%r9d, %r14d
	jle	LBB0_37
## %bb.11:
	movl	-92(%rbp), %esi                 ## 4-byte Reload
	cmpl	-80(%rbp), %esi                 ## 4-byte Folded Reload
	jle	LBB0_37
## %bb.12:
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movb	%r15b, %al
	shll	$12, %eax
	movq	-160(%rbp), %rdx                ## 8-byte Reload
	leal	(%rax,%rdx), %r11d
	addl	$-4096, %r11d                   ## imm = 0xF000
	cmpl	%r11d, %esi
	jle	LBB0_37
## %bb.13:
	movb	-66(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %dil
	shll	$12, %edi
	leal	(%rdi,%r10), %r15d
	addl	$-4096, %r15d                   ## imm = 0xF000
	cmpl	%r15d, %ebx
	jle	LBB0_37
## %bb.14:
	movl	%r12d, %esi
	xorl	%eax, %eax
	movb	-65(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %al
	shll	$12, %eax
	leal	(%rax,%r13), %r12d
	addl	$-4096, %r12d                   ## imm = 0xF000
	cmpl	%r12d, %ebx
	movl	$0, %r13d
	jle	LBB0_21
## %bb.15:
	movl	-88(%rbp), %eax                 ## 4-byte Reload
	shll	$15, %eax
	movl	%r14d, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r13d
	movl	%esi, %eax
	shll	$15, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r10d
	shll	$15, %r8d
	movl	%r8d, %eax
	cltd
	idivl	%r14d
	movl	%eax, %r14d
	shll	$15, %r9d
	movl	%r9d, %eax
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	-80(%rbp), %eax                 ## 4-byte Reload
	shll	$15, %eax
	cltd
	movl	-92(%rbp), %esi                 ## 4-byte Reload
	idivl	%esi
	movl	%eax, %r8d
	shll	$15, %r11d
	movl	%r11d, %eax
	cltd
	idivl	%esi
	movl	%eax, %esi
	shll	$15, %r15d
	movl	%r15d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r9d
	shll	$15, %r12d
	movl	%r12d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %edi
	movl	%r13d, -88(%rbp)                ## 4-byte Spill
	subl	%r14d, %r13d
	shll	$8, %r13d
	movq	_DELPT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r11d
	movq	%r10, -80(%rbp)                 ## 8-byte Spill
	subl	%r10d, %ecx
	shll	$8, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r12d
	movq	%r8, -128(%rbp)                 ## 8-byte Spill
	movl	%r8d, %eax
	subl	%r9d, %eax
	shll	$8, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r14d
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	subl	%esi, %edi
	shll	$8, %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	movl	%eax, %ebx
	movq	-144(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r11d, -112(%rbp)               ## 4-byte Spill
	movl	%r11d, %edx
	callq	_ar9003_hw_find_mag_approx
	movl	%eax, %r13d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_ar9003_hw_find_mag_approx
	movl	%eax, %r8d
	testl	%r13d, %r13d
	je	LBB0_23
## %bb.16:
	testl	%r8d, %r8d
	je	LBB0_23
## %bb.17:
	movl	-112(%rbp), %eax                ## 4-byte Reload
	shll	$15, %eax
	cltd
	idivl	%r13d
	movl	%eax, %esi
	shll	$15, %r12d
	movl	%r12d, %eax
	cltd
	idivl	%r13d
	movl	%eax, %r9d
	shll	$15, %r14d
	movl	%r14d, %eax
	cltd
	idivl	%r8d
	movl	%eax, %ecx
	shll	$15, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%r8d
	leaq	-64(%rbp), %rbx
	movq	-144(%rbp), %rdi                ## 8-byte Reload
	movl	%r9d, %edx
	movl	%eax, %r8d
	movl	-88(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rbx
	pushq	-120(%rbp)                      ## 8-byte Folded Reload
	pushq	-128(%rbp)                      ## 8-byte Folded Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	callq	_ar9003_hw_solve_iq_cal
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_25
## %bb.18:
	movl	-64(%rbp), %r15d
	movl	-60(%rbp), %ebx
	movl	-56(%rbp), %eax
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %r13d
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	32767(%r15), %r8d
	testl	%r15d, %r15d
	cmovnsl	%r15d, %r8d
	sarl	$15, %r8d
	leal	32767(%rbx), %r9d
	testl	%ebx, %ebx
	cmovnsl	%ebx, %r9d
	sarl	$15, %r9d
	leaq	L_.str.3(%rip), %rdx
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	%r14, %rdi
	movl	-132(%rbp), %r12d               ## 4-byte Reload
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	cmpl	$32768, %r15d                   ## imm = 0x8000
	jne	LBB0_26
## %bb.19:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%r14, %rdi
	movl	$32768, %ecx                    ## imm = 0x8000
	jmp	LBB0_28
LBB0_20:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdx
	xorl	%r13d, %r13d
	movq	-104(%rbp), %rdi                ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	pushq	%rbx
	callq	_ath_dbg
	addq	$16, %rsp
	jmp	LBB0_21
LBB0_23:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_21
LBB0_25:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%r13d, %r13d
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_21
LBB0_26:
	movl	$32768, %ecx                    ## imm = 0x8000
	subl	%r15d, %ecx
	shll	$15, %r15d
	movl	%r15d, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	255(%rax), %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$8, %r15d
	shll	$8, %ebx
	movl	$32767, %eax                    ## imm = 0x7FFF
	subl	%ebx, %eax
	negl	%ebx
	testl	%ebx, %ebx
	cmovsl	%eax, %ebx
	sarl	$15, %ebx
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_ath_dbg
	cmpl	$-62, %ebx
	movl	$-63, %eax
	cmovll	%eax, %ebx
	cmpl	$63, %ebx
	movl	$63, %ecx
	cmovgel	%ecx, %ebx
	cmpl	$-62, %r15d
	cmovll	%eax, %r15d
	cmpl	$63, %r15d
	cmovgel	%ecx, %r15d
	shll	$7, %r15d
	andl	$127, %ebx
	orl	%r15d, %ebx
	movq	-152(%rbp), %r15                ## 8-byte Reload
	movl	%ebx, (%r15)
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$-32768, %ecx                   ## imm = 0x8000
	jne	LBB0_30
## %bb.27:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdx
	movq	%r14, %rdi
	movl	$-32768, %ecx                   ## imm = 0x8000
LBB0_28:
	movl	$32768, %r8d                    ## imm = 0x8000
	xorl	%eax, %eax
	callq	_ath_dbg
LBB0_37:
	xorl	%r13d, %r13d
LBB0_21:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_39
## %bb.22:
	movl	%r13d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movl	%ecx, %eax
	shll	$15, %eax
	negl	%eax
	addl	$32768, %ecx                    ## imm = 0x8000
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	255(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$8, %ebx
	shll	$8, %r13d
	movl	$32767, %eax                    ## imm = 0x7FFF
	subl	%r13d, %eax
	negl	%r13d
	testl	%r13d, %r13d
	cmovsl	%eax, %r13d
	sarl	$15, %r13d
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	movl	%ebx, %r8d
	movl	%r13d, %r9d
	xorl	%eax, %eax
	callq	_ath_dbg
	cmpl	$-62, %r13d
	movl	$-63, %eax
	cmovll	%eax, %r13d
	cmpl	$63, %r13d
	movl	$63, %ecx
	cmovgel	%ecx, %r13d
	cmpl	$-62, %ebx
	cmovll	%eax, %ebx
	cmpl	$63, %ebx
	cmovgel	%ecx, %ebx
	shll	$7, %ebx
	andl	$127, %r13d
	orl	%ebx, %r13d
	movl	%r13d, 4(%r15)
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.9(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	$1, %r13d
	jmp	LBB0_21
LBB0_39:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Divide by 0:\na0_d0=%d\na0_d1=%d\na2_d0=%d\na1_d1=%d\n"

	.comm	_DELPT,4,2                      ## @DELPT
L_.str.1:                               ## @.str.1
	.asciz	"Divide by 0: mag1=%d, mag2=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Call to ar9003_hw_solve_iq_cal() failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"chain %d: mag mismatch=%d phase mismatch=%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Divide by 0: mag_tx=%d, res_scale=%d\n"

L_.str.5:                               ## @.str.5
	.asciz	"tx chain %d: mag corr=%d  phase corr=%d\n"

L_.str.6:                               ## @.str.6
	.asciz	"tx chain %d: iq corr coeff=%x\n"

L_.str.7:                               ## @.str.7
	.asciz	"Divide by 0: mag_rx=%d, res_scale=%d\n"

L_.str.8:                               ## @.str.8
	.asciz	"rx chain %d: mag corr=%d  phase corr=%d\n"

L_.str.9:                               ## @.str.9
	.asciz	"rx chain %d: iq corr coeff=%x\n"

	.no_dead_strip	_ar9003_hw_calc_iq_corr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_hw_calc_iq_corr
_ar9003_hw_calc_iq_corr:                ; @ar9003_hw_calc_iq_corr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x3
	mov	x20, x2
	mov	x25, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	bl	_ath9k_hw_common
	mov	x23, x0
	ldp	w17, w16, [x20]
	and	w8, w17, #0xfff
	ubfx	w10, w17, #12, #12
	lsr	w11, w17, #24
	bfi	w11, w16, #8, #4
	mov	w0, #-4096
	cmp	w8, #2048
	csel	w9, w0, wzr, hi
	cmp	w10, #2048
	csel	w8, w0, wzr, hi
	bfxil	w8, w17, #12, #12
	orr	w10, w11, #0xfffff000
	cmp	w11, #2048
	csel	w11, w10, w11, hi
	ubfx	w12, w16, #4, #12
	ldp	w5, w15, [x20, #8]
	and	w10, w5, #0xfff
	ubfx	w14, w5, #12, #12
	cmp	w12, #2048
	csel	w13, w0, wzr, hi
	cmp	w14, #2048
	csel	w12, w0, wzr, hi
	lsr	w14, w5, #24
	bfi	w14, w15, #8, #4
	ubfx	w19, w15, #4, #12
	ldp	w6, w7, [x20, #16]
	and	w2, w6, #0xfff
	orr	w1, w14, #0xfffff000
	cmp	w14, #2048
	csel	w1, w1, w14, hi
	cmp	w19, #2048
	csel	w14, w0, wzr, hi
	bfxil	w14, w15, #4, #12
	cmp	w2, #2048
	csel	w2, w0, wzr, hi
	ubfx	w15, w6, #12, #12
	lsr	w20, w6, #24
	bfi	w20, w7, #8, #4
	ubfx	w4, w7, #4, #12
	cmp	w15, #2048
	csel	w3, w0, wzr, hi
	orr	w15, w20, #0xfffff000
	cmp	w20, #2048
	csel	w15, w15, w20, hi
	cmp	w4, #2048
	csel	w4, w0, wzr, hi
	cbz	w8, LBB0_20
; %bb.1:
	cbz	w10, LBB0_20
; %bb.2:
	cbz	w14, LBB0_20
; %bb.3:
	cbz	w15, LBB0_20
; %bb.4:
	mov	w0, #0
	sub	w21, w8, #2048
	cmn	w21, #1024
	b.lo	LBB0_22
; %bb.5:
	cmp	w19, #2048
	b.hi	LBB0_22
; %bb.6:
	cmp	w20, #2048
	b.hi	LBB0_22
; %bb.7:
	bfxil	w9, w17, #0, #12
	cmp	w8, w9
	b.le	LBB0_22
; %bb.8:
	cmp	w8, w11
	b.le	LBB0_22
; %bb.9:
	bfxil	w13, w16, #4, #12
	cmp	w10, w13
	b.le	LBB0_22
; %bb.10:
	bfxil	w12, w5, #12, #12
	cmp	w10, w12
	b.le	LBB0_22
; %bb.11:
	cmp	w14, w1
	b.le	LBB0_22
; %bb.12:
	bfxil	w2, w6, #0, #12
	cmp	w14, w2
	b.le	LBB0_22
; %bb.13:
	bfxil	w3, w6, #12, #12
	cmp	w15, w3
	b.le	LBB0_22
; %bb.14:
	bfxil	w4, w7, #4, #12
	cmp	w15, w4
	b.le	LBB0_22
; %bb.15:
	stp	x24, x25, [sp, #32]             ; 16-byte Folded Spill
	str	x23, [sp, #48]                  ; 8-byte Folded Spill
	lsl	w9, w9, #15
	sdiv	w23, w9, w8
	lsl	w9, w11, #15
	sdiv	w24, w9, w8
	lsl	w8, w13, #15
	sdiv	w8, w8, w10
	lsl	w9, w12, #15
	sdiv	w9, w9, w10
	lsl	w10, w1, #15
	sdiv	w25, w10, w14
	lsl	w10, w2, #15
	sdiv	w19, w10, w14
	lsl	w10, w3, #15
	sdiv	w10, w10, w15
	lsl	w11, w4, #15
	sdiv	w11, w11, w15
	sub	w8, w23, w8
Lloh3:
	adrp	x12, _DELPT@GOTPAGE
Lloh4:
	ldr	x12, [x12, _DELPT@GOTPAGEOFF]
	lsl	w8, w8, #8
Lloh5:
	ldr	w12, [x12]
	sdiv	w26, w8, w12
	sub	w8, w9, w24
	lsl	w8, w8, #8
	sdiv	w27, w8, w12
	sub	w8, w25, w10
	lsl	w8, w8, #8
	sdiv	w28, w8, w12
	sub	w8, w11, w19
	lsl	w8, w8, #8
	sdiv	w20, w8, w12
	mov	x0, x22
	mov	x1, x27
	mov	x2, x26
	bl	_ar9003_hw_find_mag_approx
	mov	x21, x0
	mov	x0, x22
	mov	x1, x20
	mov	x2, x28
	bl	_ar9003_hw_find_mag_approx
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w21, LBB0_24
; %bb.16:
	cbz	w0, LBB0_24
; %bb.17:
	lsl	w8, w26, #15
	sdiv	w1, w8, w21
	lsl	w8, w27, #15
	sdiv	w2, w8, w21
	lsl	w8, w28, #15
	sdiv	w3, w8, w0
	lsl	w8, w20, #15
	sdiv	w4, w8, w0
	add	x8, sp, #56
	str	x8, [sp, #8]
	str	w19, [sp]
	mov	x0, x22
	mov	x5, x23
	mov	x6, x24
	mov	x7, x25
	bl	_ar9003_hw_solve_iq_cal
	cbz	w0, LBB0_25
; %bb.18:
	ldp	w24, w19, [sp, #56]
	ldp	w22, w21, [sp, #64]
Lloh6:
	adrp	x20, _CALIBRATE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _CALIBRATE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w23, #32767
	add	w8, w24, w23
	cmp	w24, #0
	csel	w8, w8, w24, lt
	asr	w8, w8, #15
	add	w9, w19, w23
	cmp	w19, #0
	csel	w9, w9, w19, lt
	asr	w9, w9, #15
	stp	x8, x9, [sp, #8]
	ldp	x28, x27, [sp, #40]             ; 16-byte Folded Reload
	str	x28, [sp]
Lloh8:
	adrp	x2, l_.str.3@PAGE
Lloh9:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x27
	bl	_ath_dbg
	cmp	w24, #8, lsl #12                ; =32768
	b.ne	LBB0_26
; %bb.19:
	ldr	w1, [x20]
	mov	w8, #32768
	stp	x8, x8, [sp]
Lloh10:
	adrp	x2, l_.str.4@PAGE
Lloh11:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_28
LBB0_20:
Lloh12:
	adrp	x9, _CALIBRATE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CALIBRATE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x9]
	stp	x14, x15, [sp, #16]
	stp	x8, x10, [sp]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
LBB0_21:
	bl	_ath_dbg
	mov	w0, #0
LBB0_22:
	ldr	x8, [sp, #72]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.23:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_24:
Lloh20:
	adrp	x8, _CALIBRATE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CALIBRATE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	stp	x21, x0, [sp]
Lloh23:
	adrp	x2, l_.str.1@PAGE
Lloh24:
	add	x2, x2, l_.str.1@PAGEOFF
	ldr	x0, [sp, #48]                   ; 8-byte Folded Reload
	b	LBB0_21
LBB0_25:
Lloh25:
	adrp	x8, _CALIBRATE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CALIBRATE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x2, l_.str.2@PAGE
Lloh29:
	add	x2, x2, l_.str.2@PAGEOFF
	ldr	x0, [sp, #48]                   ; 8-byte Folded Reload
	b	LBB0_21
LBB0_26:
	lsl	w8, w24, #15
	mov	w9, #32768
	sub	w9, w9, w24
	sdiv	w8, w8, w9
	add	w9, w8, #255
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w25, w8, #8
	lsl	w8, w19, #8
	neg	w9, w8
	sub	w10, w23, w8
	cmp	w9, #0
	csneg	w8, w10, w8, lt
	asr	w19, w8, #15
	ldr	w1, [x20]
	mov	x26, x28
	stp	x25, x19, [sp, #8]
	str	x26, [sp]
Lloh30:
	adrp	x2, l_.str.5@PAGE
Lloh31:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x27
	bl	_ath_dbg
	cmn	w19, #63
	mov	w23, #-63
	csel	w8, w19, w23, gt
	mov	w24, #63
	cmp	w8, #63
	csel	w8, w8, w24, lt
	cmn	w25, #63
	csel	w9, w25, w23, gt
	cmp	w9, #63
	csel	w9, w9, w24, lt
	bfi	w8, w9, #7, #25
	ldr	x25, [sp, #32]                  ; 8-byte Folded Reload
	str	w8, [x25]
	ldr	w1, [x20]
	stp	x26, x8, [sp]
Lloh32:
	adrp	x2, l_.str.6@PAGE
Lloh33:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x27
	bl	_ath_dbg
	cmn	w22, #8, lsl #12                ; =32768
	b.ne	LBB0_29
; %bb.27:
	ldr	w1, [x20]
	mov	w8, #32768
	mov	w9, #-32768
	stp	x9, x8, [sp]
Lloh34:
	adrp	x2, l_.str.7@PAGE
Lloh35:
	add	x2, x2, l_.str.7@PAGEOFF
LBB0_28:
	mov	x0, x27
	b	LBB0_21
LBB0_29:
	neg	w8, w22, lsl #15
	add	w9, w22, #8, lsl #12            ; =32768
	sdiv	w8, w8, w9
	add	w9, w8, #255
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w19, w8, #8
	lsl	w8, w21, #8
	neg	w9, w8
	mov	w10, #32767
	sub	w10, w10, w8
	cmp	w9, #0
	csneg	w8, w10, w8, lt
	asr	w21, w8, #15
	ldr	w1, [x20]
	mov	x22, x28
	stp	x19, x21, [sp, #8]
	str	x22, [sp]
Lloh36:
	adrp	x2, l_.str.8@PAGE
Lloh37:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x0, x27
	bl	_ath_dbg
	cmn	w21, #63
	csel	w8, w21, w23, gt
	cmp	w8, #63
	csel	w8, w8, w24, lt
	cmn	w19, #63
	csel	w9, w19, w23, gt
	cmp	w9, #63
	csel	w9, w9, w24, lt
	bfi	w8, w9, #7, #25
	str	w8, [x25, #4]
	ldr	w1, [x20]
	stp	x22, x8, [sp]
Lloh38:
	adrp	x2, l_.str.9@PAGE
Lloh39:
	add	x2, x2, l_.str.9@PAGEOFF
	mov	x0, x27
	bl	_ath_dbg
	mov	w0, #1
	b	LBB0_22
LBB0_30:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Divide by 0:\na0_d0=%d\na0_d1=%d\na2_d0=%d\na1_d1=%d\n"

	.comm	_DELPT,4,2                      ; @DELPT
l_.str.1:                               ; @.str.1
	.asciz	"Divide by 0: mag1=%d, mag2=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Call to ar9003_hw_solve_iq_cal() failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"chain %d: mag mismatch=%d phase mismatch=%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Divide by 0: mag_tx=%d, res_scale=%d\n"

l_.str.5:                               ; @.str.5
	.asciz	"tx chain %d: mag corr=%d  phase corr=%d\n"

l_.str.6:                               ; @.str.6
	.asciz	"tx chain %d: iq corr coeff=%x\n"

l_.str.7:                               ; @.str.7
	.asciz	"Divide by 0: mag_rx=%d, res_scale=%d\n"

l_.str.8:                               ; @.str.8
	.asciz	"rx chain %d: mag corr=%d  phase corr=%d\n"

l_.str.9:                               ; @.str.9
	.asciz	"rx chain %d: iq corr coeff=%x\n"

	.no_dead_strip	_ar9003_hw_calc_iq_corr
.subsections_via_symbols
