	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analog_button_read
_analog_button_read:                    ## @analog_button_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	movq	_ANALOG_SAITEK_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gameport_time
	movl	%eax, %r15d
	movl	4(%rbx), %edi
	callq	_gameport_read
	testb	%r12b, %r12b
	je	LBB0_1
## %bb.2:
	movb	$0, (%rbx)
	movzbl	%al, %ecx
	notl	%ecx
	xorl	%eax, %eax
	testb	$-16, %cl
	je	LBB0_14
## %bb.3:
	movq	_analog_chf@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	shrl	$4, %ecx
	andl	$15, %ecx
	movb	(%rdx,%rcx,4), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movb	%dl, (%rbx)
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_14
## %bb.4:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	_ANALOG_SAITEK_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	4(%rbx), %edi
	callq	_gameport_trigger
	movl	%r15d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r13d, %r14d
	movl	4(%rbx), %edi
	callq	_gameport_read
	addl	$-1, %r13d
	setb	%cl
	testb	%al, 1(%rbx)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	testb	%cl, %cl
	jne	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%r12), %edx
	movzbl	%al, %eax
	notl	%eax
	testb	$-16, %al
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$14, %r12d
	ja	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	testl	%r14d, %r14d
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_analog_chf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrl	$4, %eax
	andl	$15, %eax
	movb	(%rcx,%rax,4), %cl
	movl	$1, %eax
	shll	%cl, %eax
	orb	%al, (%rbx)
	movl	%edx, %r12d
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_5
## %bb.12:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	notb	%al
	shrb	$4, %al
	movb	%al, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_13:
	testl	%r14d, %r14d
	sete	%al
	cmpl	$16, %edx
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %eax
	negl	%eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ANALOG_SAITEK_TIME,4,2         ## @ANALOG_SAITEK_TIME
	.comm	_analog_chf,8,3                 ## @analog_chf
	.comm	_ANALOG_SAITEK_DELAY,4,2        ## @ANALOG_SAITEK_DELAY
	.no_dead_strip	_analog_button_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function analog_button_read
_analog_button_read:                    ; @analog_button_read
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _ANALOG_SAITEK_TIME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANALOG_SAITEK_TIME@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_gameport_time
	mov	x21, x0
	ldr	w0, [x19, #4]
	bl	_gameport_read
	mov	x8, x0
	cbz	w22, LBB0_10
; %bb.1:
	strb	wzr, [x19]
	mvn	w8, w8
	tst	w8, #0xf0
	b.eq	LBB0_9
; %bb.2:
Lloh3:
	adrp	x22, _analog_chf@GOTPAGE
Lloh4:
	ldr	x22, [x22, _analog_chf@GOTPAGEOFF]
	ldr	x9, [x22]
	ubfx	w8, w8, #4, #4
	ldr	w8, [x9, w8, uxtw #2]
	mov	w23, #1
	lsl	w8, w23, w8
	strb	w8, [x19]
	cbz	w20, LBB0_9
; %bb.3:
	mov	w25, #0
Lloh5:
	adrp	x24, _ANALOG_SAITEK_DELAY@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ANALOG_SAITEK_DELAY@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x19, #4]
	bl	_gameport_trigger
	mov	x8, x21
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x26, x8
	ldr	w0, [x19, #4]
	bl	_gameport_read
	ldrb	w10, [x19, #1]
	subs	w8, w26, #1
	cset	w9, hs
	and	w10, w10, w0
	cbz	w10, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w9, #0, LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w25, #1
	mvn	w9, w0
	and	w10, w9, #0xf0
	cmp	w10, #0
	ccmp	w25, #14, #2, ne
	ccmp	w26, #0, #4, ls
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w10, [x19]
	ldr	x11, [x22]
	ubfx	w9, w9, #4, #4
	ldr	w9, [x11, w9, uxtw #2]
	lsl	w9, w23, w9
	orr	w9, w10, w9
	strb	w9, [x19]
	mov	x25, x8
	cbnz	w20, LBB0_4
LBB0_9:
	mov	w0, #0
	b	LBB0_12
LBB0_10:
	mov	w0, #0
	mvn	w8, w8
	ubfx	w8, w8, #4, #4
	strb	w8, [x19]
	b	LBB0_12
LBB0_11:
	cmp	w26, #0
	ccmp	w8, #16, #4, ne
	cset	w8, eq
	sbfx	w0, w8, #0, #1
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ANALOG_SAITEK_TIME,4,2         ; @ANALOG_SAITEK_TIME
	.comm	_analog_chf,8,3                 ; @analog_chf
	.comm	_ANALOG_SAITEK_DELAY,4,2        ; @ANALOG_SAITEK_DELAY
	.no_dead_strip	_analog_button_read
.subsections_via_symbols
