	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	(%rdi), %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	imull	$1000, %ebx, %ecx               ## imm = 0x3E8
	movl	%ecx, %edx
	shrl	$4, %edx
	leal	-102400(%rdx), %esi
	xorl	%edi, %edi
	cmpl	$1467200, %ecx                  ## imm = 0x166340
	setae	%dil
	cmovbl	%edx, %esi
	leal	10700(%rsi), %ecx
	addl	$-40500, %esi                   ## imm = 0xFFFF61CC
	xorl	%edx, %edx
	cmpl	$51200, %ecx                    ## imm = 0xC800
	setae	%dl
	leal	(%rdx,%rdi,2), %edx
	cmovbl	%ecx, %esi
	leal	-25600(%rsi), %ecx
	xorl	%edi, %edi
	cmpl	$25600, %esi                    ## imm = 0x6400
	setae	%dil
	cmovbl	%esi, %ecx
	addl	%edi, %edi
	leal	(%rdi,%rdx,4), %edx
	leal	-12800(%rcx), %esi
	xorl	%edi, %edi
	cmpl	$12800, %ecx                    ## imm = 0x3200
	setae	%dil
	cmovbl	%ecx, %esi
	orl	%edx, %edi
	leal	-6400(%rsi), %ecx
	xorl	%edx, %edx
	cmpl	$6400, %esi                     ## imm = 0x1900
	setae	%dl
	cmovbl	%esi, %ecx
	addl	%edx, %edx
	leal	(%rdx,%rdi,4), %edx
	leal	-3200(%rcx), %esi
	xorl	%edi, %edi
	cmpl	$3200, %ecx                     ## imm = 0xC80
	setae	%dil
	cmovbl	%ecx, %esi
	orl	%edx, %edi
	leal	-1600(%rsi), %ecx
	xorl	%edx, %edx
	cmpl	$1600, %esi                     ## imm = 0x640
	setae	%dl
	cmovbl	%esi, %ecx
	addl	%edx, %edx
	leal	(%rdx,%rdi,4), %edx
	leal	-800(%rcx), %esi
	xorl	%edi, %edi
	cmpl	$800, %ecx                      ## imm = 0x320
	setae	%dil
	cmovbl	%ecx, %esi
	orl	%edx, %edi
	leal	-400(%rsi), %ecx
	xorl	%edx, %edx
	cmpl	$400, %esi                      ## imm = 0x190
	cmovbl	%esi, %ecx
	setae	%dl
	addl	%edx, %edx
	leal	(%rdx,%rdi,4), %edx
	leal	-200(%rcx), %esi
	xorl	%edi, %edi
	cmpl	$200, %ecx
	cmovbl	%ecx, %esi
	setae	%dil
	orl	%edx, %edi
	leal	-100(%rsi), %ecx
	xorl	%edx, %edx
	cmpl	$100, %esi
	setae	%dl
	cmovbl	%esi, %ecx
	addl	%edx, %edx
	leal	(%rdx,%rdi,4), %edx
	leal	-50(%rcx), %esi
	xorl	%edi, %edi
	cmpl	$50, %ecx
	setae	%dil
	cmovbl	%ecx, %esi
	orl	%edx, %edi
	leal	-25(%rsi), %edx
	xorl	%ecx, %ecx
	cmpl	$25, %esi
	setae	%cl
	cmovbl	%esi, %edx
	addl	%ecx, %ecx
	leal	(%rcx,%rdi,4), %esi
	leal	-12(%rdx), %ebx
	xorl	%ecx, %ecx
	cmpl	$12, %edx
	setae	%cl
	cmovbl	%edx, %ebx
	orl	%esi, %ecx
LBB0_2:
	shrl	$4, %ebx
	addl	$2010, %ebx                     ## imm = 0x7DA
	orl	$1048576, %ebx                  ## imm = 0x100000
	cmpl	$1, %eax
	cmovnel	%ecx, %ebx
	leaq	16(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	24(%r14), %rdi
	incq	%rdi
	callq	_inb
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %esi
	orl	$196608, %esi                   ## imm = 0x30000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	24(%r14), %rsi
	incq	%rsi
	movl	%r12d, %edi
	callq	_outb
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$3, %eax
	testb	$64, 4(%r14)
	je	LBB0_3
## %bb.4:
	movl	%ebx, %esi
	orl	$131072, %esi                   ## imm = 0x20000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	24(%r14), %rsi
	incq	%rsi
	movl	%r12d, %edi
	callq	_outb
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$2, %eax
	testb	$64, 4(%r14)
	je	LBB0_3
## %bb.5:
	movl	%ebx, %esi
	orl	$65536, %esi                    ## imm = 0x10000
	movq	%r14, %rdi
	callq	_cadet_settune
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	24(%r14), %rsi
	incq	%rsi
	movl	%r12d, %edi
	callq	_outb
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	movl	$1, %eax
	testb	$64, 4(%r14)
	je	LBB0_3
## %bb.6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_cadet_settune
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r14), %rsi
	movl	$7, %edi
	callq	_outb
	movq	24(%r14), %rsi
	incq	%rsi
	movl	%r12d, %edi
	callq	_outb
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	$100, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_cadet_gettune
	xorl	%eax, %eax
	testb	$64, 4(%r14)
	jne	LBB0_7
LBB0_3:
	movq	_sigtable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	(%r14), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movq	(%rcx,%rax,8), %rax
