	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_imon_decode_scancode
_ir_imon_decode_scancode:               ## @ir_imon_decode_scancode
	.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	%rdi, %r13
	movq	8(%rdi), %rbx
	movl	(%rbx), %edx
	cmpl	$697374135, %edx                ## imm = 0x299115B7
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	sete	%al
	movl	%eax, 4(%rbx)
	movl	$697374135, %edx                ## imm = 0x299115B7
	jmp	LBB0_9
LBB0_2:
	movl	%edx, %eax
	andl	$-67108609, %eax                ## imm = 0xFC0000FF
	cmpl	$1744830647, %eax               ## imm = 0x680000B7
	jne	LBB0_9
## %bb.3:
	movl	%edx, %eax
	shrl	$16, %eax
	andl	$8, %eax
	movl	%edx, %ecx
	shrl	$18, %ecx
	andl	$4, %ecx
	orl	%eax, %ecx
	movl	%edx, %eax
	shrl	$20, %eax
	andl	$2, %eax
	orl	%ecx, %eax
	movl	%edx, %ecx
	shrl	$22, %ecx
	andl	$1, %ecx
	leal	(%rax,%rcx), %esi
	testl	$33554432, %edx                 ## imm = 0x2000000
	leal	-16(%rcx,%rax), %r14d
	cmovel	%esi, %r14d
	movl	%edx, %eax
	shrl	$8, %eax
	andl	$8, %eax
	movl	%edx, %ecx
	shrl	$10, %ecx
	andl	$4, %ecx
	orl	%eax, %ecx
	movl	%edx, %eax
	shrl	$12, %eax
	andl	$2, %eax
	orl	%ecx, %eax
	movl	%edx, %ecx
	shrl	$14, %ecx
	andl	$1, %ecx
	leal	(%rax,%rcx), %esi
	testl	$16777216, %edx                 ## imm = 0x1000000
	leal	-16(%rcx,%rax), %r15d
	cmovel	%esi, %r15d
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.4:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.5:
	cmpl	$0, 4(%rbx)
	je	LBB0_7
## %bb.6:
	movl	%r15d, %edi
	callq	_abs
	movq	%rax, %r12
	movl	%r14d, %edi
	callq	_abs
	testl	%r15d, %r15d
	movl	$680859063, %ecx                ## imm = 0x289515B7
	movl	$715462071, %esi                ## imm = 0x2AA515B7
	cmovgl	%ecx, %esi
	xorl	%edx, %edx
	testl	%r14d, %r14d
	setg	%dl
	shll	$25, %edx
	orl	$698684855, %edx                ## imm = 0x29A515B7
	cmpq	%rax, %r12
	cmovgl	%esi, %edx
	movl	%edx, (%rbx)
LBB0_7:
	cmpl	$0, 4(%rbx)
	jne	LBB0_9
## %bb.8:
	movl	(%r13), %edi
	movq	_REL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_input_report_rel
	movl	(%r13), %edi
	movq	_REL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_input_report_rel
	movl	(%r13), %edi
	movq	_BTN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	shrl	$16, %edx
	andl	$1, %edx
	callq	_input_report_key
	movl	(%r13), %edi
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	shrl	$18, %edx
	andl	$1, %edx
	callq	_input_report_key
	movl	(%rbx), %edx
LBB0_9:
	movq	_RC_PROTO_IMON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keydown                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.comm	_RC_PROTO_IMON,4,2              ## @RC_PROTO_IMON
	.no_dead_strip	_ir_imon_decode_scancode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ir_imon_decode_scancode
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967286                      ; 0xfffffff6
lCPI0_1:
	.long	4294967278                      ; 0xffffffee
	.long	4294967288                      ; 0xfffffff8
lCPI0_2:
	.long	4294967276                      ; 0xffffffec
	.long	4294967284                      ; 0xfffffff4
lCPI0_3:
	.long	4294967274                      ; 0xffffffea
	.long	4294967282                      ; 0xfffffff2
lCPI0_4:
	.long	33554432                        ; 0x2000000
	.long	16777216                        ; 0x1000000
lCPI0_5:
	.long	4                               ; 0x4
	.long	8                               ; 0x8
