	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_gpio_irq_rx
_ps2_gpio_irq_rx:                       ## @ps2_gpio_irq_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	%rdi, %r15
	movb	(%rdi), %r13b
	movzbl	1(%rdi), %r12d
	movq	_ps2_gpio_irq_rx.old_jiffies(%rip), %rax
	movq	_jiffies@GOTPCREL(%rip), %r14
	movq	(%r14), %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, _ps2_gpio_irq_rx.old_jiffies(%rip)
	movq	%rbx, %rax
LBB0_2:
	subq	%rax, %rbx
	movl	$100, %edi
	callq	_usecs_to_jiffies
	cmpq	%rax, %rbx
	jbe	LBB0_5
## %bb.3:
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
LBB0_4:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_5:
	movq	(%r14), %rax
	movq	%rax, _ps2_gpio_irq_rx.old_jiffies(%rip)
	movl	16(%r15), %edi
	callq	_gpiod_get_value
	movl	%eax, %r14d
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movl	8(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movq	$0, _ps2_gpio_irq_rx.old_jiffies(%rip)
	movl	4(%r15), %edi
	movq	_PS2_CMD_RESEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	___ps2_gpio_write
LBB0_8:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
LBB0_24:
	movb	%r12b, 1(%r15)
	movb	%r13b, (%r15)
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leal	125(%r12), %eax
	cmpb	$8, %al
	jae	LBB0_10
## %bb.15:
	testl	%r14d, %r14d
	je	LBB0_23
## %bb.16:
	leal	-1(%r12), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	orb	%r14b, %r13b
LBB0_23:
	incb	%r12b
	jmp	LBB0_24
LBB0_10:
	cmpb	$-128, %r12b
	je	LBB0_25
## %bb.11:
	cmpb	$-126, %r12b
	je	LBB0_17
## %bb.12:
	cmpb	$-127, %r12b
	jne	LBB0_28
## %bb.13:
	movl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_23
## %bb.14:
	movl	8(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_25:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_27
## %bb.26:
	movl	8(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_4
LBB0_17:
	movzbl	%r13b, %ebx
	movl	%ebx, %edi
	callq	_hweight8
	andl	$1, %eax
	cmpl	%r14d, %eax
	jne	LBB0_19
## %bb.18:
	movq	_SERIO_PARITY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	8(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_warn
	cmpl	$0, 12(%r15)
	jne	LBB0_22
	jmp	LBB0_7
LBB0_28:
	movl	8(%r15), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_4
LBB0_19:
	xorl	%r14d, %r14d
	cmpl	$0, 12(%r15)
	je	LBB0_20
LBB0_22:
	movl	4(%r15), %edi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_serio_interrupt
	movl	8(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	jmp	LBB0_23
LBB0_27:
	movq	$0, _ps2_gpio_irq_rx.old_jiffies(%rip)
	jmp	LBB0_8
LBB0_20:
	movq	_PS2_DEV_RET_NACK@GOTPCREL(%rip), %rax
	cmpb	(%rax), %r13b
	je	LBB0_7
## %bb.21:
	movq	_PS2_DEV_RET_ACK@GOTPCREL(%rip), %rax
	cmpb	(%rax), %r13b
	je	LBB0_23
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ps2_gpio_irq_rx.old_jiffies,8,3 ## @ps2_gpio_irq_rx.old_jiffies
	.comm	_jiffies,8,3                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RX: timeout, probably we missed an interrupt\n"

L_.str.1:                               ## @.str.1
	.asciz	"RX: failed to get data gpio val: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"RX: start bit should be low\n"

	.comm	_SERIO_PARITY,4,2               ## @SERIO_PARITY
L_.str.3:                               ## @.str.3
	.asciz	"RX: parity error\n"

	.comm	_PS2_DEV_RET_NACK,1,0           ## @PS2_DEV_RET_NACK
	.comm	_PS2_DEV_RET_ACK,1,0            ## @PS2_DEV_RET_ACK
L_.str.4:                               ## @.str.4
	.asciz	"RX: sending byte 0x%x\n"

L_.str.5:                               ## @.str.5
	.asciz	"RX: stop bit should be high\n"

L_.str.6:                               ## @.str.6
	.asciz	"RX: got out of sync with the device\n"

	.comm	_PS2_CMD_RESEND,4,2             ## @PS2_CMD_RESEND
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_ps2_gpio_irq_rx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2_gpio_irq_rx
_ps2_gpio_irq_rx:                       ; @ps2_gpio_irq_rx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldrb	w20, [x0]
	ldrb	w23, [x0, #1]
	adrp	x22, _ps2_gpio_irq_rx.old_jiffies@PAGE
	ldr	x9, [x22, _ps2_gpio_irq_rx.old_jiffies@PAGEOFF]
Lloh0:
	adrp	x21, _jiffies@GOTPAGE
Lloh1:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	x8, [x21]
	cbnz	x9, LBB0_2
; %bb.1:
	str	x8, [x22, _ps2_gpio_irq_rx.old_jiffies@PAGEOFF]
	mov	x9, x8
LBB0_2:
	sub	x24, x8, x9
	mov	w0, #100
	bl	_usecs_to_jiffies
	cmp	x24, x0
	b.ls	LBB0_4
; %bb.3:
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	x8, [x21]
	str	x8, [x22, _ps2_gpio_irq_rx.old_jiffies@PAGEOFF]
	ldr	w0, [x19, #16]
	bl	_gpiod_get_value
	mov	x21, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_9
; %bb.5:
	ldr	w0, [x19, #8]
	str	x21, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	bl	_dev_err
LBB0_7:
	str	xzr, [x22, _ps2_gpio_irq_rx.old_jiffies@PAGEOFF]
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _PS2_CMD_RESEND@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PS2_CMD_RESEND@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	___ps2_gpio_write
	mov	w8, #0
	mov	w20, #0
LBB0_8:
	strb	w8, [x19, #1]
	strb	w20, [x19]
Lloh9:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	ret
LBB0_9:
	sub	w8, w23, #131
	cmp	w8, #8
	b.hs	LBB0_12
; %bb.10:
	sub	w8, w23, #1
	lsl	w8, w21, w8
	orr	w8, w20, w8
	cmp	w21, #0
	csel	w20, w20, w8, eq
LBB0_11:
	add	w8, w23, #1
	b	LBB0_8
LBB0_12:
	cmp	w23, #128
	b.eq	LBB0_17
; %bb.13:
	cmp	w23, #130
	b.eq	LBB0_19
; %bb.14:
	cmp	w23, #129
	b.ne	LBB0_21
; %bb.15:
	mov	x0, x21
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.16:
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_17:
	cmp	w21, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_25
; %bb.18:
	ldr	w0, [x19, #8]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_19:
	mov	x0, x20
	bl	_hweight8
	and	w8, w0, #0x1
	cmp	w8, w21
	b.ne	LBB0_22
; %bb.20:
Lloh16:
	adrp	x8, _SERIO_PARITY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SERIO_PARITY@GOTPAGEOFF]
Lloh18:
	ldr	w21, [x8]
	ldr	w0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_24
	b	LBB0_7
LBB0_21:
	ldr	w0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.6@PAGE
Lloh22:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_6
LBB0_22:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_26
LBB0_23:
	mov	w21, #0
LBB0_24:
	ldr	w0, [x19, #4]
	mov	x1, x20
	mov	x2, x21
	bl	_serio_interrupt
	ldr	w0, [x19, #8]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	add	w8, w23, #1
	b	LBB0_8
LBB0_25:
	mov	w8, #0
	mov	w20, #0
	str	xzr, [x22, _ps2_gpio_irq_rx.old_jiffies@PAGEOFF]
	b	LBB0_8
LBB0_26:
Lloh25:
	adrp	x8, _PS2_DEV_RET_NACK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PS2_DEV_RET_NACK@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_7
; %bb.27:
Lloh27:
	adrp	x8, _PS2_DEV_RET_ACK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PS2_DEV_RET_ACK@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_11
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ps2_gpio_irq_rx.old_jiffies,8,3 ; @ps2_gpio_irq_rx.old_jiffies
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RX: timeout, probably we missed an interrupt\n"

l_.str.1:                               ; @.str.1
	.asciz	"RX: failed to get data gpio val: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"RX: start bit should be low\n"

	.comm	_SERIO_PARITY,4,2               ; @SERIO_PARITY
l_.str.3:                               ; @.str.3
	.asciz	"RX: parity error\n"

	.comm	_PS2_DEV_RET_NACK,1,0           ; @PS2_DEV_RET_NACK
	.comm	_PS2_DEV_RET_ACK,1,0            ; @PS2_DEV_RET_ACK
l_.str.4:                               ; @.str.4
	.asciz	"RX: sending byte 0x%x\n"

l_.str.5:                               ; @.str.5
	.asciz	"RX: stop bit should be high\n"

l_.str.6:                               ; @.str.6
	.asciz	"RX: got out of sync with the device\n"

	.comm	_PS2_CMD_RESEND,4,2             ; @PS2_CMD_RESEND
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_ps2_gpio_irq_rx
.subsections_via_symbols
