	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analog_cooked_read
_analog_cooked_read:                    ## @analog_cooked_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rdi), %rbx
	movq	_ANALOG_LOOP_TIME@GOTPCREL(%rip), %rax
	movl	(%rdi), %ecx
	movl	4(%rdi), %edx
	imull	(%rax), %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	_ANALOG_MAX_TIME@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	callq	_local_irq_save
	movq	%rbx, %r13
	movq	%rbx, %rdi
	callq	_gameport_trigger
	callq	_GET_TIME
	callq	_local_irq_restore
	movb	8(%r14), %r12b
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r15d
	xorl	%eax, %eax
	callq	_local_irq_disable
	movq	%r13, %rdi
	callq	_gameport_read
	movl	%eax, %r12d
	andb	8(%r14), %r12b
	callq	_GET_TIME
	callq	_local_irq_restore
	xorb	%r12b, %r15b
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_DELTA
	cmpl	-80(%rbp), %eax                 ## 4-byte Folded Reload
	jae	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	%ebx, %rbx
	movb	%r15b, -72(%rbp,%rbx)
	incl	%ebx
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testb	%r12b, %r12b
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$3, %ebx
	jg	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_DELTA
	cmpl	-68(%rbp), %eax                 ## 4-byte Folded Reload
	jb	LBB0_1
LBB0_7:
	shlb	$4, %r12b
	testl	%ebx, %ebx
	jle	LBB0_18
## %bb.8:
	movl	%ebx, %r15d
	incq	%r15
	decl	%ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	orb	%r13b, %r12b
	decq	%r15
	decl	%ebx
	cmpq	$1, %r15
	jle	LBB0_18
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %ebx
	movzbl	-72(%rbp,%rbx), %r13d
	testb	$1, %r13b
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	testb	$2, %r13b
	jne	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	testb	$4, %r13b
	jne	LBB0_14
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	testb	$8, %r13b
	je	LBB0_17
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp,%rbx,4), %esi
	callq	_DELTA
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r14)
	movq	16(%r14), %rcx
	movl	%eax, (%rcx)
	testb	$2, %r13b
	je	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp,%rbx,4), %esi
	callq	_DELTA
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r14)
	movq	16(%r14), %rcx
	movl	%eax, 4(%rcx)
	testb	$4, %r13b
	je	LBB0_15
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp,%rbx,4), %esi
	callq	_DELTA
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r14)
	movq	16(%r14), %rcx
	movl	%eax, 8(%rcx)
	testb	$8, %r13b
	je	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp,%rbx,4), %esi
	callq	_DELTA
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r14)
	movq	16(%r14), %rcx
	movl	%eax, 12(%rcx)
	jmp	LBB0_17
LBB0_18:
	xorl	%eax, %eax
	cmpb	8(%r14), %r12b
	setne	%cl
	movq	___stack_chk_guard@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	-48(%rbp), %rdx
	jne	LBB0_20
## %bb.19:
	movb	%cl, %al
	negl	%eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ANALOG_LOOP_TIME,4,2           ## @ANALOG_LOOP_TIME
	.comm	_ANALOG_MAX_TIME,4,2            ## @ANALOG_MAX_TIME
	.comm	_ANALOG_FUZZ_BITS,4,2           ## @ANALOG_FUZZ_BITS
	.no_dead_strip	_analog_cooked_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function analog_cooked_read
_analog_cooked_read:                    ; @analog_cooked_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x20, [x0, #24]
Lloh3:
	adrp	x8, _ANALOG_LOOP_TIME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ANALOG_LOOP_TIME@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldp	w9, w10, [x0]
	mul	w8, w9, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
Lloh6:
	adrp	x8, _ANALOG_MAX_TIME@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ANALOG_MAX_TIME@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w22, w10, w8
	bl	_local_irq_save
	mov	x0, x20
	bl	_gameport_trigger
	bl	_GET_TIME
	bl	_local_irq_restore
	mov	w23, #0
	ldrb	w26, [x19, #8]
	add	x24, sp, #4
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_local_irq_disable
	mov	x0, x20
	bl	_gameport_read
	ldrb	w8, [x19, #8]
	and	w25, w8, w0
	bl	_GET_TIME
	bl	_local_irq_restore
	eor	w26, w25, w26
	tst	w26, #0xff
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_DELTA
	cmp	w0, w21
	b.hs	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	strb	w26, [x24, w23, sxtw]
	add	w23, w23, #1
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w25, #0
	ccmp	w23, #3, #0, ne
	b.gt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_DELTA
	mov	x26, x25
	cmp	w0, w22
	b.lo	LBB0_1
LBB0_6:
	lsl	w20, w25, #4
	subs	w8, w23, #1
	b.lt	LBB0_17
; %bb.7:
	mov	w9, w23
	add	x21, x9, #1
	add	x22, sp, #4
	add	x23, sp, #8
Lloh9:
	adrp	x24, _ANALOG_FUZZ_BITS@GOTPAGE
Lloh10:
	ldr	x24, [x24, _ANALOG_FUZZ_BITS@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	orr	w20, w26, w20
	sub	x21, x21, #1
	sub	w8, w25, #1
	cmp	x21, #1
	b.le	LBB0_17
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	w25, w8
	ldrb	w26, [x22, x25]
	tbnz	w26, #0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	tbnz	w26, #1, LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	tbnz	w26, #2, LBB0_15
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	tbz	w26, #3, LBB0_8
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23, x25, lsl #2]
	bl	_DELTA
	ldr	w8, [x24]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9]
	tbz	w26, #1, LBB0_11
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23, x25, lsl #2]
	bl	_DELTA
	ldr	w8, [x24]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9, #4]
	tbz	w26, #2, LBB0_12
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23, x25, lsl #2]
	bl	_DELTA
	ldr	w8, [x24]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9, #8]
	tbz	w26, #3, LBB0_8
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23, x25, lsl #2]
	bl	_DELTA
	ldr	w8, [x24]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9, #12]
	b	LBB0_8
LBB0_17:
	ldrb	w8, [x19, #8]
	cmp	w8, w20, uxtb
	csetm	w0, ne
	ldr	x8, [sp, #24]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ANALOG_LOOP_TIME,4,2           ; @ANALOG_LOOP_TIME
	.comm	_ANALOG_MAX_TIME,4,2            ; @ANALOG_MAX_TIME
	.comm	_ANALOG_FUZZ_BITS,4,2           ; @ANALOG_FUZZ_BITS
	.no_dead_strip	_analog_cooked_read
.subsections_via_symbols