lCPI0_6:
	.long	8                               ; 0x8
	.long	4                               ; 0x4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ir_imon_decode_scancode:               ; @ir_imon_decode_scancode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	mov	w22, #5559
	movk	w22, #10641, lsl #16
	ldr	x21, [x0, #8]
	ldr	w2, [x21]
	cmp	w2, w22
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x21, #4]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x21, #4]
	mov	w2, #5559
	movk	w2, #10641, lsl #16
	b	LBB0_8
LBB0_2:
	and	w8, w2, #0xfc0000ff
	mov	w9, #183
	movk	w9, #26624, lsl #16
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.3:
	dup.2s	v0, w2
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
	ushl.2s	v1, v0, v1
Lloh2:
	adrp	x8, lCPI0_1@PAGE
Lloh3:
	ldr	d2, [x8, lCPI0_1@PAGEOFF]
	ushl.2s	v2, v0, v2
Lloh4:
	adrp	x8, lCPI0_2@PAGE
Lloh5:
	ldr	d3, [x8, lCPI0_2@PAGEOFF]
	ushl.2s	v3, v0, v3
Lloh6:
	adrp	x8, lCPI0_3@PAGE
Lloh7:
	ldr	d4, [x8, lCPI0_3@PAGEOFF]
	ushl.2s	v4, v0, v4
Lloh8:
	adrp	x8, lCPI0_4@PAGE
Lloh9:
	ldr	d5, [x8, lCPI0_4@PAGEOFF]
	and.8b	v0, v0, v5
Lloh10:
	adrp	x8, lCPI0_5@PAGE
Lloh11:
	ldr	d5, [x8, lCPI0_5@PAGEOFF]
	and.8b	v2, v2, v5
Lloh12:
	adrp	x8, lCPI0_6@PAGE
Lloh13:
	ldr	d5, [x8, lCPI0_6@PAGEOFF]
	and.8b	v1, v1, v5
	orr.8b	v1, v2, v1
	movi.2s	v2, #2
	and.8b	v2, v3, v2
	orr.8b	v1, v1, v2
	movi.2s	v2, #1
	and.8b	v2, v4, v2
	orr.8b	v1, v1, v2
	cmeq.2s	v0, v0, #0
	mvni.2s	v2, #15
	orr.8b	v2, v1, v2
	bif.8b	v1, v2, v0
	cmtst.2s	v0, v1, v1
	mov.s	w8, v0[1]
	fmov	w9, s0
	and	w8, w9, w8
	tbz	w8, #0, LBB0_6
; %bb.4:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_6
; %bb.5:
	mov.s	w0, v1[1]
	str	q1, [sp]                        ; 16-byte Folded Spill
	bl	_abs
	mov	x20, x0
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	fmov	w0, s0
	bl	_abs
	ldr	q1, [sp]                        ; 16-byte Folded Reload
	cmgt.2s	v0, v1, #0
	mov.s	w8, v0[1]
	sub	w9, w22, #4032, lsl #12         ; =16515072
	tst	w8, #0x1
	mov	w8, #5559
	movk	w8, #10917, lsl #16
	csel	w8, w9, w8, ne
	fmov	w9, s0
	tst	w9, #0x1
	mov	w9, #5559
	movk	w9, #10661, lsl #16
	mov	w10, #5559
	movk	w10, #11173, lsl #16
	csel	w9, w10, w9, ne
	cmp	x20, x0
	csel	w2, w8, w9, gt
	str	w2, [x21]
LBB0_6:
	ldr	w8, [x21, #4]
	cbnz	w8, LBB0_8
; %bb.7:
	ldr	w0, [x19]
Lloh14:
	adrp	x8, _REL_X@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	fmov	w2, s1
	str	q1, [sp]                        ; 16-byte Folded Spill
	bl	_input_report_rel
	ldr	w0, [x19]
Lloh17:
	adrp	x8, _REL_Y@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	mov.s	w2, v0[1]
	bl	_input_report_rel
	ldr	w0, [x19]
Lloh20:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w8, [x21]
	ubfx	w2, w8, #16, #1
	bl	_input_report_key
	ldr	w0, [x19]
Lloh23:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w8, [x21]
	ubfx	w2, w8, #18, #1
	bl	_input_report_key
	ldr	w2, [x21]
LBB0_8:
Lloh26:
	adrp	x8, _RC_PROTO_IMON@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RC_PROTO_IMON@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #0
	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
	add	sp, sp, #64
	b	_rc_keydown
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpAdrp	Lloh10, Lloh12
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpAdrp	Lloh8, Lloh10
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdrp	Lloh6, Lloh8
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpAdrp	Lloh4, Lloh6
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdrp	Lloh2, Lloh4
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.comm	_RC_PROTO_IMON,4,2              ; @RC_PROTO_IMON
	.no_dead_strip	_ir_imon_decode_scancode
.subsections_via_symbols
