	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ati_remote2_getkeycode
_ati_remote2_getkeycode:                ## @ati_remote2_getkeycode
	.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
	movq	%rsi, %r14
	callq	_input_get_drvdata
	movq	%rax, %r13
	movq	_INPUT_KEYMAP_BY_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.1:
	movl	4(%r14), %r15d
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	imull	%ebx, %eax
	cmpl	%eax, %r15d
	jae	LBB0_2
## %bb.3:
	movq	%r12, %rax
	movl	4(%r14), %r12d
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
	movq	%r13, %rbx
	movl	4(%r14), %r13d
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%r12d, %ecx
	shll	$8, %ecx
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movslq	%edx, %rax
	addl	(%rsi,%rax,4), %ecx
	movl	%ecx, -44(%rbp)
LBB0_8:
	movq	(%rbx), %rcx
	movl	%r12d, %edx
	movq	(%rcx,%rdx,8), %rcx
	movl	(%rcx,%rax,4), %eax
	movl	%eax, 16(%r14)
	movl	$4, 8(%r14)
	leaq	12(%r14), %rdi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	%r15d, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_4:
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_input_scancode_to_scalar
	testq	%rax, %rax
	jne	LBB0_2
## %bb.5:
	movl	-44(%rbp), %eax
	movl	%eax, %r12d
	shrl	$8, %r12d
	movq	_ATI_REMOTE2_PC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	ja	LBB0_2
## %bb.6:
	movq	%r13, %rbx
	movzbl	%al, %edi
	callq	_ati_remote2_lookup
	testl	%eax, %eax
	js	LBB0_2
## %bb.7:
	movl	%eax, %r13d
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %r15d
	imull	%r12d, %r15d
	addl	%r13d, %r15d
	movl	%r13d, %eax
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ## @INPUT_KEYMAP_BY_INDEX
	.comm	_ATI_REMOTE2_MODES,4,2          ## @ATI_REMOTE2_MODES
	.comm	_ati_remote2_key_table,8,3      ## @ati_remote2_key_table
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATI_REMOTE2_PC,4,2             ## @ATI_REMOTE2_PC
	.no_dead_strip	_ati_remote2_getkeycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ati_remote2_getkeycode
_ati_remote2_getkeycode:                ; @ati_remote2_getkeycode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	bl	_input_get_drvdata
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _INPUT_KEYMAP_BY_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INPUT_KEYMAP_BY_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	w22, [x19, #4]
Lloh3:
	adrp	x8, _ATI_REMOTE2_MODES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATI_REMOTE2_MODES@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x21, _ati_remote2_key_table@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ati_remote2_key_table@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	mul	w8, w0, w23
	cmp	w22, w8
	b.hs	LBB0_8
; %bb.2:
	ldr	w23, [x19, #4]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	ldr	w24, [x19, #4]
	ldr	x8, [x21]
	udiv	w23, w23, w0
	mov	x0, x8
	bl	_ARRAY_SIZE
	udiv	w8, w24, w0
	msub	w9, w8, w0, w24
	ldr	x10, [x21]
	sxtw	x8, w9
	ldr	w9, [x10, w9, sxtw #2]
	add	w9, w9, w23, lsl #8
	str	w9, [sp, #12]
LBB0_3:
	ldr	x9, [x20]
	ldr	x9, [x9, w23, uxtw #3]
	ldr	w8, [x9, x8, lsl #2]
	str	w8, [x19, #16]
	mov	w8, #4
	str	w8, [x19, #8]
	add	x0, x19, #12
	add	x1, sp, #12
	mov	w2, #4
	bl	_memcpy
	mov	w0, #0
	str	w22, [x19, #4]
	b	LBB0_9
LBB0_4:
	add	x1, sp, #12
	mov	x0, x19
	bl	_input_scancode_to_scalar
	cbnz	x0, LBB0_8
; %bb.5:
	ldr	w8, [sp, #12]
	lsr	w23, w8, #8
Lloh8:
	adrp	x9, _ATI_REMOTE2_PC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ATI_REMOTE2_PC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w23, w9
	b.hi	LBB0_8
; %bb.6:
	and	w0, w8, #0xff
	bl	_ati_remote2_lookup
	tbnz	w0, #31, LBB0_8
; %bb.7:
	mov	x21, x0
Lloh11:
	adrp	x8, _ati_remote2_key_table@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ati_remote2_key_table@GOTPAGEOFF]
Lloh13:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	madd	w22, w0, w23, w21
	mov	w8, w21
	b	LBB0_3
LBB0_8:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ; @INPUT_KEYMAP_BY_INDEX
	.comm	_ATI_REMOTE2_MODES,4,2          ; @ATI_REMOTE2_MODES
	.comm	_ati_remote2_key_table,8,3      ; @ati_remote2_key_table
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATI_REMOTE2_PC,4,2             ; @ATI_REMOTE2_PC
	.no_dead_strip	_ati_remote2_getkeycode
.subsections_via_symbols
