	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ati_remote2_setkeycode
_ati_remote2_setkeycode:                ## @ati_remote2_setkeycode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_input_get_drvdata
	movq	%rax, %r13
	movq	_INPUT_KEYMAP_BY_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.1:
	movl	4(%r12), %r14d
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	imull	%ebx, %eax
	cmpl	%eax, %r14d
	jae	LBB0_2
## %bb.6:
	movl	4(%r12), %ebx
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
	movl	4(%r12), %r14d
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	movl	%r14d, %eax
	movl	%ebx, %r14d
	xorl	%edx, %edx
	divl	%ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_7:
	movq	(%r13), %rax
	movl	%r14d, %ecx
	movq	(%rax,%rcx,8), %rax
	movslq	%edx, %rcx
	movl	(%rax,%rcx,4), %edx
	movl	%edx, (%r15)
	movl	8(%r12), %edx
	movl	%edx, (%rax,%rcx,4)
	movl	8(%r12), %edi
	movl	(%rbx), %esi
	callq	___set_bit
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_14
## %bb.8:
	xorl	%ebx, %ebx
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %r12
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	jae	LBB0_14
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movl	(%r12), %edi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13), %rax
	movq	(%rax,%rbx,8), %rax
	movl	(%rax,%r14,4), %eax
	cmpl	(%r15), %eax
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=2
	incq	%r14
	movl	(%r12), %edi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r14
	jb	LBB0_12
	jmp	LBB0_13
LBB0_3:
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_input_scancode_to_scalar
	testq	%rax, %rax
	jne	LBB0_2
## %bb.4:
	movl	-44(%rbp), %eax
	movl	%eax, %r14d
	shrl	$8, %r14d
	movq	_ATI_REMOTE2_PC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	ja	LBB0_2
## %bb.5:
	movzbl	%al, %edi
	callq	_ati_remote2_lookup
	movl	%eax, %edx
	testl	%eax, %eax
	jns	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_14:
	movl	(%r15), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	callq	___clear_bit
LBB0_15:
	xorl	%eax, %eax
LBB0_16:
	addq	$24, %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,4,2      ## @ati_remote2_key_table
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATI_REMOTE2_PC,4,2             ## @ATI_REMOTE2_PC
	.no_dead_strip	_ati_remote2_setkeycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ati_remote2_setkeycode
_ati_remote2_setkeycode:                ; @ati_remote2_setkeycode
	.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, x2
	mov	x22, x1
	mov	x20, x0
	bl	_input_get_drvdata
	mov	x21, x0
	ldr	w8, [x22]
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_10
; %bb.1:
	ldr	w24, [x22, #4]
Lloh3:
	adrp	x8, _ATI_REMOTE2_MODES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATI_REMOTE2_MODES@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
Lloh6:
	adrp	x23, _ati_remote2_key_table@GOTPAGE
Lloh7:
	ldr	x23, [x23, _ati_remote2_key_table@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_ARRAY_SIZE
	mul	w8, w0, w25
	cmp	w24, w8
	b.hs	LBB0_13
; %bb.2:
	ldr	w24, [x22, #4]
	ldr	w0, [x23]
	bl	_ARRAY_SIZE
	ldr	w25, [x22, #4]
	ldr	w8, [x23]
	udiv	w23, w24, w0
	mov	x0, x8
	bl	_ARRAY_SIZE
	udiv	w8, w25, w0
	msub	w0, w8, w0, w25
LBB0_3:
	ldr	x8, [x21]
	ldr	x8, [x8, w23, uxtw #3]
	sbfiz	x9, x0, #2, #32
	ldr	w10, [x8, x9]
	str	w10, [x19]
	ldr	w10, [x22, #8]
	str	w10, [x8, x9]
	ldr	w0, [x22, #8]
	ldr	w1, [x20]
	bl	___set_bit
Lloh8:
	adrp	x22, _ATI_REMOTE2_MODES@GOTPAGE
Lloh9:
	ldr	x22, [x22, _ATI_REMOTE2_MODES@GOTPAGEOFF]
	ldr	w8, [x22]
	cbz	w8, LBB0_14
; %bb.4:
	mov	x23, #0
Lloh10:
	adrp	x24, _ati_remote2_key_table@GOTPAGE
Lloh11:
	ldr	x24, [x24, _ati_remote2_key_table@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldr	w8, [x22]
	cmp	x23, x8
	b.hs	LBB0_14
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	w0, [x24]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, #0
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21]
	ldr	x8, [x8, x23, lsl #3]
	ldr	w8, [x8, x25, lsl #2]
	ldr	w9, [x19]
	cmp	w8, w9
	b.eq	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	x25, x25, #1
	ldr	w0, [x24]
	bl	_ARRAY_SIZE
	cmp	x25, w0, uxtw
	b.lo	LBB0_8
	b	LBB0_5
LBB0_10:
	add	x1, sp, #12
	mov	x0, x22
	bl	_input_scancode_to_scalar
	cbnz	x0, LBB0_13
; %bb.11:
	ldr	w8, [sp, #12]
	lsr	w23, w8, #8
Lloh12:
	adrp	x9, _ATI_REMOTE2_PC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATI_REMOTE2_PC@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w23, w9
	b.hi	LBB0_13
; %bb.12:
	and	w0, w8, #0xff
	bl	_ati_remote2_lookup
                                        ; kill: def $w0 killed $w0 def $x0
	tbz	w0, #31, LBB0_3
LBB0_13:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_14:
	ldr	w0, [x19]
	ldr	w1, [x20]
	bl	___clear_bit
LBB0_15:
	mov	w0, #0
LBB0_16:
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.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,4,2      ; @ati_remote2_key_table
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATI_REMOTE2_PC,4,2             ; @ATI_REMOTE2_PC
	.no_dead_strip	_ati_remote2_setkeycode
.subsections_via_symbols
