	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_hw_channel_switch
_il4965_hw_channel_switch:              ## @il4965_hw_channel_switch
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movl	32(%rdi), %edi
	callq	_le16_to_cpu
	movl	%eax, %r14d
	movq	(%r13), %rax
	movq	24(%r13), %r12
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	sete	%r15b
	xorl	%edi, %edi
	testq	%r12, %r12
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movb	%r15b, %bl
	movl	16(%r13), %edi
	callq	_iw4965_is_ht40_channel
	testl	%eax, %eax
	movl	%ebx, %edx
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	je	LBB0_4
## %bb.5:
	movq	_RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	testl	%eax, 16(%r13)
	setne	%cl
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_4:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_6:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -104(%rbp)
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	movl	%edi, %r15d
	callq	_cpu_to_le16
	movl	%eax, -76(%rbp)
	movl	16(%r13), %eax
	movl	%eax, -100(%rbp)
	movl	20(%r13), %eax
	movl	%eax, -80(%rbp)
	movl	(%rbx), %esi
	movl	8(%r13), %edi
	movl	%edi, %eax
	subl	4(%rbx), %eax
	jle	LBB0_7
## %bb.8:
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.10:
	cltd
	idivl	%r14d
	subl	%eax, %esi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	jg	LBB0_11
	jmp	LBB0_12
LBB0_7:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
LBB0_11:
	cmpl	$1, %esi
	jg	LBB0_13
LBB0_12:
	callq	_cpu_to_le32
	jmp	LBB0_14
LBB0_9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, %esi
	jle	LBB0_12
LBB0_13:
	imull	(%rax), %esi
	movq	_TIME_UNIT@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_il_usecs_to_beacons
	movl	8(%r13), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_il_add_beacon_time
LBB0_14:
	movl	%eax, %esi
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%eax, -96(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_D_11H
	movq	(%r13), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_il_get_channel_info
	testq	%rax, %rax
	je	LBB0_19
## %bb.15:
	movq	%rax, %rdi
	callq	_il_is_channel_radar
	movq	%rax, -88(%rbp)
	leaq	-92(%rbp), %r9
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_il4965_fill_txpower_tbl
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_D_11H
	jmp	LBB0_18
LBB0_19:
	movl	12(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %edx
	callq	_IL_ERR
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_17:
	movq	_C_CHANNEL_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-104(%rbp), %rcx
	movq	%r13, %rdi
	movl	$32, %edx
	callq	_il_send_cmd_pdu
	movl	%eax, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_EIO,4,2                        ## @EIO
	.comm	_RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK,4,2 ## @RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK
	.comm	_TIME_UNIT,4,2                  ## @TIME_UNIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"uCode time for the switch is 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid channel switch from %u to %u\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.2:                               ## @.str.2
	.asciz	"error:%d  fill txpower_tbl\n"

	.comm	_C_CHANNEL_SWITCH,4,2           ## @C_CHANNEL_SWITCH
	.no_dead_strip	_il4965_hw_channel_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_hw_channel_switch
_il4965_hw_channel_switch:              ; @il4965_hw_channel_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x25, x1
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_le16_to_cpu
	mov	x24, x0
	ldr	x26, [x19, #24]
Lloh0:
	adrp	x8, _NL80211_BAND_2GHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NL80211_BAND_2GHZ@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh2:
	ldr	x8, [x8]
	cmp	x9, x8
	cset	w20, eq
	cmp	x26, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	ldr	w0, [x19, #16]
	bl	_iw4965_is_ht40_channel
	mov	x21, x0
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w8, [x19, #16]
Lloh5:
	adrp	x9, _RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w22, ne
	b	LBB0_7
LBB0_6:
	mov	w22, #0
LBB0_7:
	str	w20, [sp]
	ldr	x8, [x25, #8]
	ldr	w23, [x8]
	mov	x0, x23
	bl	_cpu_to_le16
	ldp	w8, w9, [x19, #16]
	str	w8, [sp, #4]
	stp	w9, w0, [sp, #24]
	ldp	w8, w9, [x25]
	ldr	w0, [x19, #8]
	subs	w9, w0, w9
	b.le	LBB0_10
; %bb.8:
	cbz	w24, LBB0_10
; %bb.9:
	sdiv	w9, w9, w24
	subs	w8, w8, w9
	b.le	LBB0_11
LBB0_10:
	cmp	w8, #1
	b.gt	LBB0_12
LBB0_11:
	bl	_cpu_to_le32
	b	LBB0_13
LBB0_12:
	ldr	w9, [x26]
	mul	w8, w9, w8
Lloh8:
	adrp	x9, _TIME_UNIT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TIME_UNIT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	mul	w1, w8, w9
	mov	x0, x19
	mov	x2, x24
	bl	_il_usecs_to_beacons
	mov	x2, x0
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x3, x24
	bl	_il_add_beacon_time
LBB0_13:
	mov	x1, x0
	str	w0, [sp, #8]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D_11H
	ldr	x1, [x19]
	mov	x0, x19
	mov	x2, x23
	bl	_il_get_channel_info
	cbz	x0, LBB0_16
; %bb.14:
	bl	_il_is_channel_radar
	str	x0, [sp, #16]
	mov	x8, sp
	add	x5, x8, #12
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	mov	x3, x21
	mov	x4, x22
	bl	_il4965_fill_txpower_tbl
	cbz	w0, LBB0_17
; %bb.15:
	mov	x20, x0
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_D_11H
	b	LBB0_3
LBB0_16:
	ldr	w1, [x19, #12]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x23
	bl	_IL_ERR
Lloh17:
	adrp	x8, _EFAULT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_2
LBB0_17:
Lloh19:
	adrp	x8, _C_CHANNEL_SWITCH@GOTPAGE
Lloh20:
	ldr	x8, [x8, _C_CHANNEL_SWITCH@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x3, sp
	mov	x0, x19
	mov	w2, #32
	bl	_il_send_cmd_pdu
	mov	x20, x0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_EIO,4,2                        ; @EIO
	.comm	_RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK,4,2 ; @RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK
	.comm	_TIME_UNIT,4,2                  ; @TIME_UNIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"uCode time for the switch is 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid channel switch from %u to %u\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.2:                               ; @.str.2
	.asciz	"error:%d  fill txpower_tbl\n"

	.comm	_C_CHANNEL_SWITCH,4,2           ; @C_CHANNEL_SWITCH
	.no_dead_strip	_il4965_hw_channel_switch
.subsections_via_symbols
