	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b43_nphy_calc_rx_iq_comp
_b43_nphy_calc_rx_iq_comp:              ## @b43_nphy_calc_rx_iq_comp
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	testl	%esi, %esi
	je	LBB0_23
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r13
	leaq	-104(%rbp), %rdx
	xorl	%esi, %esi
	callq	_b43_nphy_rx_iq_coeffs
	leaq	-64(%rbp), %rdx
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_b43_nphy_rx_iq_coeffs
	leaq	-88(%rbp), %rsi
	movq	%r13, %rdi
	movl	$16384, %edx                    ## imm = 0x4000
	movl	$32, %ecx
	xorl	%r8d, %r8d
	callq	_b43_nphy_rx_iq_est
	movups	-104(%rbp), %xmm0
	movaps	%xmm0, -64(%rbp)
	testb	$1, %r14b
	jne	LBB0_2
LBB0_10:
	testb	$2, %r14b
	je	LBB0_22
## %bb.11:
	movl	-72(%rbp), %r12d
	movl	-68(%rbp), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addl	%r12d, %eax
	cmpl	$2, %eax
	jl	LBB0_21
## %bb.12:
	movl	-76(%rbp), %r15d
	movl	%r15d, %edi
	negl	%edi
	cmovsl	%r15d, %edi
	callq	_fls
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_fls
	movl	%eax, %esi
	movb	$30, %cl
	subb	%bl, %cl
	shll	%cl, %r15d
	cmpl	$19, %ebx
	jle	LBB0_13
## %bb.17:
	leal	-19(%rbx), %ecx
	movl	%r12d, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	addl	%r15d, %eax
	leal	-20(%rbx), %ecx
	movl	%r12d, %edi
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edi
	testl	%edi, %edi
	jne	LBB0_19
	jmp	LBB0_21
LBB0_2:
	movl	-84(%rbp), %r12d
	movl	-80(%rbp), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addl	%r12d, %eax
	cmpl	$2, %eax
	jl	LBB0_21
## %bb.3:
	movl	-88(%rbp), %r15d
	movl	%r15d, %edi
	negl	%edi
	cmovsl	%r15d, %edi
	callq	_fls
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_fls
	movl	%eax, %esi
	movb	$30, %cl
	subb	%bl, %cl
	shll	%cl, %r15d
	cmpl	$20, %ebx
	jl	LBB0_5
## %bb.4:
	leal	-19(%rbx), %ecx
	movl	%r12d, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	addl	%r15d, %eax
	leal	-20(%rbx), %ecx
	movl	%r12d, %edi
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edi
	testl	%edi, %edi
	jne	LBB0_7
	jmp	LBB0_21
LBB0_5:
	movb	$19, %cl
	subb	%bl, %cl
	movl	%r12d, %eax
	shll	%cl, %eax
	addl	%r15d, %eax
	movb	$20, %cl
	subb	%bl, %cl
	movl	%r12d, %edi
	shll	%cl, %edi
	testl	%edi, %edi
	je	LBB0_21
LBB0_7:
	cltd
	idivl	%edi
	movl	%eax, %ebx
	leal	-11(%rsi), %ecx
	movl	%r12d, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movb	$11, %cl
	subb	%sil, %cl
	shll	%cl, %r12d
	cmpl	$11, %esi
	cmovgel	%eax, %r12d
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.8:
	movb	$31, %cl
	subb	%sil, %cl
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	shll	%cl, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r12d
	movl	%ebx, %ecx
	imull	%ebx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edi
	callq	_int_sqrt
	testb	$1, %r14b
	je	LBB0_10
## %bb.9:
	negl	%ebx
	cmpl	$3, (%r13)
	movl	%eax, %ecx
	cmovgel	%ebx, %ecx
	cmovgel	%eax, %ebx
	andl	$1023, %ecx                     ## imm = 0x3FF
	movl	%ecx, -64(%rbp)
	andl	$1023, %ebx                     ## imm = 0x3FF
	movl	%ebx, -60(%rbp)
	jmp	LBB0_10
LBB0_13:
	movb	$19, %cl
	subb	%bl, %cl
	movl	%r12d, %eax
	shll	%cl, %eax
	addl	%r15d, %eax
	movb	$20, %cl
	subb	%bl, %cl
	movl	%r12d, %edi
	shll	%cl, %edi
	testl	%edi, %edi
	je	LBB0_21
LBB0_19:
	cltd
	idivl	%edi
	movl	%eax, %ebx
	leal	-11(%rsi), %ecx
	movl	%r12d, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movb	$11, %cl
	subb	%sil, %cl
	shll	%cl, %r12d
	cmpl	$11, %esi
	cmovgel	%eax, %r12d
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.20:
	movb	$31, %cl
	subb	%sil, %cl
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	shll	%cl, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r12d
	movl	%ebx, %ecx
	imull	%ebx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edi
	callq	_int_sqrt
	testb	$2, %r14b
	je	LBB0_22
