	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DWaitButton                    ## -- Begin function DWaitButton
	.p2align	4, 0x90
_DWaitButton:                           ## @DWaitButton
	.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	$104, %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, %r15
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_SDL_WM_SetCaption
	movq	%r14, %rdi
	callq	_puts
	leaq	_DWaitButton.LastAx(%rip), %r13
	leaq	L_.memset_pattern(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%r13), %rdi
	movl	$256, %edx                      ## imm = 0x100
	movq	%r14, %rsi
	callq	_memset_pattern16
	addq	$256, %rbx                      ## imm = 0x100
	cmpq	$16384, %rbx                    ## imm = 0x4000
	jne	LBB0_1
## %bb.2:
	leaq	-136(%rbp), %rdi
	callq	_SDL_WaitEvent
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_17
## %bb.3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leaq	-136(%rbp), %rbx
	leaq	LJTI0_0(%rip), %r14
	movq	_SDL_HAT_CENTERED@GOTPCREL(%rip), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-104(%rbp), %eax
	cmpl	(%r15), %eax
	jne	LBB0_8
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_SDL_WaitEvent
	testq	%rax, %rax
	je	LBB0_17
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	-136(%rbp), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	(%r14,%rax,4), %rax
	addq	%r14, %rax
	jmpq	*%rax
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-128(%rbp), %rdx
	movq	-120(%rbp), %rcx
	movq	%rdx, %rsi
	shlq	$8, %rsi
	addq	%r13, %rsi
	movl	(%rsi,%rcx,4), %edi
	movl	-112(%rbp), %eax
	cmpl	$1048576, %edi                  ## imm = 0x100000
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %edx
	negl	%edx
	cmovsl	%eax, %edx
	cmpl	$999, %edx                      ## imm = 0x3E7
	ja	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%rsi,%rcx,4), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	subl	%eax, %edi
	movl	%edi, %ecx
	negl	%ecx
	cmovsl	%edi, %ecx
	cmpl	$8192, %ecx                     ## imm = 0x2000
	jb	LBB0_12
## %bb.14:
	movq	_BUTTC_JOYSTICK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rdi
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	%rsi, (%rdi,%rcx,8)
	movq	(%rbx), %rsi
	movq	%rdx, (%rsi,%rcx,8)
	shrl	$17, %eax
	andl	$16384, %eax                    ## imm = 0x4000
	orl	-120(%rbp), %eax
	orl	$32768, %eax                    ## imm = 0x8000
	jmp	LBB0_16
LBB0_15:
	movq	_BUTTC_KEYBOARD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rdx
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	%rax, (%rdx,%rcx,8)
	movq	(%rbx), %rax
	movq	$0, (%rax,%rcx,8)
	movl	-64(%rbp), %eax
	jmp	LBB0_16
LBB0_6:
	movq	_BUTTC_JOYSTICK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rdx
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	%rax, (%rdx,%rcx,8)
	movq	-80(%rbp), %rax
	movq	(%rbx), %rdx
	movq	%rax, (%rdx,%rcx,8)
	movl	-72(%rbp), %eax
	jmp	LBB0_16
LBB0_8:
	movq	_BUTTC_JOYSTICK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rsi
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	%rdx, (%rsi,%rcx,8)
	movq	-96(%rbp), %rdx
	movq	(%rbx), %rsi
	movq	%rdx, (%rsi,%rcx,8)
	movl	-88(%rbp), %edx
	andl	$31, %edx
	shll	$8, %edx
	orl	%edx, %eax
	orl	$8192, %eax                     ## imm = 0x2000
LBB0_16:
	movq	8(%rbx), %rdx
	movl	%eax, (%rdx,%rcx,4)
	movl	$1, %r12d
LBB0_17:
	movl	%r12d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_15
	.long	L0_0_set_7
	.long	L0_0_set_6
	.long	L0_0_set_9
	.end_data_region
                                        ## -- End function
.zerofill __DATA,__bss,_DWaitButton.LastAx,16384,4 ## @DWaitButton.LastAx
	.comm	_BUTTC_KEYBOARD,8,3             ## @BUTTC_KEYBOARD
	.comm	_BUTTC_JOYSTICK,8,3             ## @BUTTC_JOYSTICK
	.comm	_SDL_HAT_CENTERED,4,2           ## @SDL_HAT_CENTERED
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @.memset_pattern
L_.memset_pattern:
	.long	1048576                         ## 0x100000
	.long	1048576                         ## 0x100000
	.long	1048576                         ## 0x100000
	.long	1048576                         ## 0x100000

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DWaitButton                    ; -- Begin function DWaitButton
	.p2align	2
_DWaitButton:                           ; @DWaitButton
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	w1, #0
	bl	_SDL_WM_SetCaption
	mov	x0, x21
	bl	_puts
	mov	x23, #0
