	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cadet_setfreq
_cadet_setfreq:                         ## @cadet_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	movq	%rdi, %r14
	movq	_bands@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rdi), %rsi
	movl	(%rcx,%rsi,8), %edx
	movl	4(%rcx,%rsi,8), %esi
	movl	%eax, %edi
	callq	_clamp
	movl	%eax, 8(%r14)
	movl	%eax, %ebx
	shrl	$4, %ebx
	cmpq	$0, (%r14)
	je	LBB0_2
## %bb.1:
	leal	-102400(%rbx), %ecx
	xorl	%edx, %edx
	cmpl	$1467200, %eax                  ## imm = 0x166340
	cmovbl	%ebx, %ecx
	setae	%dl
	leal	10700(%rcx), %eax
	addl	$-40500, %ecx                   ## imm = 0xFFFF61CC
	xorl	%esi, %esi
	cmpl	$51200, %eax                    ## imm = 0xC800
	setae	%sil
	cmovbl	%eax, %ecx
	leal	(%rsi,%rdx,2), %eax
	leal	-25600(%rcx), %edx
	xorl	%esi, %esi
	cmpl	$25600, %ecx                    ## imm = 0x6400
	setae	%sil
	cmovbl	%ecx, %edx
	addl	%esi, %esi
	leal	(%rsi,%rax,4), %eax
	leal	-12800(%rdx), %ecx
	xorl	%esi, %esi
	cmpl	$12800, %edx                    ## imm = 0x3200
	setae	%sil
	cmovbl	%edx, %ecx
	orl	%eax, %esi
	leal	-6400(%rcx), %eax
	xorl	%edx, %edx
	cmpl	$6400, %ecx                     ## imm = 0x1900
	setae	%dl
	cmovbl	%ecx, %eax
	addl	%edx, %edx
	leal	(%rdx,%rsi,4), %ecx
	leal	-3200(%rax), %edx
	xorl	%esi, %esi
	cmpl	$3200, %eax                     ## imm = 0xC80
	setae	%sil
	cmovbl	%eax, %edx
	orl	%ecx, %esi
	leal	-1600(%rdx), %eax
	xorl	%ecx, %ecx
	cmpl	$1600, %edx                     ## imm = 0x640
	cmovbl	%edx, %eax
	setae	%cl
	addl	%ecx, %ecx
	leal	(%rcx,%rsi,4), %ecx
	leal	-800(%rax), %edx
	xorl	%esi, %esi
	cmpl	$800, %eax                      ## imm = 0x320
	cmovbl	%eax, %edx
	setae	%sil
	orl	%ecx, %esi
	leal	-400(%rdx), %eax
	xorl	%ecx, %ecx
	cmpl	$400, %edx                      ## imm = 0x190
	setae	%cl
	cmovbl	%edx, %eax
	addl	%ecx, %ecx
	leal	(%rcx,%rsi,4), %ecx
	leal	-200(%rax), %edx
	xorl	%esi, %esi
	cmpl	$200, %eax
	setae	%sil
	cmovbl	%eax, %edx
	orl	%ecx, %esi
	leal	-100(%rdx), %eax
	xorl	%ecx, %ecx
	cmpl	$100, %edx
	setae	%cl
	cmovbl	%edx, %eax
	addl	%ecx, %ecx
	leal	(%rcx,%rsi,4), %ecx
	leal	-50(%rax), %edx
	xorl	%esi, %esi
	cmpl	$50, %eax
	setae	%sil
	cmovbl	%eax, %edx
	orl	%ecx, %esi
	leal	-25(%rdx), %eax
	xorl	%ecx, %ecx
	cmpl	$25, %edx
	setae	%cl
	cmovbl	%edx, %eax
	addl	%ecx, %ecx
	leal	(%rcx,%rsi,4), %ecx
	xorl	%ebx, %ebx
	cmpl	$12, %eax
	setae	%bl
	orl	%ecx, %ebx
	jmp	LBB0_3
LBB0_2:
	addl	$450, %ebx                      ## imm = 0x1C2
	orl	$1048576, %ebx                  ## imm = 0x100000
