	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_gpio_irq_tx
_ps2_gpio_irq_tx:                       ## @ps2_gpio_irq_tx
	.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
	movb	(%rdi), %r14b
	movb	1(%rdi), %r15b
	movq	_ps2_gpio_irq_tx.old_jiffies(%rip), %rax
	movq	_jiffies@GOTPCREL(%rip), %r12
	movq	(%r12), %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, _ps2_gpio_irq_tx.old_jiffies(%rip)
	movq	%rbx, %rax
LBB0_2:
	subq	%rax, %rbx
	movl	$100, %edi
	callq	_usecs_to_jiffies
	cmpq	%rax, %rbx
	jbe	LBB0_7
## %bb.3:
	movl	12(%r13), %edi
	leaq	L_.str(%rip), %rsi
LBB0_4:
	callq	_dev_err
LBB0_5:
	movq	$0, _ps2_gpio_irq_tx.old_jiffies(%rip)
	movl	8(%r13), %edi
	callq	_gpiod_direction_input
	movl	4(%r13), %edi
	movzbl	1(%r13), %esi
	callq	___ps2_gpio_write
LBB0_6:
	movb	$1, %r14b
	jmp	LBB0_12
LBB0_7:
	movq	(%r12), %rax
	movq	%rax, _ps2_gpio_irq_tx.old_jiffies(%rip)
	leal	-128(%r14), %eax
	cmpb	$12, %al
	ja	LBB0_13
## %bb.8:
	movzbl	%al, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_9:
	leal	-1(%r14), %eax
	movzbl	%al, %edi
	callq	_BIT
	andb	%r15b, %al
	movzbl	%al, %esi
	movl	8(%r13), %edi
LBB0_10:
	callq	_gpiod_set_value
LBB0_11:
	incb	%r14b
LBB0_12:
	movb	%r14b, (%r13)
	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_13:
	movl	8(%r13), %edi
	callq	_gpiod_direction_input
	movl	12(%r13), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_4
LBB0_14:
	movl	8(%r13), %edi
	callq	_gpiod_direction_input
	jmp	LBB0_11
LBB0_15:
	movl	12(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_16:
	movzbl	%r15b, %edi
	callq	_hweight8
	notl	%eax
	andl	$1, %eax
	movl	8(%r13), %edi
	movl	%eax, %esi
	jmp	LBB0_10
LBB0_17:
	movl	8(%r13), %edi
	callq	_gpiod_direction_input
	movl	8(%r13), %edi
	callq	_gpiod_get_value
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movl	12(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_5
LBB0_19:
	movq	_PS2_MODE_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r13)
	leaq	16(%r13), %rdi
	callq	_complete
	movq	$0, _ps2_gpio_irq_tx.old_jiffies(%rip)
	jmp	LBB0_6
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_14
	.long	L0_0_set_15
	.long	L0_0_set_16
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_17
	.end_data_region
                                        ## -- End function
.zerofill __DATA,__bss,_ps2_gpio_irq_tx.old_jiffies,8,3 ## @ps2_gpio_irq_tx.old_jiffies
	.comm	_jiffies,8,3                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TX: timeout, probably we missed an interrupt\n"

L_.str.1:                               ## @.str.1
	.asciz	"TX: start bit should have been sent already\n"

L_.str.2:                               ## @.str.2
	.asciz	"TX: received NACK, retry\n"

	.comm	_PS2_MODE_RX,4,2                ## @PS2_MODE_RX
L_.str.3:                               ## @.str.3
	.asciz	"TX: got out of sync with the device\n"

	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_ps2_gpio_irq_tx
.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_tx
_ps2_gpio_irq_tx:                       ; @ps2_gpio_irq_tx
	.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, x0
	ldrb	w22, [x0]
	ldrb	w20, [x0, #1]
	adrp	x21, _ps2_gpio_irq_tx.old_jiffies@PAGE
	ldr	x9, [x21, _ps2_gpio_irq_tx.old_jiffies@PAGEOFF]
Lloh0:
	adrp	x23, _jiffies@GOTPAGE
Lloh1:
	ldr	x23, [x23, _jiffies@GOTPAGEOFF]
	ldr	x8, [x23]
	cbnz	x9, LBB0_2
; %bb.1:
	str	x8, [x21, _ps2_gpio_irq_tx.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_7
; %bb.3:
	ldr	w0, [x19, #12]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	bl	_dev_err
LBB0_5:
	str	xzr, [x21, _ps2_gpio_irq_tx.old_jiffies@PAGEOFF]
	ldr	w0, [x19, #8]
	bl	_gpiod_direction_input
	ldr	w0, [x19, #4]
	ldrb	w1, [x19, #1]
	bl	___ps2_gpio_write
LBB0_6:
	mov	w8, #1
	b	LBB0_12
LBB0_7:
	ldr	x8, [x23]
	str	x8, [x21, _ps2_gpio_irq_tx.old_jiffies@PAGEOFF]
	sub	w8, w22, #128
	cmp	w8, #12
	b.hi	LBB0_13
; %bb.8:
Lloh4:
	adrp	x9, lJTI0_0@PAGE
Lloh5:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_9
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_9:
	sub	w8, w22, #1
	and	w0, w8, #0xff
	bl	_BIT
	and	w1, w0, w20
LBB0_10:
	ldr	w0, [x19, #8]
	bl	_gpiod_set_value
LBB0_11:
	add	w8, w22, #1
LBB0_12:
	strb	w8, [x19]
Lloh6:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh8:
	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
LBB0_13:
	ldr	w0, [x19, #8]
	bl	_gpiod_direction_input
	ldr	w0, [x19, #12]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_14:
	ldr	w0, [x19, #8]
	bl	_gpiod_direction_input
	b	LBB0_11
LBB0_15:
	ldr	w0, [x19, #12]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_16:
	mov	x0, x20
	bl	_hweight8
	mvn	w8, w0
	and	w1, w8, #0x1
	b	LBB0_10
LBB0_17:
	ldr	w0, [x19, #8]
	bl	_gpiod_direction_input
	ldr	w0, [x19, #8]
	bl	_gpiod_get_value
	cbz	w0, LBB0_19
; %bb.18:
	ldr	w0, [x19, #12]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	b	LBB0_5
LBB0_19:
Lloh15:
	adrp	x8, _PS2_MODE_RX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PS2_MODE_RX@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	add	x0, x19, #16
	bl	_complete
	str	xzr, [x21, _ps2_gpio_irq_tx.old_jiffies@PAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_11-LBB0_9)>>2
	.byte	(LBB0_14-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_16-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_17-LBB0_9)>>2
                                        ; -- End function
.zerofill __DATA,__bss,_ps2_gpio_irq_tx.old_jiffies,8,3 ; @ps2_gpio_irq_tx.old_jiffies
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TX: timeout, probably we missed an interrupt\n"

l_.str.1:                               ; @.str.1
	.asciz	"TX: start bit should have been sent already\n"

l_.str.2:                               ; @.str.2
	.asciz	"TX: received NACK, retry\n"

	.comm	_PS2_MODE_RX,4,2                ; @PS2_MODE_RX
l_.str.3:                               ; @.str.3
	.asciz	"TX: got out of sync with the device\n"

	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_ps2_gpio_irq_tx
.subsections_via_symbols
