	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function android_input_poll_input
_android_input_poll_input:              ## @android_input_poll_input
	.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, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -48(%rbp)
	movq	_g_android@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movl	(%rbx), %edi
	callq	_AInputQueue_hasEvents
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_16
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	-48(%rbp), %rdi
	movl	%r14d, %esi
	leaq	-56(%rbp), %r15
	movq	%r15, %rdx
	callq	_android_input_poll_event_type_keyboard
	movq	-48(%rbp), %rsi
	movq	_ANDROID_KEYBOARD_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, (%rsp)
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	movl	$129, %r9d
	callq	_android_input_poll_event_type_key
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=2
	movl	(%rbx), %edi
	movq	-48(%rbp), %rsi
	movl	-56(%rbp), %edx
	callq	_AInputQueue_finishEvent
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx), %edi
	leaq	-48(%rbp), %rsi
	callq	_AInputQueue_getEvent
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	$1, -56(%rbp)
	movl	(%rbx), %edi
	movq	-48(%rbp), %rsi
	callq	_AInputQueue_preDispatchEvent
	movl	%eax, %r13d
	movq	-48(%rbp), %rdi
	callq	_AInputEvent_getSource
	movl	%eax, %r12d
	movq	-48(%rbp), %rdi
	callq	_AInputEvent_getType
	movl	%eax, %r14d
	movq	-48(%rbp), %rdi
	callq	_android_input_get_id
	movl	%eax, %r15d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_android_input_get_id_port
	movl	%eax, -52(%rbp)
	testl	%eax, %eax
	jns	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	%r15d, %edi
	callq	_is_keyboard_id
	testq	%rax, %rax
	je	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$129, %r14d
	je	LBB0_10
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$128, %r14d
	jne	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	-48(%rbp), %rsi
	movl	-52(%rbp), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %ecx
	callq	_android_input_poll_event_type_motion
	testl	%eax, %eax
	je	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	-48(%rbp), %rsi
	movl	-52(%rbp), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %ecx
	callq	_engine_handle_dpad
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=2
	testl	%r13d, %r13d
	jne	LBB0_2
	jmp	LBB0_15
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=2
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	leaq	-52(%rbp), %rdx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	callq	_handle_hotplug
	cmpl	$129, %r14d
	jne	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	-48(%rbp), %rdi
	callq	_AKeyEvent_getKeyCode
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_is_keyboard_id
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=2
	testl	%r13d, %r13d
	jne	LBB0_2
	jmp	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	-48(%rbp), %rsi
	movl	-52(%rbp), %edx
	leaq	-56(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	movl	$129, %r9d
	callq	_android_input_poll_event_type_key
	testl	%r13d, %r13d
	jne	LBB0_2
	jmp	LBB0_15
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_android,8,3                  ## @g_android
	.comm	_ANDROID_KEYBOARD_PORT,4,2      ## @ANDROID_KEYBOARD_PORT
	.no_dead_strip	_android_input_poll_input
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function android_input_poll_input
_android_input_poll_input:              ; @android_input_poll_input
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _g_android@GOTPAGE
Lloh1:
	ldr	x8, [x8, _g_android@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
	ldr	w0, [x20]
	bl	_AInputQueue_hasEvents
	cbz	x0, LBB0_17
; %bb.1:
	mov	w25, #1
Lloh3:
	adrp	x26, _ANDROID_KEYBOARD_PORT@GOTPAGE
Lloh4:
	ldr	x26, [x26, _ANDROID_KEYBOARD_PORT@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [sp, #8]
	add	x2, sp, #4
	mov	x1, x24
	bl	_android_input_poll_event_type_keyboard
	ldr	x1, [sp, #8]
	ldr	w2, [x26]
	add	x6, sp, #4
	mov	x0, x20
	mov	x3, x24
	mov	x4, x21
	mov	w5, #129
	bl	_android_input_poll_event_type_key
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	ldr	x1, [sp, #8]
	ldr	w2, [sp, #4]
	bl	_AInputQueue_finishEvent
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	add	x1, sp, #8
	bl	_AInputQueue_getEvent
	tbnz	x0, #63, LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w25, [sp, #4]
	ldr	w0, [x20]
	ldr	x1, [sp, #8]
	bl	_AInputQueue_preDispatchEvent
	mov	x22, x0
	ldr	x0, [sp, #8]
	bl	_AInputEvent_getSource
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_AInputEvent_getType
	mov	x24, x0
	ldr	x0, [sp, #8]
	bl	_android_input_get_id
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	bl	_android_input_get_id_port
	str	w0, [sp]
	tbz	w0, #31, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	bl	_is_keyboard_id
	cbz	x0, LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w24, #129
	b.eq	LBB0_13
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w24, #128
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [sp, #8]
	ldr	w2, [sp]
	mov	x0, x19
	mov	x3, x21
	bl	_android_input_poll_event_type_motion
	cbz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [sp, #8]
	ldr	w2, [sp]
	mov	x0, x19
	mov	x3, x21
	bl	_engine_handle_dpad
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w22, LBB0_4
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, sp
	mov	x0, x19
	mov	x1, x20
	mov	x3, x23
	mov	x4, x21
	bl	_handle_hotplug
	cmp	w24, #129
	b.ne	LBB0_8
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [sp, #8]
	bl	_AKeyEvent_getKeyCode
	mov	x24, x0
	mov	x0, x23
	bl	_is_keyboard_id
	cbz	x0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w22, LBB0_4
	b	LBB0_2
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [sp, #8]
	ldr	w2, [sp]
	add	x6, sp, #4
	mov	x0, x20
	mov	x3, x24
	mov	x4, x21
	mov	w5, #129
	bl	_android_input_poll_event_type_key
	cbnz	w22, LBB0_4
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	bl	_AInputQueue_hasEvents
	cbnz	x0, LBB0_4
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_g_android,8,3                  ; @g_android
	.comm	_ANDROID_KEYBOARD_PORT,4,2      ; @ANDROID_KEYBOARD_PORT
	.no_dead_strip	_android_input_poll_input
.subsections_via_symbols