LBB0_3:
	movq	16(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	16(%r14), %rdi
	incq	%rdi
	callq	_inb
	movl	%eax, %r15d
	movl	%ebx, %esi
	orl	$196608, %esi                   ## imm = 0x30000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	16(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	16(%r14), %rsi
	incq	%rsi
	movl	%r15d, %edi
	callq	_outb
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$3, %eax
	testb	$64, 12(%r14)
	je	LBB0_4
## %bb.5:
	movl	%ebx, %esi
	orl	$131072, %esi                   ## imm = 0x20000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	16(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	16(%r14), %rsi
	incq	%rsi
	movl	%r15d, %edi
	callq	_outb
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$2, %eax
	testb	$64, 12(%r14)
	je	LBB0_4
## %bb.6:
	movl	%ebx, %esi
	orl	$65536, %esi                    ## imm = 0x10000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	16(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	16(%r14), %rsi
	incq	%rsi
	movl	%r15d, %edi
	callq	_outb
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$1, %eax
	testb	$64, 12(%r14)
	je	LBB0_4
## %bb.7:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_cadet_settune
	movq	16(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	16(%r14), %rsi
	incq	%rsi
	movl	%r15d, %edi
	callq	_outb
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	xorl	%eax, %eax
	testb	$64, 12(%r14)
	jne	LBB0_8
LBB0_4:
	movq	_sigtable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r14), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movq	(%rcx,%rax,8), %rax
LBB0_8:
	movq	%rax, 24(%r14)
	movq	16(%r14), %rsi
	movl	$3, %edi
	callq	_outb
	movq	16(%r14), %rdi
	incq	%rdi
	callq	_inb
	andl	$127, %eax
	movq	16(%r14), %rsi
	incq	%rsi
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outb                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_bands,8,3                      ## @bands
	.comm	_sigtable,8,3                   ## @sigtable
	.no_dead_strip	_cadet_setfreq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cadet_setfreq
_cadet_setfreq:                         ; @cadet_setfreq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _bands@GOTPAGE
Lloh1:
	ldr	x9, [x9, _bands@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x10, [x0]
	add	x9, x9, x10, lsl #3
	ldp	w2, w1, [x9]
	mov	x0, x8
	bl	_clamp
	str	w0, [x19, #8]
	ldr	x9, [x19]
	lsr	w8, w0, #4
	cbz	x9, LBB0_2
; %bb.1:
	mov	w9, #25408
	movk	w9, #22, lsl #16
	mov	w10, #28672
	movk	w10, #65534, lsl #16
	cmp	w0, w9
	csel	w9, wzr, w10, lo
	mov	w10, #25407
	movk	w10, #22, lsl #16
	cmp	w0, w10
	cset	w10, hi
	mov	w11, #10700
	add	w8, w8, w9
	add	w8, w8, w11
	lsr	w9, w8, #11
	cmp	w9, #24
	cset	w11, hi
	bfi	w11, w10, #1, #1
	mov	w10, #-51200
	cmp	w9, #25
	csel	w9, wzr, w10, lo
	add	w8, w9, w8
	lsr	w9, w8, #10
	mov	w10, #-25600
	cmp	w9, #25
	csel	w10, wzr, w10, lo
	add	w8, w10, w8
	cmp	w9, #24
	cset	w9, hi
	lsl	w9, w9, #1
	bfi	w9, w11, #2, #2
	lsr	w10, w8, #9
	cmp	w10, #24
	cset	w11, hi
	orr	w9, w9, w11
	mov	w11, #-12800
	cmp	w10, #25
	csel	w10, wzr, w11, lo
	add	w8, w10, w8
	lsr	w10, w8, #8
	mov	w11, #-6400
	cmp	w10, #25
	csel	w11, wzr, w11, lo
	add	w8, w11, w8
	cmp	w10, #24
	cset	w10, hi
	lsl	w10, w10, #1
	bfi	w10, w9, #2, #30
	cmp	w8, #3199
	cset	w9, hi
	orr	w9, w10, w9
	mov	w10, #-3200
	cmp	w8, #3200
	csel	w10, wzr, w10, lo
	add	w8, w10, w8
	cmp	w8, #1599
	cset	w10, hi
	mov	w11, #-1600
	cmp	w8, #1600
	csel	w11, wzr, w11, lo
	add	w8, w11, w8
	lsl	w10, w10, #1
	bfi	w10, w9, #2, #30
	cmp	w8, #799
	cset	w9, hi
	orr	w9, w10, w9
	mov	w10, #-800
	cmp	w8, #800
	csel	w10, wzr, w10, lo
	add	w8, w10, w8
	cmp	w8, #399
	cset	w10, hi
	mov	w11, #-400
	cmp	w8, #400
	csel	w11, wzr, w11, lo
	add	w8, w11, w8
	lsl	w10, w10, #1
	bfi	w10, w9, #2, #30
	cmp	w8, #199
	cset	w9, hi
	orr	w9, w10, w9
	mov	w10, #-200
	cmp	w8, #200
	csel	w10, wzr, w10, lo
	add	w8, w10, w8
	cmp	w8, #99
	cset	w10, hi
	mov	w11, #-100
	cmp	w8, #100
	csel	w11, wzr, w11, lo
	add	w8, w11, w8
	lsl	w10, w10, #1
	bfi	w10, w9, #2, #30
	cmp	w8, #49
	cset	w9, hi
	orr	w9, w10, w9
	mov	w10, #-50
	cmp	w8, #50
	csel	w10, wzr, w10, lo
	add	w8, w10, w8
	cmp	w8, #24
	cset	w10, hi
	mov	w11, #-25
	cmp	w8, #25
	csel	w11, wzr, w11, lo
	add	w8, w11, w8
	lsl	w10, w10, #1
	bfi	w10, w9, #2, #30
	cmp	w8, #11
	cset	w8, hi
	orr	w20, w10, w8
	b	LBB0_3
LBB0_2:
	add	w8, w8, #450
	orr	w20, w8, #0x100000
LBB0_3:
	ldr	x1, [x19, #16]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #16]
	add	x0, x8, #1
	bl	_inb
	mov	x21, x0
	orr	w1, w20, #0x30000
	mov	x0, x19
	bl	_cadet_settune
	ldr	x1, [x19, #16]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #16]
	add	x1, x8, #1
	mov	x0, x21
	bl	_outb
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #12]
	tbnz	w8, #6, LBB0_5
; %bb.4:
	mov	w8, #3
	b	LBB0_10
LBB0_5:
	orr	w1, w20, #0x20000
	mov	x0, x19
	bl	_cadet_settune
	ldr	x1, [x19, #16]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #16]
	add	x1, x8, #1
	mov	x0, x21
	bl	_outb
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #12]
	tbnz	w8, #6, LBB0_7
; %bb.6:
	mov	w8, #2
	b	LBB0_10
LBB0_7:
	orr	w1, w20, #0x10000
	mov	x0, x19
	bl	_cadet_settune
	ldr	x1, [x19, #16]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #16]
	add	x1, x8, #1
	mov	x0, x21
	bl	_outb
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #12]
	tbnz	w8, #6, LBB0_9
; %bb.8:
	mov	w8, #1
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_cadet_settune
	ldr	x1, [x19, #16]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #16]
	add	x1, x8, #1
	mov	x0, x21
	bl	_outb
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	mov	x8, #0
	mov	x9, #0
	ldrb	w10, [x19, #12]
	tbnz	w10, #6, LBB0_11
LBB0_10:
Lloh3:
	adrp	x9, _sigtable@GOTPAGE
Lloh4:
	ldr	x9, [x9, _sigtable@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x10, [x19]
	ldr	x9, [x9, x10, lsl #3]
	ldr	x9, [x9, x8, lsl #3]
LBB0_11:
	str	x9, [x19, #24]
	ldr	x1, [x19, #16]
	mov	w0, #3
	bl	_outb
	ldr	x8, [x19, #16]
	add	x0, x8, #1
	bl	_inb
	and	w0, w0, #0x7f
	ldr	x8, [x19, #16]
	add	x1, x8, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_outb
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_bands,8,3                      ; @bands
	.comm	_sigtable,8,3                   ; @sigtable
	.no_dead_strip	_cadet_setfreq
.subsections_via_symbols