## %bb.14:
	negl	%ebx
	cmpl	$3, (%r13)
	jl	LBB0_16
## %bb.15:
	andl	$1023, %ebx                     ## imm = 0x3FF
	movl	%ebx, -56(%rbp)
	andl	$1023, %eax                     ## imm = 0x3FF
	movl	%eax, -52(%rbp)
	jmp	LBB0_22
LBB0_21:
	movups	-104(%rbp), %xmm0
	movaps	%xmm0, -64(%rbp)
LBB0_22:
	leaq	-64(%rbp), %rdx
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_b43_nphy_rx_iq_coeffs
LBB0_23:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	andl	$1023, %eax                     ## imm = 0x3FF
	movl	%eax, -56(%rbp)
	andl	$1023, %ebx                     ## imm = 0x3FF
	movl	%ebx, -52(%rbp)
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_b43_nphy_calc_rx_iq_comp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function b43_nphy_calc_rx_iq_comp
_b43_nphy_calc_rx_iq_comp:              ; @b43_nphy_calc_rx_iq_comp
	.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
	stp	xzr, xzr, [sp, #16]
	cbz	w1, LBB0_17
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	add	x2, sp, #40
	mov	w1, #0
	bl	_b43_nphy_rx_iq_coeffs
	mov	w21, #1
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #1
	bl	_b43_nphy_rx_iq_coeffs
	add	x22, sp, #56
	add	x1, sp, #56
	mov	x0, x19
	mov	w2, #16384
	mov	w3, #32
	mov	w4, #0
	bl	_b43_nphy_rx_iq_est
	mov	w8, #0
	ldur	q0, [sp, #40]
	orr	x23, x22, #0x4
	add	x24, x22, #8
	add	x10, x22, #16
	str	q0, [sp, #16]
	add	x9, x22, #20
	stp	x9, x10, [sp]                   ; 16-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	cmp	w8, #2
	csel	w8, w22, w0, gt
	csel	w9, w0, w22, gt
	and	w8, w8, #0x3ff
	and	w9, w9, #0x3ff
	stp	w8, w9, [sp, #16]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w21, #0
	mov	w8, #1
	tbz	w26, #0, LBB0_16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x26, x21
	tst	w20, #0x1
	cset	w9, eq
	orr	w27, w9, w8
	tbz	w27, #0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	tst	w20, #0x2
	cset	w8, eq
	orr	w8, w8, w26
	tbnz	w8, #0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w25, [sp, #68]
	ldp	x9, x8, [sp]                    ; 16-byte Folded Reload
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w25, [sp, #56]
	mov	x8, x23
	mov	x9, x24
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w28, [x8]
	ldr	w21, [x9]
	add	w8, w28, w21
	cmp	w8, #2
	b.lt	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, #0
	cneg	w0, w25, mi
	bl	_fls
	mov	x22, x0
	mov	x0, x21
	bl	_fls
	mov	w8, #30
	sub	w8, w8, w22
	lsl	w8, w25, w8
	mov	w9, #19
	sub	w9, w9, w22
	lsl	w9, w28, w9
	add	w9, w8, w9
	mov	w10, #20
	sub	w10, w10, w22
	lsl	w10, w28, w10
	sub	w11, w22, #20
	sub	w12, w22, #19
	asr	w12, w28, w12
	add	w12, w8, w12
	asr	w8, w28, w11
	cmp	w22, #20
	csel	w8, w10, w8, lt
	csel	w9, w9, w12, lt
	cbz	w8, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	sub	w10, w0, #11
	asr	w10, w28, w10
	mov	w11, #11
	sub	w11, w11, w0
	lsl	w11, w28, w11
	cmp	w0, #10
	csel	w10, w10, w11, gt
	cbz	w10, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	sdiv	w8, w9, w8
	neg	w22, w8
	mvn	w9, w0
	lsl	w9, w21, w9
	sdiv	w9, w9, w10
	msub	w0, w8, w8, w9
	bl	_int_sqrt
	tbz	w27, #0, LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	tst	w20, #0x2
	cset	w8, eq
	orr	w8, w8, w26
	tbnz	w8, #0, LBB0_3
; %bb.13:
	ldr	w8, [x19]
	cmp	w8, #3
	b.lt	LBB0_18
; %bb.14:
	and	w8, w22, #0x3ff
	and	w9, w0, #0x3ff
	b	LBB0_19
LBB0_15:
	ldur	q0, [sp, #40]
	str	q0, [sp, #16]
LBB0_16:
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #1
	bl	_b43_nphy_rx_iq_coeffs
LBB0_17:
	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_18:
	and	w8, w0, #0x3ff
	and	w9, w22, #0x3ff
LBB0_19:
	stp	w8, w9, [sp, #24]
	b	LBB0_16
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_b43_nphy_calc_rx_iq_comp
.subsections_via_symbols
