	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rdi), %r14
	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, -96(%rbp)                 ## 8-byte Spill
	movq	_ANALOG_MAX_TIME@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	movl	%edx, -84(%rbp)                 ## 4-byte Spill
	callq	_local_irq_save
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	callq	_gameport_trigger
	xorl	%eax, %eax
	callq	_get_time
	movl	%eax, %r13d
	callq	_local_irq_restore
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movb	8(%rbx), %bl
	movl	%r13d, -68(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %r15d
	xorl	%eax, %eax
	callq	_local_irq_disable
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	callq	_gameport_read
	movl	%eax, %ebx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	andb	8(%rax), %bl
	xorl	%eax, %eax
	callq	_get_time
	movl	%eax, %r12d
	callq	_local_irq_restore
	xorb	%bl, %r15b
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_delta
	cmpl	-96(%rbp), %eax                 ## 4-byte Folded Reload
	jae	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	%r14d, %r14
	movb	%r15b, -88(%rbp,%r14)
	movl	%r12d, -64(%rbp,%r14,4)
	incl	%r14d
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testb	%bl, %bl
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$3, %r14d
	jg	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	callq	_delta
	movl	%r12d, %r13d
	cmpl	-84(%rbp), %eax                 ## 4-byte Folded Reload
	jb	LBB0_1
LBB0_7:
	shlb	$4, %bl
	testl	%r14d, %r14d
	jle	LBB0_8
## %bb.9:
	movl	%r14d, %r12d
	incq	%r12
	decl	%r14d
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	orb	%r13b, %bl
	decq	%r12
	decl	%r14d
	cmpq	$1, %r12
	jle	LBB0_19
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %r14d
	movzbl	-88(%rbp,%r14), %r13d
	testb	$1, %r13b
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	testb	$2, %r13b
	jne	LBB0_13
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	testb	$4, %r13b
	jne	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	testb	$8, %r13b
	je	LBB0_18
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-64(%rbp,%r14,4), %esi
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_delta
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r15)
	movq	16(%r15), %rcx
	movl	%eax, (%rcx)
	testb	$2, %r13b
	je	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-64(%rbp,%r14,4), %esi
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_delta
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r15)
	movq	16(%r15), %rcx
	movl	%eax, 4(%rcx)
	testb	$4, %r13b
	je	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-64(%rbp,%r14,4), %esi
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_delta
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r15)
	movq	16(%r15), %rcx
	movl	%eax, 8(%rcx)
	testb	$8, %r13b
	je	LBB0_18
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-64(%rbp,%r14,4), %esi
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_delta
	movq	_ANALOG_FUZZ_BITS@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	xorl	%edx, %edx
	divl	(%r15)
	movq	16(%r15), %rcx
	movl	%eax, 12(%rcx)
	jmp	LBB0_18
LBB0_8:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
LBB0_19:
	xorl	%eax, %eax
	cmpb	8(%r15), %bl
	setne	%cl
	movq	___stack_chk_guard@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	-48(%rbp), %rdx
	jne	LBB0_21
## %bb.20:
	movb	%cl, %al
	negl	%eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	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, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	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	x21, [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	w24, w8, w9
Lloh6:
	adrp	x8, _ANALOG_MAX_TIME@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ANALOG_MAX_TIME@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w25, w10, w8
	bl	_local_irq_save
	mov	x0, x21
	bl	_gameport_trigger
	bl	_get_time
	mov	x20, x0
	bl	_local_irq_restore
	mov	w26, #0
	ldrb	w27, [x19, #8]
	mov	x23, x20
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_local_irq_disable
	mov	x0, x21
	bl	_gameport_read
	ldrb	w8, [x19, #8]
	and	w28, w8, w0
	bl	_get_time
	mov	x22, x0
	bl	_local_irq_restore
	eor	w27, w28, w27
	tst	w27, #0xff
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x23
	mov	x1, x22
	bl	_delta
	cmp	w0, w24
	b.hs	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x8, sp, #4
	strb	w27, [x8, w26, sxtw]
	add	x8, sp, #8
	str	w22, [x8, w26, sxtw #2]
	add	w26, w26, #1
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w28, #0
	ccmp	w26, #3, #0, ne
	b.gt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_delta
	mov	x27, x28
	mov	x23, x22
	cmp	w0, w25
	b.lo	LBB0_1
LBB0_6:
	lsl	w21, w28, #4
	subs	w8, w26, #1
	b.lt	LBB0_17
; %bb.7:
	mov	w9, w26
	add	x22, x9, #1
	add	x23, sp, #4
	add	x24, sp, #8
Lloh9:
	adrp	x25, _ANALOG_FUZZ_BITS@GOTPAGE
Lloh10:
	ldr	x25, [x25, _ANALOG_FUZZ_BITS@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	orr	w21, w27, w21
	sub	x22, x22, #1
	sub	w8, w26, #1
	cmp	x22, #1
	b.le	LBB0_17
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	w26, w8
	ldrb	w27, [x23, x26]
	tbnz	w27, #0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	tbnz	w27, #1, LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	tbnz	w27, #2, LBB0_15
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	tbz	w27, #3, LBB0_8
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x24, x26, lsl #2]
	mov	x0, x20
	bl	_delta
	ldr	w8, [x25]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9]
	tbz	w27, #1, LBB0_11
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x24, x26, lsl #2]
	mov	x0, x20
	bl	_delta
	ldr	w8, [x25]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9, #4]
	tbz	w27, #2, LBB0_12
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x24, x26, lsl #2]
	mov	x0, x20
	bl	_delta
	ldr	w8, [x25]
	lsl	w8, w0, w8
	ldr	w9, [x19]
	udiv	w8, w8, w9
	ldr	x9, [x19, #16]
	str	w8, [x9, #8]
	tbz	w27, #3, LBB0_8
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x24, x26, lsl #2]
	mov	x0, x20
	bl	_delta
	ldr	w8, [x25]
	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, w21, 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, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	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
