	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl5000_hw_channel_switch
_iwl5000_hw_channel_switch:             ## @iwl5000_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %r13
	movq	_IWL_RXON_CTX_BSS@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	shlq	$5, %r15
	movl	24(%r13,%r15), %edi
	callq	_le16_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	16(%r13,%r15), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	-80(%rbp), %rax
	movl	%eax, -56(%rbp)
	movl	$24, -52(%rbp)
	movq	_REPLY_CHANNEL_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	(%r12), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movl	%edx, -80(%rbp)
	movq	8(%r14), %rax
	movl	(%rax), %ebx
	movl	8(%r13,%r15), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_11H
	movl	%ebx, %edi
	movq	%r14, %rbx
	callq	_cpu_to_le16
	movl	%eax, -60(%rbp)
	movl	4(%r13,%r15), %eax
	movl	%eax, -64(%rbp)
	movl	(%r13,%r15), %eax
	movl	%eax, -68(%rbp)
	movl	(%r14), %esi
	movl	8(%r12), %edi
	movl	%edi, %eax
	subl	4(%r14), %eax
	jle	LBB0_1
## %bb.2:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	cltd
	idivl	%r14d
	subl	%eax, %esi
	jle	LBB0_5
LBB0_4:
	cmpl	$1, %esi
	jg	LBB0_6
LBB0_5:
	callq	_cpu_to_le32
	jmp	LBB0_7
LBB0_1:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	$1, %esi
	jle	LBB0_5
LBB0_6:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	imull	(%rax), %esi
	movq	_TIME_UNIT@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_iwl_usecs_to_beacons
	movl	8(%r12), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_iwl_add_beacon_time
LBB0_7:
	movl	%eax, %edx
	movl	%eax, -72(%rbp)
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_IWL_DEBUG_11H
	movq	8(%rbx), %rax
	movq	_IEEE80211_CHAN_RADAR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	4(%rax), %ecx
	movl	%ecx, -76(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_iwl_dvm_send_cmd
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_RXON_CTX_BSS,8,3           ## @IWL_RXON_CTX_BSS
	.comm	_REPLY_CHANNEL_SWITCH,4,2       ## @REPLY_CHANNEL_SWITCH
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channel switch from %d to %d\n"

	.comm	_TIME_UNIT,4,2                  ## @TIME_UNIT
L_.str.1:                               ## @.str.1
	.asciz	"uCode time for the switch is 0x%x\n"

	.comm	_IEEE80211_CHAN_RADAR,4,2       ## @IEEE80211_CHAN_RADAR
	.no_dead_strip	_iwl5000_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 iwl5000_hw_channel_switch
_iwl5000_hw_channel_switch:             ; @iwl5000_hw_channel_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _IWL_RXON_CTX_BSS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IWL_RXON_CTX_BSS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x24, x8, x9, lsl #5
	ldr	w0, [x24, #24]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	x23, [x24, #16]
	add	x8, sp, #24
	mov	w9, #24
	stp	w8, w9, [sp, #8]
Lloh3:
	adrp	x8, _REPLY_CHANNEL_SWITCH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REPLY_CHANNEL_SWITCH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #16]
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
	str	w8, [sp, #24]
	ldr	x8, [x20, #8]
	ldr	w22, [x8]
	ldr	w2, [x24, #8]
	str	x22, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_11H
	mov	x0, x22
	bl	_cpu_to_le16
	str	w0, [sp, #44]
	ldr	d0, [x24]
	stur	d0, [sp, #36]
	ldp	w8, w9, [x20]
	ldr	w0, [x19, #8]
	subs	w9, w0, w9
	b.le	LBB0_3
; %bb.1:
	cbz	w21, LBB0_3
; %bb.2:
	sdiv	w9, w9, w21
	subs	w8, w8, w9
	b.le	LBB0_4
LBB0_3:
	cmp	w8, #1
	b.gt	LBB0_5
LBB0_4:
	bl	_cpu_to_le32
	b	LBB0_6
LBB0_5:
	ldr	w9, [x23]
	mul	w8, w9, w8
Lloh11:
	adrp	x9, _TIME_UNIT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TIME_UNIT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	mul	w1, w8, w9
	mov	x0, x19
	mov	x2, x21
	bl	_iwl_usecs_to_beacons
	mov	x2, x0
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x3, x21
	bl	_iwl_add_beacon_time
LBB0_6:
	mov	x2, x0
	str	w0, [sp, #32]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_11H
	ldr	x8, [x20, #8]
	ldr	w8, [x8, #4]
Lloh16:
	adrp	x9, _IEEE80211_CHAN_RADAR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IEEE80211_CHAN_RADAR@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	w8, [sp, #28]
	add	x1, sp, #8
	mov	x0, x19
	bl	_iwl_dvm_send_cmd
	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
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_RXON_CTX_BSS,8,3           ; @IWL_RXON_CTX_BSS
	.comm	_REPLY_CHANNEL_SWITCH,4,2       ; @REPLY_CHANNEL_SWITCH
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channel switch from %d to %d\n"

	.comm	_TIME_UNIT,4,2                  ; @TIME_UNIT
l_.str.1:                               ; @.str.1
	.asciz	"uCode time for the switch is 0x%x\n"

	.comm	_IEEE80211_CHAN_RADAR,4,2       ; @IEEE80211_CHAN_RADAR
	.no_dead_strip	_iwl5000_hw_channel_switch
.subsections_via_symbols
