	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imon_pad_to_keys
_imon_pad_to_keys:                      ## @imon_pad_to_keys
	.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, %r15
	movq	%rdi, %r14
	cmpl	$65500, (%rdi)                  ## imm = 0xFFDC
	jne	LBB0_1
## %bb.14:
	movq	_pad_thresh@GOTPCREL(%rip), %rsi
	movb	(%r15), %cl
	movb	1(%r15), %dl
	movl	%edx, %ebx
	andb	$8, %bl
	movl	%edx, %eax
	shrb	$2, %al
	andb	$4, %al
	orb	%bl, %al
	movl	%edx, %ebx
	shrb	$4, %bl
	andb	$2, %bl
	orb	%al, %bl
	shrb	$6, %dl
	andb	$1, %dl
	orb	%bl, %dl
	leal	-16(%rdx), %eax
	testb	$2, %cl
	movzbl	%dl, %edx
	movzbl	%al, %r13d
	cmovel	%edx, %r13d
	movb	2(%r15), %al
	movl	%eax, %edx
	andb	$8, %dl
	movl	%eax, %ebx
	shrb	$2, %bl
	andb	$4, %bl
	orb	%dl, %bl
	movl	%eax, %edx
	shrb	$4, %dl
	andb	$2, %dl
	orb	%bl, %dl
	shrb	$6, %al
	andb	$1, %al
	orb	%dl, %al
	leal	-16(%rax), %edx
	testb	$1, %cl
	movzbl	%al, %eax
	movzbl	%dl, %ebx
	cmovel	%eax, %ebx
	movl	(%rsi), %eax
	movb	$1, (%r15)
	movb	$0, 1(%r15)
	movl	$0, 4(%r15)
	movq	8(%r14), %rcx
	movq	_RC_PROTO_BIT_IMON@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_20
## %bb.15:
	movq	_pad_stabilize@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_20
## %bb.16:
	testl	%eax, %eax
	movl	$15, %ecx
	cmovnel	%eax, %ecx
	movsbl	%r13b, %edi
	movsbl	%bl, %esi
	movl	$10, %edx
LBB0_6:
	callq	_stabilize
	testl	%eax, %eax
	je	LBB0_7
## %bb.17:
	movw	%ax, 2(%r15)
	movl	(%r15), %edi
	callq	_be32_to_cpu
	movl	%eax, %r12d
	jmp	LBB0_18
LBB0_1:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movb	$0, 7(%r15)
	movw	$0, 5(%r15)
	movq	_pad_thresh@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	$28, %ecx
	cmovnel	%eax, %ecx
	movsbl	2(%r15), %edi
	movsbl	3(%r15), %r13d
	movq	8(%r14), %rax
	movq	_RC_PROTO_BIT_IMON@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_9
## %bb.2:
	movq	_pad_stabilize@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.3:
	cmpb	$0, 1(%r15)
	jne	LBB0_18
## %bb.4:
	movl	%edi, %eax
	orb	%r13b, %al
	je	LBB0_18
## %bb.5:
	movl	%r13d, %esi
	movl	$500, %edx                      ## imm = 0x1F4
	jmp	LBB0_6
LBB0_18:
	testl	%r12d, %r12d
	jne	LBB0_19
## %bb.23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movsbl	%bl, %edi
	callq	_abs
	movq	%rax, %r12
	movsbl	%r13b, %edi
	callq	_abs
	cmpq	%rax, %r12
	jle	LBB0_22
## %bb.21:
	xorl	%r12d, %r12d
	testb	%bl, %bl
	jmp	LBB0_11
LBB0_9:
	movl	%edi, %r12d
	movl	%r13d, %edi
	callq	_abs
	movq	%rax, %rbx
	movl	%r12d, %edi
	callq	_abs
	cmpq	%rax, %rbx
	jle	LBB0_12
## %bb.10:
	xorl	%r12d, %r12d
	testb	%r13b, %r13b
LBB0_11:
	setle	%r12b
	setg	%al
	movb	$-128, %cl
	subb	%al, %cl
	movb	%cl, 2(%r15)
	movb	$0, 3(%r15)
	shll	$8, %r12d
	addl	$16809728, %r12d                ## imm = 0x1007F00
	jmp	LBB0_19
LBB0_22:
	movb	$0, 2(%r15)
	xorl	%eax, %eax
	testb	%r13b, %r13b
	jmp	LBB0_13
LBB0_12:
	movb	$0, 2(%r15)
	xorl	%eax, %eax
	testb	%r12b, %r12b
LBB0_13:
	setg	%al
	movb	$-128, %cl
	subb	%al, %cl
	movb	%cl, 3(%r15)
	movl	$16777344, %r12d                ## imm = 0x1000080
	subl	%eax, %r12d
