	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function orinoco_ioctl_setfreq
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
LCPI0_1:
	.long	100000000                       ## 0x5f5e100
	.long	100000000                       ## 0x5f5e100
	.long	100000000                       ## 0x5f5e100
	.long	100000000                       ## 0x5f5e100
LCPI0_2:
	.long	10                              ## 0xa
	.long	10                              ## 0xa
	.long	10                              ## 0xa
	.long	10                              ## 0xa
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_orinoco_ioctl_setfreq:                 ## @orinoco_ioctl_setfreq
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	callq	_ndev_priv
	movq	%rax, %r14
	xorl	%r12d, %r12d
	movq	(%rax), %rax
	movq	_NL80211_IFTYPE_STATION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_2:
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	$1, %esi
	cmpq	$5, %rax
	jle	LBB0_5
	jmp	LBB0_17
LBB0_4:
	movl	8(%r15), %ebx
	cmpl	$1001, %ebx                     ## imm = 0x3E9
	jl	LBB0_18
LBB0_5:
	movl	$6, %ecx
	subq	%rax, %rcx
	cmpq	$2, %rcx
	movl	$1, %eax
	cmovgeq	%rcx, %rax
	cmpq	$8, %rax
	jae	LBB0_7
## %bb.6:
	movl	$1, %esi
	xorl	%ecx, %ecx
	jmp	LBB0_15
LBB0_7:
	movabsq	$9223372036854775800, %rcx      ## imm = 0x7FFFFFFFFFFFFFF8
	andq	%rax, %rcx
	leaq	-8(%rcx), %rdi
	movq	%rdi, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$7, %edx
	cmpq	$56, %rdi
	jae	LBB0_9
## %bb.8:
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [1,1,1,1]
	movdqa	%xmm0, %xmm1
	jmp	LBB0_11
LBB0_9:
	andq	$-8, %rsi
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [1,1,1,1]
	movdqa	LCPI0_1(%rip), %xmm2            ## xmm2 = [100000000,100000000,100000000,100000000]
	movdqa	%xmm0, %xmm1
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm2, %xmm0
	pmulld	%xmm2, %xmm1
	addq	$-8, %rsi
	jne	LBB0_10
LBB0_11:
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.12:
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [10,10,10,10]
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm2, %xmm0
	pmulld	%xmm2, %xmm1
	decq	%rdx
	jne	LBB0_13
LBB0_14:
	pmulld	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	pmulld	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	pmulld	%xmm1, %xmm0
	movd	%xmm0, %esi
	cmpq	%rcx, %rax
	je	LBB0_17
LBB0_15:
	subq	%rcx, %rax
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	addl	%esi, %esi
	leal	(%rsi,%rsi,4), %esi
	decq	%rax
	jne	LBB0_16
LBB0_17:
	movl	8(%r15), %eax
	cltd
	idivl	%esi
	movl	%eax, %edi
	callq	_ieee80211_frequency_to_channel
	movl	%eax, %ebx
LBB0_18:
	testl	%ebx, %ebx
	jle	LBB0_23
## %bb.19:
	movq	_NUM_CHANNELS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_23
## %bb.20:
	movl	8(%r14), %eax
	leal	-1(%rbx), %ecx
	movzbl	%cl, %ecx
	btl	%ecx, %eax
	jae	LBB0_23
## %bb.21:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_orinoco_lock
	testq	%rax, %rax
	je	LBB0_27
## %bb.22:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_24:
	xorl	%r12d, %r12d
LBB0_25:
	subl	(%rax), %r12d
LBB0_26:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movl	%ebx, 12(%r14)
	movq	(%r14), %rax
	movq	_NL80211_IFTYPE_MONITOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.28:
	movq	%r14, %rdi
	addq	$16, %rdi
	movq	16(%r14), %rax
	movq	_HERMES_CMD_TEST@GOTPCREL(%rip), %rcx
	movq	_HERMES_TEST_SET_CHANNEL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	*(%rax)
	movl	%eax, %r12d
LBB0_29:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_orinoco_unlock
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_NL80211_IFTYPE_STATION,8,3     ## @NL80211_IFTYPE_STATION
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_NUM_CHANNELS,4,2               ## @NUM_CHANNELS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NL80211_IFTYPE_MONITOR,8,3     ## @NL80211_IFTYPE_MONITOR
	.comm	_HERMES_CMD_TEST,4,2            ## @HERMES_CMD_TEST
	.comm	_HERMES_TEST_SET_CHANNEL,4,2    ## @HERMES_TEST_SET_CHANNEL
	.no_dead_strip	_orinoco_ioctl_setfreq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function orinoco_ioctl_setfreq
