	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_input_get_drvdata
	movq	%rax, %r13
	movl	%r15d, %ebx
	sarl	$8, %ebx
	movq	_ATI_REMOTE2_PC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_2
## %bb.1:
	movl	(%r13), %eax
	btl	%ebx, %eax
	jae	LBB0_2
## %bb.3:
	movzbl	%r15b, %edi
	callq	_ati_remote2_lookup
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	jg	LBB0_2
## %bb.5:
	movq	_KEY_MAX@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	jl	LBB0_2
## %bb.6:
	movq	8(%r13), %rcx
	movslq	%ebx, %rdx
	movq	(%rcx,%rdx,8), %rcx
	movl	%eax, %eax
	movl	(%rcx,%rax,4), %r15d
	movl	%r12d, (%rcx,%rax,4)
	movl	(%r14), %esi
	movl	%r12d, %edi
	callq	___set_bit
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_13
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movq	_ATI_REMOTE2_MODES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jge	LBB0_13
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %rax
	cmpl	%r15d, (%rax,%r12,4)
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=2
	incq	%r12
	movq	_ati_remote2_key_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r12
	jl	LBB0_11
	jmp	LBB0_12
LBB0_13:
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	___clear_bit
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ATI_REMOTE2_PC,4,2             ## @ATI_REMOTE2_PC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.comm	_KEY_MAX,4,2                    ## @KEY_MAX
	.comm	_ATI_REMOTE2_MODES,4,2          ## @ATI_REMOTE2_MODES
	.comm	_ati_remote2_key_table,4,2      ## @ati_remote2_key_table
	.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:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	bl	_input_get_drvdata
	asr	w23, w21, #8
Lloh0:
	adrp	x8, _ATI_REMOTE2_PC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATI_REMOTE2_PC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w23, w8
	b.gt	LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	lsr	w8, w8, w23
	tbz	w8, #0, LBB0_4
; %bb.2:
	and	w0, w21, #0xff
	bl	_ati_remote2_lookup
	tbnz	w0, #31, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _KEY_MAX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KEY_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w22
	ccmp	w9, w22, #8, le
	b.ge	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	x8, [x20, #8]
	ldr	x8, [x8, w23, sxtw #3]
	mov	w9, w0
	lsl	x9, x9, #2
	ldr	w21, [x8, x9]
	str	w22, [x8, x9]
	ldr	w1, [x19]
	mov	x0, x22
	bl	___set_bit
Lloh12:
	adrp	x22, _ATI_REMOTE2_MODES@GOTPAGE
Lloh13:
	ldr	x22, [x22, _ATI_REMOTE2_MODES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.7:
	mov	x23, #0
Lloh14:
	adrp	x24, _ati_remote2_key_table@GOTPAGE
Lloh15:
	ldr	x24, [x24, _ati_remote2_key_table@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.ge	LBB0_13
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x25, #0
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x23, lsl #3]
	ldr	w8, [x8, x25, lsl #2]
	cmp	w8, w21
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x25, x25, #1
	ldr	w0, [x24]
	bl	_ARRAY_SIZE
	cmp	x25, w0, sxtw
	b.lt	LBB0_11
	b	LBB0_8
LBB0_13:
	ldr	w1, [x19]
	mov	x0, x21
	bl	___clear_bit
LBB0_14:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ATI_REMOTE2_PC,4,2             ; @ATI_REMOTE2_PC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.comm	_KEY_MAX,4,2                    ; @KEY_MAX
	.comm	_ATI_REMOTE2_MODES,4,2          ; @ATI_REMOTE2_MODES
	.comm	_ati_remote2_key_table,4,2      ; @ati_remote2_key_table
	.no_dead_strip	_ati_remote2_setkeycode
.subsections_via_symbols
