	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function detect_pll_input_clock
_detect_pll_input_clock:                ## @detect_pll_input_clock
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_read_counter
	movq	%rax, %r14
	leaq	-56(%rbp), %rdi
	callq	_do_gettimeofday
	leaq	1(%r15), %r13
	movl	$1, %edi
	movq	%r13, %rsi
	callq	_outb
	leaq	3(%r15), %r12
	movq	%r12, %rdi
	callq	_inb
	movslq	%eax, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_DBG
	orl	$64, %ebx
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_outb
	movl	$10, %edi
	callq	_mdelay
	movq	%r15, %rdi
	callq	_read_counter
	movq	%rax, %r15
	leaq	-48(%rbp), %rdi
	callq	_do_gettimeofday
	movl	$1, %edi
	movq	%r13, %rsi
	callq	_outb
	movq	%r12, %rdi
	callq	_inb
	movslq	%eax, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_DBG
	andl	$-65, %ebx
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_outb
	movq	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movq	-56(%rbp), %xmm1                ## xmm1 = mem[0],zero
	psubd	%xmm1, %xmm0
	movd	%xmm0, %eax
	pextrd	$1, %xmm0, %ecx
	imull	$1000000, %eax, %eax            ## imm = 0xF4240
	addl	%eax, %ecx
	movl	%r14d, %eax
	subl	%r15d, %eax
	andl	$1073741822, %eax               ## imm = 0x3FFFFFFE
	movl	$3435973837, %esi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rsi
	shrq	$35, %rsi
	movl	$10000000, %eax                 ## imm = 0x989680
	xorl	%edx, %edx
	idivl	%ecx
	movslq	%eax, %rbx
	imulq	%rsi, %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_DBG
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scr1[%02X]\n"

L_.str.1:                               ## @.str.1
	.asciz	"start[%ld] end[%ld]\n"

	.no_dead_strip	_detect_pll_input_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function detect_pll_input_clock
_detect_pll_input_clock:                ; @detect_pll_input_clock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_read_counter
	mov	x19, x0
	add	x0, sp, #24
	bl	_do_gettimeofday
	add	x21, x20, #1
	mov	w0, #1
	mov	x1, x21
	bl	_outb
	add	x22, x20, #3
	mov	x0, x22
	bl	_inb
	mov	x23, x0
	sxtw	x1, w23
Lloh0:
	adrp	x24, l_.str@PAGE
Lloh1:
	add	x24, x24, l_.str@PAGEOFF
	mov	x0, x24
	bl	_DBG
	orr	w0, w23, #0x40
	mov	x1, x22
	bl	_outb
	mov	w0, #10
	bl	_mdelay
	mov	x0, x20
	bl	_read_counter
	mov	x20, x0
	add	x0, sp, #16
	bl	_do_gettimeofday
	mov	w0, #1
	mov	x1, x21
	bl	_outb
	mov	x0, x22
	bl	_inb
	mov	x21, x0
	sxtw	x1, w21
	mov	x0, x24
	bl	_DBG
	and	w0, w21, #0xffffffbf
	mov	x1, x22
	bl	_outb
	ldp	w8, w9, [sp, #16]
	ldp	w10, w11, [sp, #24]
	sub	w8, w8, w10
	mov	w10, #16960
	movk	w10, #15, lsl #16
	sub	w9, w9, w11
	madd	w8, w8, w10, w9
	sub	w9, w19, w20
	and	w9, w9, #0x3ffffffe
	mov	w10, #52429
	movk	w10, #52428, lsl #16
	umull	x9, w9, w10
	lsr	x9, x9, #35
	mov	w10, #38528
	movk	w10, #152, lsl #16
	sdiv	w8, w10, w8
	sxtw	x8, w8
	mul	x21, x8, x9
	str	x20, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_DBG
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scr1[%02X]\n"

l_.str.1:                               ; @.str.1
	.asciz	"start[%ld] end[%ld]\n"

	.no_dead_strip	_detect_pll_input_clock
.subsections_via_symbols