_orinoco_ioctl_setfreq:                 ; @orinoco_ioctl_setfreq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	bl	_ndev_priv
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NL80211_IFTYPE_STATION@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_IFTYPE_STATION@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_20
LBB0_2:
	mov	x19, x0
Lloh5:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.3:
	cmp	x8, #5
	b.le	LBB0_6
; %bb.4:
	mov	w10, #1
	b	LBB0_13
LBB0_5:
	ldr	w21, [x20, #8]
	cmp	w21, #1001
	b.lt	LBB0_14
LBB0_6:
	mov	w9, #6
	sub	x8, x9, x8
	cmp	x8, #1
	csinc	x8, x8, xzr, gt
	cmp	x8, #16
	b.hs	LBB0_8
; %bb.7:
	mov	x9, #0
	mov	w10, #1
	b	LBB0_11
LBB0_8:
	and	x9, x8, #0x7ffffffffffffff0
	movi.4s	v0, #1
	movi.4s	v1, #10
	mov	x10, x9
	movi.4s	v2, #1
	movi.4s	v3, #1
	movi.4s	v4, #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mul.4s	v0, v0, v1
	mul.4s	v2, v2, v1
	mul.4s	v3, v3, v1
	mul.4s	v4, v4, v1
	subs	x10, x10, #16
	b.ne	LBB0_9
; %bb.10:
	mul.4s	v0, v2, v0
	mul.4s	v0, v3, v0
	mul.4s	v0, v4, v0
	ext.16b	v1, v0, v0, #8
	mul.2s	v0, v0, v1
	fmov	w10, s0
	mov.s	w11, v0[1]
	mul	w10, w10, w11
	cmp	x8, x9
	b.eq	LBB0_13
LBB0_11:
	sub	x8, x8, x9
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	w9, w10, w10, lsl #2
	lsl	w10, w9, #1
	subs	x8, x8, #1
	b.ne	LBB0_12
LBB0_13:
	ldr	w8, [x20, #8]
	sdiv	w0, w8, w10
	bl	_ieee80211_frequency_to_channel
	mov	x21, x0
LBB0_14:
Lloh8:
	adrp	x8, _NUM_CHANNELS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NUM_CHANNELS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x8]
	subs	w8, w21, #1
	ccmp	w21, w9, #0, ge
	b.gt	LBB0_19
; %bb.15:
	ldr	w9, [x19, #8]
	lsr	w8, w9, w8
	tbz	w8, #0, LBB0_19
; %bb.16:
	add	x1, sp, #8
	mov	x0, x19
	bl	_orinoco_lock
	cbnz	x0, LBB0_1
; %bb.17:
	str	w21, [x19, #12]
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _NL80211_IFTYPE_MONITOR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NL80211_IFTYPE_MONITOR@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.18:
	mov	x0, x19
	ldr	x8, [x0, #16]!
Lloh14:
	adrp	x9, _HERMES_CMD_TEST@GOTPAGE
Lloh15:
	ldr	x9, [x9, _HERMES_CMD_TEST@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _HERMES_TEST_SET_CHANNEL@GOTPAGE
Lloh18:
	ldr	x10, [x10, _HERMES_TEST_SET_CHANNEL@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w1, w10, w9
	mov	x2, x21
	mov	x3, #0
	blr	x8
	mov	x20, x0
	b	LBB0_23
LBB0_19:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_21:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_22:
	neg	w20, w22
LBB0_23:
	add	x1, sp, #8
	mov	x0, x19
	bl	_orinoco_unlock
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_NL80211_IFTYPE_STATION,8,3     ; @NL80211_IFTYPE_STATION
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_NUM_CHANNELS,4,2               ; @NUM_CHANNELS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NL80211_IFTYPE_MONITOR,8,3     ; @NL80211_IFTYPE_MONITOR
	.comm	_HERMES_CMD_TEST,4,2            ; @HERMES_CMD_TEST
	.comm	_HERMES_TEST_SET_CHANNEL,4,2    ; @HERMES_TEST_SET_CHANNEL
	.no_dead_strip	_orinoco_ioctl_setfreq
.subsections_via_symbols
