	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_touch_state
_update_touch_state:                    ## @update_touch_state
	.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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	$0, -40(%rbp)
	movq	$0, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movq	$0, -64(%rbp)
	movl	$0, -36(%rbp)
	cmpl	$0, 8(%rdx)
	je	LBB0_2
## %bb.1:
	movq	%rdx, %rbx
	movq	(%rdx), %rax
	movq	_VPAD_VALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	movq	%rdi, %r14
	leaq	-96(%rbp), %r12
	movq	%r12, %rdi
	callq	_video_driver_get_viewport_info
	leaq	-48(%rbp), %rdi
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_get_touch_coordinates
	movq	-72(%rbp), %rdi
	movq	-80(%rbp), %rsi
	addq	%rdi, %rsi
	movl	-44(%rbp), %r8d
	movl	$-32767, %edx                   ## imm = 0x8001
	movl	$32767, %ecx                    ## imm = 0x7FFF
	callq	_scale_touchpad
	movq	_WIIU_DEVICE_INDEX_TOUCHPAD@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	_RETRO_DEVICE_ID_ANALOG_X@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	(%r14,%rcx,8), %rcx
	movl	%eax, (%rcx,%rdx,4)
	movq	-88(%rbp), %rdi
	movq	-96(%rbp), %rsi
	addq	%rdi, %rsi
	movl	-48(%rbp), %r8d
	movl	$-32767, %edx                   ## imm = 0x8001
	movl	$32767, %ecx                    ## imm = 0x7FFF
	callq	_scale_touchpad
	movq	(%rbx), %rcx
	movq	_RETRO_DEVICE_ID_ANALOG_Y@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	(%r14,%rcx,8), %rcx
	movl	%eax, (%rcx,%rdx,4)
	cmpl	$0, -36(%rbp)
	movq	_VPAD_BUTTON_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jne	LBB0_3
## %bb.5:
	orl	(%r15), %eax
	jmp	LBB0_6
LBB0_2:
	movq	_VPAD_BUTTON_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_3:
	notl	%eax
	andl	(%r15), %eax
LBB0_6:
	movl	%eax, (%r15)
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPAD_VALID,8,3                 ## @VPAD_VALID
	.comm	_VPAD_BUTTON_TOUCH,4,2          ## @VPAD_BUTTON_TOUCH
	.comm	_WIIU_DEVICE_INDEX_TOUCHPAD,8,3 ## @WIIU_DEVICE_INDEX_TOUCHPAD
	.comm	_RETRO_DEVICE_ID_ANALOG_X,8,3   ## @RETRO_DEVICE_ID_ANALOG_X
	.comm	_RETRO_DEVICE_ID_ANALOG_Y,8,3   ## @RETRO_DEVICE_ID_ANALOG_Y
	.no_dead_strip	_update_touch_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_touch_state
_update_touch_state:                    ; @update_touch_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x1
	stur	wzr, [x29, #-40]
	stur	xzr, [x29, #-48]
	str	xzr, [sp, #48]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #16]
	str	wzr, [sp, #12]
	ldr	w8, [x2, #8]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x21, x2
	ldr	x8, [x2]
Lloh0:
	adrp	x9, _VPAD_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VPAD_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x20, x0
	add	x0, sp, #16
	bl	_video_driver_get_viewport_info
	sub	x0, x29, #48
	add	x2, sp, #16
	add	x3, sp, #12
	mov	x1, x21
	bl	_get_touch_coordinates
	ldp	x8, x0, [sp, #32]
	add	x1, x8, x0
	ldur	w4, [x29, #-44]
	mov	w2, #-32767
	mov	w3, #32767
	bl	_scale_touchpad
Lloh3:
	adrp	x21, _WIIU_DEVICE_INDEX_TOUCHPAD@GOTPAGE
Lloh4:
	ldr	x21, [x21, _WIIU_DEVICE_INDEX_TOUCHPAD@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _RETRO_DEVICE_ID_ANALOG_X@GOTPAGE
Lloh6:
	ldr	x9, [x9, _RETRO_DEVICE_ID_ANALOG_X@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x8, x20, x8, lsl #3
	str	w0, [x8, x9, lsl #2]
	ldp	x8, x0, [sp, #16]
	add	x1, x8, x0
	ldur	w4, [x29, #-48]
	mov	w2, #-32767
	mov	w3, #32767
	bl	_scale_touchpad
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _RETRO_DEVICE_ID_ANALOG_Y@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RETRO_DEVICE_ID_ANALOG_Y@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x8, x20, x8, lsl #3
	str	w0, [x8, x9, lsl #2]
	ldr	w9, [sp, #12]
Lloh11:
	adrp	x8, _VPAD_BUTTON_TOUCH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VPAD_BUTTON_TOUCH@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cbnz	w9, LBB0_5
; %bb.3:
	ldr	w9, [x19]
	orr	w8, w9, w8
	b	LBB0_6
LBB0_4:
Lloh14:
	adrp	x8, _VPAD_BUTTON_TOUCH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VPAD_BUTTON_TOUCH@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
LBB0_5:
	ldr	w9, [x19]
	bic	w8, w9, w8
LBB0_6:
	str	w8, [x19]
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VPAD_VALID,8,3                 ; @VPAD_VALID
	.comm	_VPAD_BUTTON_TOUCH,4,2          ; @VPAD_BUTTON_TOUCH
	.comm	_WIIU_DEVICE_INDEX_TOUCHPAD,8,3 ; @WIIU_DEVICE_INDEX_TOUCHPAD
	.comm	_RETRO_DEVICE_ID_ANALOG_X,8,3   ; @RETRO_DEVICE_ID_ANALOG_X
	.comm	_RETRO_DEVICE_ID_ANALOG_Y,8,3   ; @RETRO_DEVICE_ID_ANALOG_Y
	.no_dead_strip	_update_touch_state
.subsections_via_symbols
