	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pit_calibrate_tsc
_pit_calibrate_tsc:                     ## @pit_calibrate_tsc
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, %ebx
	movl	$97, %edi
	callq	_inb
                                        ## kill: def $eax killed $eax def $rax
	andl	$-4, %eax
	leal	1(%rax), %edi
	movl	$97, %esi
	callq	_outb
	movl	$176, %edi
	movl	$67, %esi
	callq	_outb
	movzbl	%bl, %edi
	movl	$66, %esi
	callq	_outb
	sarl	$8, %ebx
	movl	%ebx, %edi
	movl	$66, %esi
	callq	_outb
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_get_cycles
	movq	%rax, %rbx
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	$97, %edi
	callq	_inb
	testb	$32, %al
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_1
## %bb.2:
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_get_cycles
	movq	%rax, %r12
	subq	%rbx, %rax
	cmpq	%r14, %rax
	movl	%eax, %ecx
	cmovbq	%rcx, %r14
	cmpq	%r15, %rax
	cmovaq	%rcx, %r15
	incl	%r13d
	movl	$97, %edi
	callq	_inb
	movq	%r12, %rbx
	testb	$32, %al
	je	LBB0_3
## %bb.4:
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	jge	LBB0_5
	jmp	LBB0_6
LBB0_1:
	movq	%rbx, %r12
	xorl	%r15d, %r15d
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	jl	LBB0_6
LBB0_5:
	addq	%r14, %r14
	leaq	(%r14,%r14,4), %rax
	cmpq	%rax, %r15
	ja	LBB0_6
## %bb.7:
	subq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_do_div
	jmp	LBB0_8
LBB0_6:
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_8:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ULONG_MAX,8,3                  ## @ULONG_MAX
	.no_dead_strip	_pit_calibrate_tsc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pit_calibrate_tsc
_pit_calibrate_tsc:                     ; @pit_calibrate_tsc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	w0, #97
	bl	_inb
	and	w8, w0, #0xfffffffc
	orr	w0, w8, #0x1
	mov	w1, #97
	bl	_outb
	mov	w0, #176
	mov	w1, #67
	bl	_outb
	and	w0, w21, #0xff
	mov	w1, #66
	bl	_outb
	asr	w0, w21, #8
	mov	w1, #66
	bl	_outb
	bl	_get_cycles
	mov	x21, x0
Lloh0:
	adrp	x23, _ULONG_MAX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ULONG_MAX@GOTPAGEOFF]
	ldr	x24, [x23]
	mov	w0, #97
	bl	_inb
	tbnz	w0, #5, LBB0_4
; %bb.1:
	mov	w26, #0
	mov	x25, #0
	mov	x27, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_get_cycles
	mov	x22, x0
	sub	x8, x0, x27
	cmp	x8, x24
	and	x9, x8, #0xffffffff
	csel	x24, x9, x24, lo
	cmp	x8, x25
	csel	x25, x9, x25, hi
	add	w26, w26, #1
	mov	w0, #97
	bl	_inb
	mov	x27, x22
	tbz	w0, #5, LBB0_2
; %bb.3:
	cmp	w26, w20
	b.ge	LBB0_5
	b	LBB0_7
LBB0_4:
	mov	x25, #0
	mov	w26, #0
	mov	x22, x21
	cmp	w26, w20
	b.lt	LBB0_7
LBB0_5:
	add	x8, x24, x24, lsl #2
	lsl	x8, x8, #1
	cmp	x25, x8
	b.hi	LBB0_7
; %bb.6:
	sub	x20, x22, x21
	mov	x0, x20
	mov	x1, x19
	bl	_do_div
	b	LBB0_8
LBB0_7:
	ldr	x20, [x23]
LBB0_8:
	mov	x0, x20
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ULONG_MAX,8,3                  ; @ULONG_MAX
	.no_dead_strip	_pit_calibrate_tsc
.subsections_via_symbols
