	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i8042_flush
_i8042_flush:                           ## @i8042_flush
	.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	_i8042_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_i8042_read_status
	movl	%eax, %ebx
	movq	_I8042_STR_OBF@GOTPCREL(%rip), %rax
	testb	%bl, (%rax)
	je	LBB0_7
## %bb.1:
	movq	_I8042_BUFFER_SIZE@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.2:
	xorl	%r15d, %r15d
	movq	_I8042_STR_AUXDATA@GOTPCREL(%rip), %r12
	leaq	L_.str.2(%rip), %r13
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_udelay
	xorl	%eax, %eax
	callq	_i8042_read_data
	incl	%r15d
	movq	%r13, %rdx
	andb	(%r12), %bl
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.1(%rip), %rdx
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %esi
	movq	%r14, %rdi
	callq	_dbg
	xorl	%eax, %eax
	callq	_i8042_read_status
	movl	%eax, %ebx
	movq	_I8042_STR_OBF@GOTPCREL(%rip), %rax
	testb	%bl, (%rax)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_I8042_BUFFER_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_3
LBB0_7:
	movq	_i8042_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i8042_lock,4,2                 ## @i8042_lock
	.comm	_I8042_STR_OBF,1,0              ## @I8042_STR_OBF
	.comm	_I8042_BUFFER_SIZE,4,2          ## @I8042_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%02x <- i8042 (flush, %s)"

	.comm	_I8042_STR_AUXDATA,1,0          ## @I8042_STR_AUXDATA
L_.str.1:                               ## @.str.1
	.asciz	"aux"

L_.str.2:                               ## @.str.2
	.asciz	"kbd"

	.no_dead_strip	_i8042_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i8042_flush
_i8042_flush:                           ; @i8042_flush
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x0, _i8042_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _i8042_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	bl	_i8042_read_status
Lloh2:
	adrp	x22, _I8042_STR_OBF@GOTPAGE
Lloh3:
	ldr	x22, [x22, _I8042_STR_OBF@GOTPAGEOFF]
	ldrb	w8, [x22]
	and	w8, w8, w0
Lloh4:
	adrp	x23, _I8042_BUFFER_SIZE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _I8042_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, #0
	ccmp	w9, #1, #8, ne
	b.ge	LBB0_2
; %bb.1:
	mov	w19, #0
	b	LBB0_4
LBB0_2:
	mov	x20, x0
	mov	w19, #0
Lloh6:
	adrp	x24, _I8042_STR_AUXDATA@GOTPAGE
Lloh7:
	ldr	x24, [x24, _I8042_STR_AUXDATA@GOTPAGEOFF]
Lloh8:
	adrp	x25, l_.str.1@PAGE
Lloh9:
	add	x25, x25, l_.str.1@PAGEOFF
Lloh10:
	adrp	x26, l_.str.2@PAGE
Lloh11:
	add	x26, x26, l_.str.2@PAGEOFF
Lloh12:
	adrp	x21, l_.str@PAGE
Lloh13:
	add	x21, x21, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_udelay
	bl	_i8042_read_data
	mov	x1, x0
	add	w19, w19, #1
	ldrb	w8, [x24]
	tst	w8, w20
	csel	x2, x26, x25, eq
	mov	x0, x21
	bl	_dbg
	bl	_i8042_read_status
	mov	x20, x0
	ldrb	w8, [x22]
	and	w8, w8, w0
	ldr	w9, [x23]
	cmp	w8, #0
	ccmp	w19, w9, #0, ne
	b.lt	LBB0_3
LBB0_4:
Lloh14:
	adrp	x0, _i8042_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _i8042_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_i8042_lock,4,2                 ; @i8042_lock
	.comm	_I8042_STR_OBF,1,0              ; @I8042_STR_OBF
	.comm	_I8042_BUFFER_SIZE,4,2          ; @I8042_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%02x <- i8042 (flush, %s)"

	.comm	_I8042_STR_AUXDATA,1,0          ; @I8042_STR_AUXDATA
l_.str.1:                               ; @.str.1
	.asciz	"aux"

l_.str.2:                               ; @.str.2
	.asciz	"kbd"

	.no_dead_strip	_i8042_flush
.subsections_via_symbols