LBB0_19:
	leaq	16(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_imon_remote_key_lookup
LBB0_8:
	movq	%rax, 24(%r14)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_7:
	leaq	16(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_KEY_UNKNOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.comm	_pad_thresh,4,2                 ## @pad_thresh
	.comm	_RC_PROTO_BIT_IMON,8,3          ## @RC_PROTO_BIT_IMON
	.comm	_pad_stabilize,8,3              ## @pad_stabilize
	.comm	_KEY_UNKNOWN,8,3                ## @KEY_UNKNOWN
	.no_dead_strip	_imon_pad_to_keys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imon_pad_to_keys
_imon_pad_to_keys:                      ; @imon_pad_to_keys
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
	ldr	w8, [x0]
	mov	w9, #65500
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _pad_thresh@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pad_thresh@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldrb	w9, [x20, #1]
	and	w10, w9, #0x8
	bfxil	w10, w9, #2, #3
	bfxil	w10, w9, #4, #2
	bfxil	w10, w9, #6, #1
	ldrb	w9, [x20]
	orr	w11, w10, #0xfffffff0
	tst	w9, #0x2
	csel	w22, w10, w11, eq
	ldrb	w10, [x20, #2]
	and	w11, w10, #0x8
	bfxil	w11, w10, #2, #3
	bfxil	w11, w10, #4, #2
	bfxil	w11, w10, #6, #1
	orr	w10, w11, #0xfffffff0
	tst	w9, #0x1
	csel	w9, w11, w10, eq
	mov	w10, #1
	strb	w10, [x20]
	strb	wzr, [x20, #1]
	str	wzr, [x20, #4]
	ldr	x10, [x19, #8]
Lloh3:
	adrp	x11, _RC_PROTO_BIT_IMON@GOTPAGE
Lloh4:
	ldr	x11, [x11, _RC_PROTO_BIT_IMON@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
Lloh6:
	adrp	x12, _pad_stabilize@GOTPAGE
Lloh7:
	ldr	x12, [x12, _pad_stabilize@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
	cmp	x10, x11
	ccmp	x12, #0, #4, eq
	b.ne	LBB0_8
; %bb.2:
	sxtb	w21, w9
	mov	x0, x21
	bl	_abs
	mov	x23, x0
	sxtb	w22, w22
	mov	x0, x22
	bl	_abs
	cmp	x23, x0
	b.le	LBB0_16
; %bb.3:
	mov	w8, #127
	mov	w9, #32512
	movk	w9, #256, lsl #16
	add	w10, w9, #256
	cmp	w21, #0
	b	LBB0_7
LBB0_4:
Lloh9:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	strb	wzr, [x20, #7]
	sturh	wzr, [x20, #5]
Lloh12:
	adrp	x8, _pad_thresh@GOTPAGE
Lloh13:
	ldr	x8, [x8, _pad_thresh@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mov	w9, #28
	cmp	w8, #0
	csel	w3, w9, w8, eq
	ldrsb	w23, [x20, #2]
	ldrsb	w22, [x20, #3]
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _RC_PROTO_BIT_IMON@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RC_PROTO_BIT_IMON@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
Lloh18:
	adrp	x10, _pad_stabilize@GOTPAGE
Lloh19:
	ldr	x10, [x10, _pad_stabilize@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x10, #0, #4, eq
	b.ne	LBB0_10
; %bb.5:
	mov	x0, x22
	bl	_abs
	mov	x21, x0
	mov	x0, x23
	bl	_abs
	cmp	x21, x0
	b.le	LBB0_17
; %bb.6:
	mov	w8, #127
	mov	w9, #32512
	movk	w9, #256, lsl #16
	add	w10, w9, #256
	cmp	w22, #0
LBB0_7:
	csel	w21, w9, w10, gt
	cinv	w8, w8, le
	strb	w8, [x20, #2]
	strb	wzr, [x20, #3]
	b	LBB0_19
LBB0_8:
	mov	w10, #15
	cmp	w8, #0
	csel	w3, w10, w8, eq
	sxtb	w0, w22
	sxtb	w1, w9
	mov	w2, #10
	bl	_stabilize
	cbz	w0, LBB0_13
LBB0_9:
	strh	w0, [x20, #2]
	ldr	w0, [x20]
	bl	_be32_to_cpu
	mov	x21, x0
	b	LBB0_14
LBB0_10:
	ldrb	w8, [x20, #1]
	cbnz	w8, LBB0_14
; %bb.11:
	orr	w8, w23, w22
	cbz	w8, LBB0_14
; %bb.12:
	mov	x0, x23
	mov	x1, x22
	mov	w2, #500
	bl	_stabilize
	cbnz	w0, LBB0_9
LBB0_13:
	add	x20, x19, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh21:
	adrp	x8, _KEY_UNKNOWN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KEY_UNKNOWN@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	b	LBB0_20
LBB0_14:
	cbnz	w21, LBB0_19
; %bb.15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	strb	wzr, [x20, #2]
	cmp	w22, #0
	b	LBB0_18
LBB0_17:
	strb	wzr, [x20, #2]
	cmp	w23, #0
LBB0_18:
	mov	w8, #127
	cinv	w8, w8, le
	strb	w8, [x20, #3]
	mov	w8, #127
	movk	w8, #256, lsl #16
	cinc	w21, w8, le
LBB0_19:
	add	x20, x19, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x21
	bl	_imon_remote_key_lookup
LBB0_20:
	str	x0, [x19, #24]
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.comm	_pad_thresh,4,2                 ; @pad_thresh
	.comm	_RC_PROTO_BIT_IMON,8,3          ; @RC_PROTO_BIT_IMON
	.comm	_pad_stabilize,8,3              ; @pad_stabilize
	.comm	_KEY_UNKNOWN,8,3                ; @KEY_UNKNOWN
	.no_dead_strip	_imon_pad_to_keys
.subsections_via_symbols