Lloh0:
	adrp	x22, _DWaitButton.LastAx@PAGE
Lloh1:
	add	x22, x22, _DWaitButton.LastAx@PAGEOFF
Lloh2:
	adrp	x21, l_.memset_pattern@PAGE
Lloh3:
	add	x21, x21, l_.memset_pattern@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x22, x23
	mov	x1, x21
	mov	w2, #256
	bl	_memset_pattern16
	add	x23, x23, #256
	cmp	x23, #4, lsl #12                ; =16384
	b.ne	LBB0_1
; %bb.2:
	mov	x0, sp
	bl	_SDL_WaitEvent
	cbz	x0, LBB0_17
; %bb.3:
Lloh4:
	adrp	x21, lJTI0_0@PAGE
Lloh5:
	add	x21, x21, lJTI0_0@PAGEOFF
Lloh6:
	adrp	x23, _SDL_HAT_CENTERED@GOTPAGE
Lloh7:
	ldr	x23, [x23, _SDL_HAT_CENTERED@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [sp, #32]
	ldr	w8, [x23]
	cmp	w9, w8
	b.ne	LBB0_15
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, sp
	bl	_SDL_WaitEvent
	cbz	x0, LBB0_17
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	adr	x9, LBB0_4
	ldrb	w10, [x21, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldp	x8, x9, [sp, #8]
	add	x10, x22, x8, lsl #8
	add	x10, x10, x9, lsl #2
	ldr	w11, [x10]
	ldr	w9, [sp, #24]
	cmp	w11, #256, lsl #12              ; =1048576
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #0
	cneg	w8, w9, mi
	cmp	w8, #999
	b.hi	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	str	w9, [x10]
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	subs	w10, w11, w9
	cneg	w10, w10, mi
	cmp	w10, #2, lsl #12                ; =8192
	b.lo	LBB0_5
; %bb.12:
Lloh8:
	adrp	x10, _BUTTC_JOYSTICK@GOTPAGE
Lloh9:
	ldr	x10, [x10, _BUTTC_JOYSTICK@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	ldr	x11, [x19, #16]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	sbfiz	x12, x20, #3, #32
	str	x10, [x11, x12]
	ldr	x10, [x19]
	str	x8, [x10, x12]
	sxtw	x8, w20
	ldr	w10, [sp, #16]
	lsr	w9, w9, #17
	and	w9, w9, #0x4000
	orr	w9, w9, w10
	orr	w9, w9, #0x8000
	b	LBB0_16
LBB0_13:
Lloh11:
	adrp	x8, _BUTTC_KEYBOARD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUTTC_KEYBOARD@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x8]
	ldr	x10, [x19, #16]
	sxtw	x8, w20
	sbfiz	x11, x20, #3, #32
	str	x9, [x10, x11]
	ldr	x9, [x19]
	str	xzr, [x9, x11]
	ldr	w9, [sp, #72]
	b	LBB0_16
LBB0_14:
Lloh14:
	adrp	x8, _BUTTC_JOYSTICK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BUTTC_JOYSTICK@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	sbfiz	x10, x20, #3, #32
	str	x8, [x9, x10]
	sxtw	x8, w20
	ldr	x9, [sp, #56]
	ldr	x11, [x19]
	str	x9, [x11, x10]
	ldr	w9, [sp, #64]
	b	LBB0_16
LBB0_15:
Lloh17:
	adrp	x8, _BUTTC_JOYSTICK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BUTTC_JOYSTICK@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x8]
	ldr	x11, [x19, #16]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	sxtw	x8, w20
	sbfiz	x12, x20, #3, #32
	str	x10, [x11, x12]
	ldr	x10, [sp, #40]
	ldr	x11, [x19]
	str	x10, [x11, x12]
	ldr	w10, [sp, #48]
	ubfiz	w10, w10, #8, #5
	orr	w9, w9, w10
	orr	w9, w9, #0x2000
LBB0_16:
	ldr	x10, [x19, #8]
	str	w9, [x10, x8, lsl #2]
	mov	w0, #1
LBB0_17:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_13-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_14-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
                                        ; -- End function
.zerofill __DATA,__bss,_DWaitButton.LastAx,16384,2 ; @DWaitButton.LastAx
	.comm	_BUTTC_KEYBOARD,8,3             ; @BUTTC_KEYBOARD
	.comm	_BUTTC_JOYSTICK,8,3             ; @BUTTC_JOYSTICK
	.comm	_SDL_HAT_CENTERED,4,2           ; @SDL_HAT_CENTERED
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; @.memset_pattern
l_.memset_pattern:
	.long	1048576                         ; 0x100000
	.long	1048576                         ; 0x100000
	.long	1048576                         ; 0x100000
	.long	1048576                         ; 0x100000

.subsections_via_symbols