LBB0_7:
	movq	%rax, 8(%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w9, #0
	b	LBB0_3
LBB0_2:
	mov	w9, #1000
	mul	w9, w1, w9
	mov	w10, #25407
	movk	w10, #22, lsl #16
	cmp	w9, w10
	cset	w10, hi
	mov	w11, #25408
	movk	w11, #22, lsl #16
	mov	w12, #28672
	movk	w12, #65534, lsl #16
	cmp	w9, w11
	csel	w11, wzr, w12, lo
	add	w9, w11, w9, lsr #4
	mov	w11, #10700
	add	w9, w9, w11
	lsr	w11, w9, #11
	cmp	w11, #24
	cset	w12, hi
	bfi	w12, w10, #1, #1
	mov	w10, #-51200
	cmp	w11, #25
	csel	w10, wzr, w10, lo
	add	w9, w10, w9
	lsr	w10, w9, #10
	mov	w11, #-25600
	cmp	w10, #25
	csel	w11, wzr, w11, lo
	add	w9, w11, w9
	cmp	w10, #24
	cset	w10, hi
	lsl	w10, w10, #1
	bfi	w10, w12, #2, #2
	lsr	w11, w9, #9
	cmp	w11, #24
	cset	w12, hi
	orr	w10, w10, w12
	mov	w12, #-12800
	cmp	w11, #25
	csel	w11, wzr, w12, lo
	add	w9, w11, w9
	lsr	w11, w9, #8
	mov	w12, #-6400
	cmp	w11, #25
	csel	w12, wzr, w12, lo
	add	w9, w12, w9
	cmp	w11, #24
	cset	w11, hi
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w9, #3199
	cset	w10, hi
	orr	w10, w11, w10
	mov	w11, #-3200
	cmp	w9, #3200
	csel	w11, wzr, w11, lo
	add	w9, w11, w9
	cmp	w9, #1599
	cset	w11, hi
	mov	w12, #-1600
	cmp	w9, #1600
	csel	w12, wzr, w12, lo
	add	w9, w12, w9
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w9, #799
	cset	w10, hi
	orr	w10, w11, w10
	mov	w11, #-800
	cmp	w9, #800
	csel	w11, wzr, w11, lo
	add	w9, w11, w9
	cmp	w9, #399
	cset	w11, hi
	mov	w12, #-400
	cmp	w9, #400
	csel	w12, wzr, w12, lo
	add	w9, w12, w9
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w9, #199
	cset	w10, hi
	orr	w10, w11, w10
	mov	w11, #-200
	cmp	w9, #200
	csel	w11, wzr, w11, lo
	add	w9, w11, w9
	cmp	w9, #99
	cset	w11, hi
	mov	w12, #-100
	cmp	w9, #100
	csel	w12, wzr, w12, lo
	add	w9, w12, w9
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w9, #49
	cset	w10, hi
	orr	w10, w11, w10
	mov	w11, #-50
	cmp	w9, #50
	csel	w11, wzr, w11, lo
	add	w9, w11, w9
	cmp	w9, #24
	cset	w11, hi
	mov	w12, #-25
	cmp	w9, #25
	csel	w12, wzr, w12, lo
	add	w12, w12, w9
	lsl	w9, w11, #1
	bfi	w9, w10, #2, #30
	cmp	w12, #11
	cset	w10, hi
	orr	w9, w9, w10
	mov	w10, #-12
	cmp	w12, #12
	csel	w10, wzr, w10, lo
	add	w1, w10, w12
LBB0_3:
	lsr	w10, w1, #4
	add	w10, w10, #2010
	orr	w10, w10, #0x100000
	cmp	w8, #1
	csel	w21, w10, w9, eq
	add	x20, x19, #16
	mov	x0, x20
	bl	_mutex_lock
	ldr	x1, [x19, #24]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #24]
	add	x0, x8, #1
	bl	_inb
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_unlock
	orr	w1, w21, #0x30000
	mov	x0, x19
	bl	_cadet_settune
	mov	x0, x20
	bl	_mutex_lock
	ldr	x1, [x19, #24]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #24]
	add	x1, x8, #1
	mov	x0, x22
	bl	_outb
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #4]
	tbnz	w8, #6, LBB0_5
; %bb.4:
	mov	w8, #3
	b	LBB0_10
LBB0_5:
	orr	w1, w21, #0x20000
	mov	x0, x19
	bl	_cadet_settune
	mov	x0, x20
	bl	_mutex_lock
	ldr	x1, [x19, #24]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #24]
	add	x1, x8, #1
	mov	x0, x22
	bl	_outb
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #4]
	tbnz	w8, #6, LBB0_7
; %bb.6:
	mov	w8, #2
	b	LBB0_10
LBB0_7:
	orr	w1, w21, #0x10000
	mov	x0, x19
	bl	_cadet_settune
	mov	x0, x20
	bl	_mutex_lock
	ldr	x1, [x19, #24]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #24]
	add	x1, x8, #1
	mov	x0, x22
	bl	_outb
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	ldrb	w8, [x19, #4]
	tbnz	w8, #6, LBB0_9
; %bb.8:
	mov	w8, #1
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	mov	x1, x21
	bl	_cadet_settune
	mov	x0, x20
	bl	_mutex_lock
	ldr	x1, [x19, #24]
	mov	w0, #7
	bl	_outb
	ldr	x8, [x19, #24]
	add	x1, x8, #1
	mov	x0, x22
	bl	_outb
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #100
	bl	_msleep
	mov	x0, x19
	bl	_cadet_gettune
	mov	x8, #0
	mov	x9, #0
	ldrb	w10, [x19, #4]
	tbnz	w10, #6, LBB0_11
LBB0_10:
Lloh0:
	adrp	x9, _sigtable@GOTPAGE
Lloh1:
	ldr	x9, [x9, _sigtable@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldrsw	x10, [x19]
	ldr	x9, [x9, x10, lsl #3]
	ldr	x9, [x9, x8, lsl #3]
LBB0_11:
	str	x9, [x19, #8]
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_sigtable,8,3                   ; @sigtable
	.no_dead_strip	_cadet_setfreq
.subsections_via_symbols
