	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_in_gp2x_update_keycode         ## -- Begin function in_gp2x_update_keycode
	.p2align	4, 0x90
_in_gp2x_update_keycode:                ## @in_gp2x_update_keycode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_in_gp2x_get_bits
	movl	_in_gp2x_update_keycode.old_val(%rip), %edx
	movl	%edx, %esi
	xorl	%eax, %esi
	je	LBB0_1
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	btl	%ebx, %esi
	jb	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%esi, %edi
	movl	%ebx, %ecx
	shrl	%cl, %edi
	testb	$2, %dil
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%esi, %edi
	movl	%ebx, %ecx
	shrl	%cl, %edi
	testb	$4, %dil
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%esi, %edi
	movl	%ebx, %ecx
	shrl	%cl, %edi
	testb	$8, %dil
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	$4, %ebx
	cmpl	$32, %ebx
	jne	LBB0_2
## %bb.7:
	movl	$32, %ebx
	jmp	LBB0_11
LBB0_1:
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_10:
	incl	%ebx
	jmp	LBB0_11
LBB0_9:
	addl	$2, %ebx
	jmp	LBB0_11
LBB0_8:
	addl	$3, %ebx
LBB0_11:
	btcl	%ebx, %edx
	movl	%edx, _in_gp2x_update_keycode.old_val(%rip)
	testq	%r14, %r14
	je	LBB0_13
## %bb.12:
	xorl	%ecx, %ecx
	btl	%ebx, %eax
	setb	%cl
	movl	%ecx, (%r14)
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_in_gp2x_update_keycode.old_val,4,2 ## @in_gp2x_update_keycode.old_val
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_in_gp2x_update_keycode         ; -- Begin function in_gp2x_update_keycode
	.p2align	2
_in_gp2x_update_keycode:                ; @in_gp2x_update_keycode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_in_gp2x_get_bits
	adrp	x9, _in_gp2x_update_keycode.old_val@PAGE
	ldr	w10, [x9, _in_gp2x_update_keycode.old_val@PAGEOFF]
	eor	w11, w10, w0
	cbz	w11, LBB0_6
; %bb.1:
	mov	x8, x0
	mov	w0, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w12, w11, w0
	tbnz	w12, #0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w0, w0, #1
	cmp	w0, #32
	b.ne	LBB0_2
LBB0_4:
	mov	w11, #1
	lsl	w11, w11, w0
	eor	w10, w11, w10
	str	w10, [x9, _in_gp2x_update_keycode.old_val@PAGEOFF]
	cbz	x19, LBB0_7
; %bb.5:
	lsr	w8, w8, w0
	and	w8, w8, #0x1
	str	w8, [x19]
	b	LBB0_7
LBB0_6:
	mov	w0, #-1
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_in_gp2x_update_keycode.old_val,4,2 ; @in_gp2x_update_keycode.old_val
.subsections_via_symbols
