	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_compute_finetune               ## -- Begin function compute_finetune
	.p2align	4, 0x90
_compute_finetune:                      ## @compute_finetune
	.cfi_startproc
## %bb.0:
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %rax
	testl	%esi, %esi
	je	LBB0_14
## %bb.1:
	testl	%edx, %edx
	je	LBB0_14
## %bb.2:
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	cmpl	$8192, %edx                     ## imm = 0x2000
	movl	$8192, %edi                     ## imm = 0x2000
	cmovll	%edx, %edi
	imull	%edi, %esi
	leal	8191(%rsi), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	sarl	$13, %edx
	addl	%ecx, %edx
	je	LBB0_14
## %bb.5:
	movl	%edx, %esi
	negl	%esi
	cmovsl	%edx, %esi
	cmpl	%edi, %esi
	cmovgel	%edi, %esi
	movl	$1, %ecx
	cmpl	$2400, %esi                     ## imm = 0x960
	jl	LBB0_6
## %bb.7:
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	shll	$2, %ecx
	leal	-2400(%rsi), %edi
	cmpl	$4799, %esi                     ## imm = 0x12BF
	movl	%edi, %esi
	ja	LBB0_8
	jmp	LBB0_9
LBB0_3:
	xorl	%eax, %eax
	retq
LBB0_6:
	movl	%esi, %edi
LBB0_9:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movslq	%edi, %r8
	imulq	$1374389535, %r8, %rdi          ## imm = 0x51EB851F
	movq	%rdi, %rsi
	shrq	$63, %rsi
	sarq	$37, %rdi
	addl	%esi, %edi
	imull	$100, %edi, %esi
	subl	%esi, %r8d
	movq	_semitone_tuning@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movslq	%edi, %rdi
	imull	(%rsi,%rdi,4), %ecx
	movq	_cent_tuning@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movslq	%r8d, %rdi
	imull	(%rsi,%rdi,4), %ecx
	movslq	%ecx, %rcx
	imulq	$1759218605, %rcx, %rsi         ## imm = 0x68DB8BAD
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$44, %rsi
	addl	%ecx, %esi
	movslq	%esi, %rcx
	testl	%edx, %edx
	popq	%rbp
	js	LBB0_10
## %bb.13:
	imulq	%rax, %rcx
	movabsq	$3777893186295716171, %rdx      ## imm = 0x346DC5D63886594B
	movq	%rcx, %rax
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$11, %rax
LBB0_14:
	retq
LBB0_10:
	imulq	$10000, %rax, %rax              ## imm = 0x2710
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_11
## %bb.12:
	xorl	%edx, %edx
	divq	%rcx
	retq
LBB0_11:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_semitone_tuning,8,3            ## @semitone_tuning
	.comm	_cent_tuning,8,3                ## @cent_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_compute_finetune               ; -- Begin function compute_finetune
	.p2align	2
_compute_finetune:                      ; @compute_finetune
	.cfi_startproc
; %bb.0:
	cbz	w1, LBB0_9
; %bb.1:
	cbz	w2, LBB0_9
; %bb.2:
	cbz	x0, LBB0_9
; %bb.3:
	mov	w8, #8192
	cmp	w2, #2, lsl #12                 ; =8192
	csel	w9, w2, w8, lt
	mul	w8, w9, w1
	mov	w10, #8191
	add	w10, w8, w10
	cmp	w8, #0
	csel	w8, w10, w8, lt
	adds	w8, w3, w8, asr #13
	b.eq	LBB0_9
; %bb.4:
	cmp	w8, #0
	cneg	w10, w8, mi
	cmp	w10, w9
	csel	w10, w10, w9, lt
	mov	w9, #1
	cmp	w10, #2400
	b.lt	LBB0_7
; %bb.5:
	mov	x11, x10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w9, w9, #2
	sub	w10, w11, #2400
	lsr	w12, w11, #6
	mov	x11, x10
	cmp	w12, #74
	b.hi	LBB0_6
LBB0_7:
	mov	w11, #34079
	movk	w11, #20971, lsl #16
	smull	x11, w10, w11
	lsr	x12, x11, #63
	asr	x11, x11, #37
	add	w11, w11, w12
	mov	w12, #100
	msub	w10, w11, w12, w10
Lloh0:
	adrp	x12, _semitone_tuning@GOTPAGE
Lloh1:
	ldr	x12, [x12, _semitone_tuning@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x12]
	ldr	w11, [x12, w11, sxtw #2]
	mul	w9, w11, w9
Lloh3:
	adrp	x11, _cent_tuning@GOTPAGE
Lloh4:
	ldr	x11, [x11, _cent_tuning@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	ldr	w10, [x11, w10, sxtw #2]
	mul	w9, w9, w10
	mov	w10, #35757
	movk	w10, #26843, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #44
	add	w9, w9, w10
	sxtw	x9, w9
	tbnz	w8, #31, LBB0_10
; %bb.8:
	mul	x8, x9, x0
	mov	x9, #22859
	movk	x9, #14470, lsl #16
	movk	x9, #50646, lsl #32
	movk	x9, #13421, lsl #48
	umulh	x8, x8, x9
	lsr	x0, x8, #11
LBB0_9:
	ret
LBB0_10:
	mov	w8, #10000
	mul	x8, x0, x8
	udiv	x0, x8, x9
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_semitone_tuning,8,3            ; @semitone_tuning
	.comm	_cent_tuning,8,3                ; @cent_tuning
.subsections_via_symbols
