	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __ar955x_tx_iq_cal_sort
___ar955x_tx_iq_cal_sort:               ## @__ar955x_tx_iq_cal_sort
	.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
	movl	%ecx, %ebx
	movl	%edx, %r12d
	movq	%rsi, %r15
	callq	_ath9k_hw_common
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.1:
	movslq	%r12d, %r12
	movl	%ebx, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	_MAXIQCAL@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rax
	movq	(%rax,%r12,8), %rax
	movq	(%rax,%r13,8), %rax
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %ecx
	movl	%ecx, (%rax)
	movq	8(%r15), %rcx
	movq	(%rcx,%r12,8), %rcx
	movq	(%rcx,%r13,8), %rcx
	movl	(%r14), %edx
	movl	%edx, %esi
	shrl	$31, %esi
	addl	%edx, %esi
	sarl	%esi
	movslq	%esi, %rdx
	movl	(%rcx,%rdx,4), %edx
	movl	%edx, (%rcx)
	movq	_CALIBRATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %r9d
	movl	%edx, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	callq	_ath_dbg
	incq	%r13
	cmpq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	je	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
	movl	(%r14), %edx
	cmpl	$2, %edx
	jl	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r9d
	xorl	%r8d, %r8d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=2
	leal	-1(%rdx), %eax
	cltq
	incq	%r9
	cmpq	%rax, %r8
	jge	LBB0_12
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
	movq	%r8, %rsi
	incq	%r8
	movslq	%edx, %rax
	cmpq	%rax, %r8
	jge	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movq	(%rax,%r12,8), %rax
	movq	(%rax,%r13,8), %rdi
	movq	(%rcx,%r12,8), %rax
	movq	(%rax,%r13,8), %rbx
	movq	%r9, %rax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=3
	incq	%rax
	movl	(%r14), %edx
	cmpl	%eax, %edx
	jle	LBB0_4
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%rdi,%rax,4), %edx
	movl	(%rdi,%rsi,4), %ecx
	cmpl	%ecx, %edx
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=3
	movl	%edx, (%rdi,%rsi,4)
	movl	%ecx, (%rdi,%rax,4)
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=3
	movl	(%rbx,%rax,4), %ecx
	movl	(%rbx,%rsi,4), %edx
	cmpl	%edx, %ecx
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=3
	movl	%ecx, (%rbx,%rsi,4)
	movl	%edx, (%rbx,%rax,4)
	jmp	LBB0_11
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXIQCAL,4,2                   ## @MAXIQCAL
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IQCAL: Median [ch%d][gain%d]: mag = %d phase = %d\n"

	.no_dead_strip	___ar955x_tx_iq_cal_sort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __ar955x_tx_iq_cal_sort
___ar955x_tx_iq_cal_sort:               ; @__ar955x_tx_iq_cal_sort
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	bl	_ath9k_hw_common
	cmp	w23, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x21, x0
	mov	x22, #0
	sxtw	x8, w19
Lloh0:
	adrp	x24, _MAXIQCAL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MAXIQCAL@GOTPAGEOFF]
	mov	w25, w23
	lsl	x26, x8, #3
Lloh2:
	adrp	x27, _CALIBRATE@GOTPAGE
Lloh3:
	ldr	x27, [x27, _CALIBRATE@GOTPAGEOFF]
Lloh4:
	adrp	x23, l_.str@PAGE
Lloh5:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldp	x9, x11, [x20]
	ldr	x9, [x9, x26]
	ldr	x9, [x9, x8]
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	ldr	w10, [x9, w10, sxtw #2]
	ldr	x11, [x11, x26]
	str	w10, [x9]
	ldr	x8, [x11, x8]
	ldr	w10, [x24]
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	ldr	w6, [x8, w10, sxtw #2]
	str	w6, [x8]
	ldr	w1, [x27]
	ldr	w5, [x9]
	mov	x0, x21
	mov	x2, x23
	mov	x3, x19
	mov	x4, x22
	bl	_ath_dbg
	add	x22, x22, #1
	cmp	x22, x25
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
	ldr	w10, [x24]
	lsl	x8, x22, #3
	cmp	w10, #2
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x12, #0
	mov	w9, #1
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	sub	w12, w10, #1
	add	x9, x9, #1
	cmp	x11, w12, sxtw
	mov	x12, x11
	b.ge	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
	add	x11, x12, #1
	cmp	x11, w10, sxtw
	b.ge	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldp	x10, x14, [x20]
	ldr	x10, [x10, x26]
	ldr	x13, [x10, x8]
	ldr	x10, [x14, x26]
	ldr	x14, [x10, x8]
	mov	x15, x9
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=3
	add	x15, x15, #1
	ldr	w10, [x24]
	cmp	w10, w15
	b.le	LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w10, [x13, x15, lsl #2]
	ldr	w16, [x13, x12, lsl #2]
	cmp	w10, w16
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=3
	str	w10, [x13, x12, lsl #2]
	str	w16, [x13, x15, lsl #2]
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=3
	ldr	w10, [x14, x15, lsl #2]
	ldr	w16, [x14, x12, lsl #2]
	cmp	w10, w16
	b.ge	LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=3
	str	w10, [x14, x12, lsl #2]
	str	w16, [x14, x15, lsl #2]
	b	LBB0_8
LBB0_13:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXIQCAL,4,2                   ; @MAXIQCAL
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IQCAL: Median [ch%d][gain%d]: mag = %d phase = %d\n"

	.no_dead_strip	___ar955x_tx_iq_cal_sort
.subsections_via_symbols
