	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_rs_move_mimo2_to_other
_il4965_rs_move_mimo2_to_other:         ## @il4965_rs_move_mimo2_to_other
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -120(%rbp)                ## 8-byte Spill
	movq	%rsi, %r14
	movl	32(%rsi), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	(%rsi), %rax
	movq	24(%rsi), %rsi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rsi,%rcx,8), %rbx
	movl	$1, %edx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rsi,%rdx,8), %r15
	movq	_RATE_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$2, %eax
	movl	$40, %r12d
	subl	%eax, %r12d
	movq	32(%rsi,%rcx,8), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	(%rsi,%rcx,8), %r13d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movslq	%r8d, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	4(%rdi), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	leaq	(%rsi,%rdx,8), %rax
	addq	$20, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%r13d, %eax
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %ecx
	leal	1(%rcx), %eax
	cmpl	$131, %ecx
	movl	$133, %ecx
	cmovgel	%ecx, %eax
	movl	%eax, (%rbx)
	cmpl	%r13d, %eax
	je	LBB0_16
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incl	16(%r14)
	leal	-128(%rax), %ecx
	cmpl	$3, %ecx
	jb	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-132(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_D_RATE
	cmpl	$3, -56(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %eax
	movq	_IL_RS_GOOD_RATIO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_il4965_rs_toggle_antenna
	testl	%eax, %eax
	je	LBB0_15
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_D_RATE
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movl	(%rbx), %ecx
	movq	_ANT_C@GOTPCREL(%rip), %rax
	cmpl	$129, %ecx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_ANT_B@GOTPCREL(%rip), %rax
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$130, %ecx
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_ANT_A@GOTPCREL(%rip), %rax
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rax), %esi
	movl	%esi, 28(%r15)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_il4965_rs_is_valid_ant
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	-120(%rbp), %rdx                ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, %r8
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_il4965_rs_switch_to_siso
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$131, %eax
	jne	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, 24(%rbx)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	je	LBB0_5
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_IEEE80211_HT_CAP_SGI_40@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_19
	jmp	LBB0_15
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_IEEE80211_HT_CAP_SGI_20@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
LBB0_19:                                ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_D_RATE
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	sete	%al
	movl	%eax, 4(%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_il4965_rs_set_expected_tpt_table
	cmpl	$0, 4(%rbx)
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_1 Depth=1
	movslq	8(%r14), %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movq	8(%r15), %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	cmpl	(%rcx,%rdx,4), %eax
	jge	LBB0_15
LBB0_21:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_il4965_rate_n_flags_from_tbl
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_22:
	movl	$1, 12(%r14)
	movl	(%rbx), %eax
	leal	1(%rax), %ecx
	cmpl	$131, %eax
	movl	$133, %eax
	cmovll	%ecx, %eax
	movl	%eax, (%rbx)
	movl	%eax, (%r15)
	jmp	LBB0_24
LBB0_16:
	movq	_LQ_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 16(%rcx,%rdx,8)
	jmp	LBB0_24
LBB0_23:
	movl	$1, 12(%r14)
	movl	(%rbx), %eax
	leal	1(%rax), %ecx
	cmpl	$131, %eax
	movl	$133, %eax
	cmovll	%ecx, %eax
	movl	%eax, (%rbx)
LBB0_24:
	xorl	%eax, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RATE_COUNT,4,2                 ## @RATE_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LQ: MIMO2 toggle Antennas\n"

	.comm	_IL_RS_GOOD_RATIO,4,2           ## @IL_RS_GOOD_RATIO
L_.str.1:                               ## @.str.1
	.asciz	"LQ: MIMO2 switch to SISO\n"

	.comm	_ANT_A,4,2                      ## @ANT_A
	.comm	_ANT_B,4,2                      ## @ANT_B
	.comm	_ANT_C,4,2                      ## @ANT_C
	.comm	_IEEE80211_HT_CAP_SGI_20,4,2    ## @IEEE80211_HT_CAP_SGI_20
	.comm	_IEEE80211_HT_CAP_SGI_40,4,2    ## @IEEE80211_HT_CAP_SGI_40
L_.str.2:                               ## @.str.2
	.asciz	"LQ: MIMO2 toggle SGI/NGI\n"

	.comm	_LQ_NONE,4,2                    ## @LQ_NONE
	.no_dead_strip	_il4965_rs_move_mimo2_to_other
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_rs_move_mimo2_to_other
_il4965_rs_move_mimo2_to_other:         ; @il4965_rs_move_mimo2_to_other
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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
                                        ; kill: def $w4 killed $w4 def $x4
	mov	x24, x3
	stp	x2, x4, [sp, #88]               ; 16-byte Folded Spill
	mov	x20, x1
	mov	x25, x0
	ldr	w8, [x1, #32]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	ldr	x11, [x1, #24]
	ldr	x8, [x1]
	mov	w9, #40
	madd	x19, x8, x9, x11
	mov	w10, #1
	sub	x8, x10, x8
	stp	x8, x11, [sp, #8]               ; 16-byte Folded Spill
	madd	x22, x8, x9, x11
	ldr	x10, [x19, #32]
	sxtw	x8, w4
	stp	x10, x8, [sp, #72]              ; 16-byte Folded Spill
Lloh0:
	adrp	x8, _RATE_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RATE_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w27, w9, w8, lsl #2
	add	x8, x19, #24
	str	x8, [sp, #64]                   ; 8-byte Folded Spill
	ldp	w28, w8, [x0]
	stur	w8, [x29, #-84]                 ; 4-byte Folded Spill
	ldr	w26, [x19]
	add	x10, x19, #4
	add	x8, x22, #4
	stp	x8, x10, [sp, #48]              ; 16-byte Folded Spill
	add	x10, x22, #8
	add	x21, x22, #28
Lloh3:
	adrp	x23, l_.str.1@PAGE
Lloh4:
	add	x23, x23, l_.str.1@PAGEOFF
	add	x8, x22, #20
	stp	x8, x10, [sp, #24]              ; 16-byte Folded Spill
	mov	x8, x26
	str	w27, [sp, #44]                  ; 4-byte Folded Spill
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x19]
	cmp	w8, #130
	mov	w9, #133
	csinc	w8, w9, w8, gt
	str	w8, [x19]
	cmp	w8, w26
	b.eq	LBB0_18
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x20, #16]
	add	w9, w9, #1
	str	w9, [x20, #16]
	sub	w9, w8, #128
	cmp	w9, #3
	b.lo	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w9, w8, #132
	cmp	w9, #2
	b.hs	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D_RATE
	ldur	w8, [x29, #-84]                 ; 4-byte Folded Reload
	cmp	w8, #3
	b.lt	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x8, x9, [sp, #72]               ; 16-byte Folded Reload
	ldr	w8, [x8, x9, lsl #2]
Lloh7:
	adrp	x9, _IL_RS_GOOD_RATIO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IL_RS_GOOD_RATIO@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x27
	bl	_memcpy
	mov	x0, x28
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, x22
	bl	_il4965_rs_toggle_antenna
	cbz	w0, LBB0_1
	b	LBB0_17
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_D_RATE
	mov	x0, x22
	mov	x1, x19
	mov	x2, x27
	bl	_memcpy
	ldr	w8, [x19]
	cmp	w8, #129
Lloh10:
	adrp	x9, _ANT_B@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ANT_B@GOTPAGEOFF]
Lloh12:
	adrp	x10, _ANT_C@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ANT_C@GOTPAGEOFF]
	csel	x9, x9, x10, eq
	cmp	w8, #130
Lloh14:
	adrp	x8, _ANT_A@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ANT_A@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	str	w1, [x21]
	mov	x0, x28
	bl	_il4965_rs_is_valid_ant
	cbz	w0, LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x25
	mov	x1, x20
	ldp	x2, x5, [sp, #88]               ; 16-byte Folded Reload
	mov	x3, x24
	mov	x4, x22
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_il4965_rs_switch_to_siso
	cbnz	w0, LBB0_1
	b	LBB0_19
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w8, #131
	b.ne	LBB0_1
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [sp, #64]                   ; 8-byte Folded Reload
	ldr	w9, [x8]
	ldr	w8, [x24]
	cbz	w9, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh16:
	adrp	x9, _IEEE80211_HT_CAP_SGI_40@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IEEE80211_HT_CAP_SGI_40@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh18:
	adrp	x9, _IEEE80211_HT_CAP_SGI_20@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IEEE80211_HT_CAP_SGI_20@GOTPAGEOFF]
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_D_RATE
	mov	x0, x22
	mov	x1, x19
	mov	x2, x27
	bl	_memcpy
	mov	x27, x23
	mov	x23, x28
	mov	x28, x21
	mov	x21, x24
	mov	x24, x25
	ldp	x9, x25, [sp, #48]              ; 16-byte Folded Reload
	ldr	w8, [x25]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x9]
	mov	x0, x20
	mov	x1, x22
	bl	_il4965_rs_set_expected_tpt_table
	ldr	w8, [x25]
	mov	x25, x24
	mov	x24, x21
	mov	x21, x28
	mov	x28, x23
	mov	x23, x27
	ldr	w27, [sp, #44]                  ; 4-byte Folded Reload
	cbz	w8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	ldrsw	x8, [x20, #8]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	ldr	x10, [sp, #32]                  ; 8-byte Folded Reload
	ldr	x10, [x10]
	ldr	x11, [sp, #80]                  ; 8-byte Folded Reload
	ldr	w10, [x10, x11, lsl #2]
	add	w8, w8, w9
	cmp	w8, w10
	b.ge	LBB0_1
LBB0_16:
	mov	x0, x25
	mov	x1, x22
	ldr	x2, [sp, #96]                   ; 8-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
	ldr	w3, [sp, #4]                    ; 4-byte Folded Reload
	bl	_il4965_rate_n_flags_from_tbl
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	str	w0, [x8]
LBB0_17:
	mov	w8, #1
	str	w8, [x20, #12]
	ldr	w8, [x19]
	cmp	w8, #130
	mov	w9, #133
	csinc	w8, w9, w8, gt
	str	w8, [x19]
	str	w8, [x22]
	b	LBB0_20
LBB0_18:
Lloh22:
	adrp	x8, _LQ_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LQ_NONE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	mov	w9, #40
	ldp	x11, x10, [sp, #8]              ; 16-byte Folded Reload
	madd	x9, x11, x9, x10
	str	w8, [x9, #16]
	b	LBB0_20
LBB0_19:
	mov	w8, #1
	str	w8, [x20, #12]
	ldr	w8, [x19]
	cmp	w8, #130
	mov	w9, #133
	csinc	w8, w9, w8, gt
	str	w8, [x19]
LBB0_20:
	mov	w0, #0
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_RATE_COUNT,4,2                 ; @RATE_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LQ: MIMO2 toggle Antennas\n"

	.comm	_IL_RS_GOOD_RATIO,4,2           ; @IL_RS_GOOD_RATIO
l_.str.1:                               ; @.str.1
	.asciz	"LQ: MIMO2 switch to SISO\n"

	.comm	_ANT_A,4,2                      ; @ANT_A
	.comm	_ANT_B,4,2                      ; @ANT_B
	.comm	_ANT_C,4,2                      ; @ANT_C
	.comm	_IEEE80211_HT_CAP_SGI_20,4,2    ; @IEEE80211_HT_CAP_SGI_20
	.comm	_IEEE80211_HT_CAP_SGI_40,4,2    ; @IEEE80211_HT_CAP_SGI_40
l_.str.2:                               ; @.str.2
	.asciz	"LQ: MIMO2 toggle SGI/NGI\n"

	.comm	_LQ_NONE,4,2                    ; @LQ_NONE
	.no_dead_strip	_il4965_rs_move_mimo2_to_other
.subsections_via_symbols
