	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i8254_delay                    ## -- Begin function i8254_delay
	.p2align	4, 0x90
_i8254_delay:                           ## @i8254_delay
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	xorl	%eax, %eax
	callq	_getit
	testl	%r14d, %r14d
	jle	LBB0_8
## %bb.1:
	movl	%eax, %ebx
	cmpl	$255, %r14d
	ja	LBB0_3
## %bb.2:
	imull	$39099, %r14d, %r14d            ## imm = 0x98BB
	addl	$32767, %r14d                   ## imm = 0x7FFF
	shrl	$15, %r14d
	jmp	LBB0_4
LBB0_3:
	movl	%r14d, %eax
	movq	_i8254_freq@GOTPCREL(%rip), %rcx
	imulq	(%rcx), %rax
	addq	$999999, %rax                   ## imm = 0xF423F
	movabsq	$4835703278458516699, %rcx      ## imm = 0x431BDE82D7B634DB
	imulq	%rcx
	movq	%rdx, %r14
	movq	%rdx, %rax
	shrq	$63, %rax
	shrq	$18, %r14
	addl	%eax, %r14d
	testl	%r14d, %r14d
	jle	LBB0_8
LBB0_4:
	movq	_i8254_max_count@GOTPCREL(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	testl	%ebx, %ebx
	cmovnsl	%ebx, %ecx
	movl	%eax, %ebx
	subl	%ecx, %r14d
	jle	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_getit
	subl	%eax, %ebx
	movl	(%r15), %ecx
	addl	%ebx, %ecx
	testl	%ecx, %ecx
	jg	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%ecx, %ecx
	jmp	LBB0_7
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i8254_freq,8,3                 ## @i8254_freq
	.comm	_i8254_max_count,4,2            ## @i8254_max_count
	.comm	_kdb_active,8,3                 ## @kdb_active
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i8254_delay                    ; -- Begin function i8254_delay
	.p2align	2
_i8254_delay:                           ; @i8254_delay
	.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	x20, x0
	bl	_getit
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x19, x0
	cmp	w20, #255
	b.hi	LBB0_3
; %bb.2:
	mov	w8, #39099
	mov	w9, #32767
	madd	w8, w20, w8, w9
	lsr	w20, w8, #15
	b	LBB0_4
LBB0_3:
	mov	w8, w20
Lloh0:
	adrp	x9, _i8254_freq@GOTPAGE
Lloh1:
	ldr	x9, [x9, _i8254_freq@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	w10, #16959
	movk	w10, #15, lsl #16
	madd	x8, x9, x8, x10
	add	x9, x10, #1
	sdiv	x20, x8, x9
	cmp	w20, #1
	b.lt	LBB0_6
LBB0_4:
Lloh3:
	adrp	x21, _i8254_max_count@GOTPAGE
Lloh4:
	ldr	x21, [x21, _i8254_max_count@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	bl	_getit
	ldr	w8, [x21]
	sub	w9, w19, w0
	add	w8, w9, w8
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	cmp	w9, #0
	csel	w8, w8, w9, lt
	sub	w20, w20, w8
	mov	x19, x0
	cmp	w20, #0
	b.gt	LBB0_5
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_i8254_freq,8,3                 ; @i8254_freq
	.comm	_i8254_max_count,4,2            ; @i8254_max_count
	.comm	_kdb_active,8,3                 ; @kdb_active
.subsections_via_symbols
