	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ess_common_speed
_ess_common_speed:                      ## @ess_common_speed
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	movq	%rsi, %r9
	movl	$0, -16(%rbp)
	cmpq	$0, 16(%rdi)
	je	LBB0_6
## %bb.1:
	movq	(%rdi), %rax
	movq	_SUBMDL_ES1888@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	leaq	-16(%rbp), %rcx
	movl	$795500, %edi                   ## imm = 0xC236C
LBB0_3:
	movl	$256, %esi                      ## imm = 0x100
	jmp	LBB0_4
LBB0_6:
	movq	_SB_CAP_ES18XX_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rdi)
	je	LBB0_11
## %bb.7:
	movq	(%rdi), %rax
	movq	_SUBMDL_ES1888@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	leaq	-12(%rbp), %r8
	movl	$397700, %edi                   ## imm = 0x61184
	movl	$128, %esi
	movl	$795500, %edx                   ## imm = 0xC236C
	jmp	LBB0_9
LBB0_5:
	leaq	-16(%rbp), %rcx
	movl	$795500, %edi                   ## imm = 0xC236C
	movl	$128, %esi
LBB0_4:
	movq	%r9, %rdx
	callq	_ess_calc_div
	orl	$128, %eax
LBB0_14:
	movl	%eax, -12(%rbp)
	jmp	LBB0_15
LBB0_11:
	cmpl	$22001, (%r9)                   ## imm = 0x55F1
	jl	LBB0_13
## %bb.12:
	movq	_ES1688_CLOCK1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-16(%rbp), %rcx
	jmp	LBB0_3
LBB0_10:
	movq	_ES18XX_CLOCK1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ES18XX_CLOCK2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-12(%rbp), %r8
	movl	$128, %esi
LBB0_9:
	movl	$256, %ecx                      ## imm = 0x100
	callq	_ess_calc_best_speed
LBB0_15:
	movl	-12(%rbp), %eax
	movl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_13:
	movq	_ES1688_CLOCK2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-16(%rbp), %rcx
	movl	$128, %esi
	movq	%r9, %rdx
	callq	_ess_calc_div
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_SUBMDL_ES1888,8,3              ## @SUBMDL_ES1888
	.comm	_SB_CAP_ES18XX_RATE,4,2         ## @SB_CAP_ES18XX_RATE
	.comm	_ES18XX_CLOCK1,4,2              ## @ES18XX_CLOCK1
	.comm	_ES18XX_CLOCK2,4,2              ## @ES18XX_CLOCK2
	.comm	_ES1688_CLOCK1,4,2              ## @ES1688_CLOCK1
	.comm	_ES1688_CLOCK2,4,2              ## @ES1688_CLOCK2
	.no_dead_strip	_ess_common_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ess_common_speed
_ess_common_speed:                      ; @ess_common_speed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x2
	mov	x5, x1
	str	wzr, [sp, #12]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _SUBMDL_ES1888@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SUBMDL_ES1888@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x3, sp, #12
	mov	w0, #9068
	movk	w0, #12, lsl #16
	cmp	x8, x9
	b.ne	LBB0_6
LBB0_2:
	mov	w1, #256
	b	LBB0_7
LBB0_3:
	ldr	w8, [x0, #8]
Lloh3:
	adrp	x9, _SB_CAP_ES18XX_RATE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SB_CAP_ES18XX_RATE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.4:
	ldr	x8, [x0]
Lloh6:
	adrp	x9, _SUBMDL_ES1888@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SUBMDL_ES1888@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.5:
	add	x4, sp, #8
	mov	w0, #4484
	movk	w0, #6, lsl #16
	mov	w1, #128
	mov	w2, #9068
	movk	w2, #12, lsl #16
	b	LBB0_11
LBB0_6:
	mov	w1, #128
LBB0_7:
	mov	x2, x5
	bl	_ess_calc_div
	orr	w8, w0, #0x80
	str	w8, [sp, #8]
	b	LBB0_13
LBB0_8:
	ldr	w8, [x5]
	mov	w9, #22001
	cmp	w8, w9
	b.lt	LBB0_12
; %bb.9:
Lloh9:
	adrp	x8, _ES1688_CLOCK1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ES1688_CLOCK1@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	add	x3, sp, #12
	b	LBB0_2
LBB0_10:
Lloh12:
	adrp	x8, _ES18XX_CLOCK1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ES18XX_CLOCK1@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _ES18XX_CLOCK2@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ES18XX_CLOCK2@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x4, sp, #8
	mov	w1, #128
LBB0_11:
	mov	w3, #256
	bl	_ess_calc_best_speed
	b	LBB0_13
LBB0_12:
Lloh18:
	adrp	x8, _ES1688_CLOCK2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ES1688_CLOCK2@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	add	x3, sp, #12
	mov	w1, #128
	mov	x2, x5
	bl	_ess_calc_div
	str	w0, [sp, #8]
LBB0_13:
	ldr	w8, [sp, #8]
	str	w8, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SUBMDL_ES1888,8,3              ; @SUBMDL_ES1888
	.comm	_SB_CAP_ES18XX_RATE,4,2         ; @SB_CAP_ES18XX_RATE
	.comm	_ES18XX_CLOCK1,4,2              ; @ES18XX_CLOCK1
	.comm	_ES18XX_CLOCK2,4,2              ; @ES18XX_CLOCK2
	.comm	_ES1688_CLOCK1,4,2              ; @ES1688_CLOCK1
	.comm	_ES1688_CLOCK2,4,2              ; @ES1688_CLOCK2
	.no_dead_strip	_ess_common_speed
.subsections_via_symbols
