	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function olpc_apsp_rx
_olpc_apsp_rx:                          ## @olpc_apsp_rx
	.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	_PJ_RST_INTERRUPT@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%rsi), %rdi
	callq	_readl
	movq	_SP_COMMAND_COMPLETE_RESET@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_1
## %bb.2:
	movl	%eax, %r14d
	movq	_COMMAND_RETURN_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	_PORT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	shrl	%cl, %eax
	movq	_KEYBOARD_PORT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	%rax, (%rcx)
	sete	%dl
	movq	16(%r15,%rdx,8), %rdi
	movq	_DATA_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_serio_interrupt
	orl	(%r13), %r14d
	movq	(%r12), %rsi
	addq	8(%r15), %rsi
	movl	%r14d, %edi
	callq	_writel
	movq	_PORT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SECURE_PROCESSOR_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_writel
	movl	(%r15), %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_pm_wakeup_event
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PJ_RST_INTERRUPT,8,3           ## @PJ_RST_INTERRUPT
	.comm	_SP_COMMAND_COMPLETE_RESET,4,2  ## @SP_COMMAND_COMPLETE_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"spurious interrupt?\n"

	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_COMMAND_RETURN_STATUS,8,3      ## @COMMAND_RETURN_STATUS
L_.str.1:                               ## @.str.1
	.asciz	"olpc_apsp_rx %x\n"

	.comm	_PORT_SHIFT,8,3                 ## @PORT_SHIFT
	.comm	_KEYBOARD_PORT,8,3              ## @KEYBOARD_PORT
	.comm	_DATA_MASK,4,2                  ## @DATA_MASK
	.comm	_PORT_MASK,4,2                  ## @PORT_MASK
	.comm	_SECURE_PROCESSOR_COMMAND,8,3   ## @SECURE_PROCESSOR_COMMAND
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_olpc_apsp_rx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function olpc_apsp_rx
_olpc_apsp_rx:                          ; @olpc_apsp_rx
	.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	x19, x1
	ldr	x8, [x1, #8]
Lloh0:
	adrp	x22, _PJ_RST_INTERRUPT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PJ_RST_INTERRUPT@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
Lloh2:
	adrp	x23, _SP_COMMAND_COMPLETE_RESET@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SP_COMMAND_COMPLETE_RESET@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	x8, [x19, #8]
Lloh4:
	adrp	x9, _COMMAND_RETURN_STATUS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _COMMAND_RETURN_STATUS@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
Lloh9:
	adrp	x8, _PORT_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PORT_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _KEYBOARD_PORT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KEYBOARD_PORT@GOTPAGEOFF]
	lsr	w8, w21, w8
Lloh14:
	ldr	x9, [x9]
	mov	w10, #16
	mov	w11, #24
	cmp	x9, x8
	csel	x8, x11, x10, eq
	ldr	x0, [x19, x8]
Lloh15:
	adrp	x8, _DATA_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DATA_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w1, w8, w21
	mov	w2, #0
	bl	_serio_interrupt
	ldr	w8, [x23]
	orr	w0, w8, w20
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
Lloh18:
	adrp	x8, _PORT_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PORT_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh21:
	adrp	x9, _SECURE_PROCESSOR_COMMAND@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SECURE_PROCESSOR_COMMAND@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19]
	mov	w1, #1000
	bl	_pm_wakeup_event
Lloh24:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh28:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
LBB0_3:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_PJ_RST_INTERRUPT,8,3           ; @PJ_RST_INTERRUPT
	.comm	_SP_COMMAND_COMPLETE_RESET,4,2  ; @SP_COMMAND_COMPLETE_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spurious interrupt?\n"

	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_COMMAND_RETURN_STATUS,8,3      ; @COMMAND_RETURN_STATUS
l_.str.1:                               ; @.str.1
	.asciz	"olpc_apsp_rx %x\n"

	.comm	_PORT_SHIFT,8,3                 ; @PORT_SHIFT
	.comm	_KEYBOARD_PORT,8,3              ; @KEYBOARD_PORT
	.comm	_DATA_MASK,4,2                  ; @DATA_MASK
	.comm	_PORT_MASK,4,2                  ; @PORT_MASK
	.comm	_SECURE_PROCESSOR_COMMAND,8,3   ; @SECURE_PROCESSOR_COMMAND
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_olpc_apsp_rx
.subsections_via_symbols
