	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atkbd_probe
_atkbd_probe:                           ## @atkbd_probe
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	16(%rdi), %rbx
	movq	_atkbd_reset@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_ATKBD_CMD_RESET_BAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%rbx), %rdi
	movl	4(%rdi), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_3:
	movw	$-23131, -26(%rbp)              ## imm = 0xA5A5
	movq	_ATKBD_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-26(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movb	$0, -26(%rbp)
	movq	_ATKBD_CMD_SETLEDS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-26(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ps2_command
	movl	$-1, %r15d
	testq	%rax, %rax
	jne	LBB0_12
## %bb.5:
	movl	$43962, (%r14)                  ## imm = 0xABBA
	xorl	%r15d, %r15d
	jmp	LBB0_12
LBB0_6:
	movzbl	-26(%rbp), %edi
	callq	_ps2_is_keyboard_id
	movl	$-1, %r15d
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:
	movzwl	-26(%rbp), %eax
	rolw	$8, %ax
	movzwl	%ax, %eax
	movl	%eax, (%r14)
	cmpl	$44193, %eax                    ## imm = 0xACA1
	jne	LBB0_10
## %bb.8:
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.9:
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_12
LBB0_10:
	movq	_atkbd_skip_deactivate@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	$0, (%rax)
	jne	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	_atkbd_deactivate
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_atkbd_reset,8,3                ## @atkbd_reset
	.comm	_ATKBD_CMD_RESET_BAT,4,2        ## @ATKBD_CMD_RESET_BAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"keyboard reset failed on %s\n"

	.comm	_ATKBD_CMD_GETID,4,2            ## @ATKBD_CMD_GETID
	.comm	_ATKBD_CMD_SETLEDS,4,2          ## @ATKBD_CMD_SETLEDS
L_.str.1:                               ## @.str.1
	.asciz	"NCD terminal keyboards are only supported on non-translating controllers. Use i8042.direct=1 to disable translation.\n"

	.comm	_atkbd_skip_deactivate,4,2      ## @atkbd_skip_deactivate
	.no_dead_strip	_atkbd_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atkbd_probe
_atkbd_probe:                           ; @atkbd_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x20, x0, #16
Lloh0:
	adrp	x8, _atkbd_reset@GOTPAGE
Lloh1:
	ldr	x8, [x8, _atkbd_reset@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _ATKBD_CMD_RESET_BAT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATKBD_CMD_RESET_BAT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, #0
	bl	_ps2_command
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x0, [x20]
	ldr	w2, [x0, #4]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_3:
	mov	w8, #42405
	strh	w8, [sp, #14]
Lloh8:
	adrp	x8, _ATKBD_CMD_GETID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATKBD_CMD_GETID@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x1, sp, #14
	mov	x0, x20
	bl	_ps2_command
	cbz	x0, LBB0_6
; %bb.4:
	strb	wzr, [sp, #14]
Lloh11:
	adrp	x8, _ATKBD_CMD_SETLEDS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ATKBD_CMD_SETLEDS@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	add	x1, sp, #14
	mov	x0, x20
	bl	_ps2_command
	cbnz	x0, LBB0_10
; %bb.5:
	mov	w8, #43962
	str	w8, [x19]
	b	LBB0_14
LBB0_6:
	ldrb	w0, [sp, #14]
	bl	_ps2_is_keyboard_id
	cbz	w0, LBB0_10
; %bb.7:
	ldrh	w8, [sp, #14]
	rev16	w8, w8
	str	w8, [x19]
	mov	w9, #44193
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.8:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.9:
	ldr	x0, [x20]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_10:
	mov	w0, #-1
	b	LBB0_14
LBB0_11:
Lloh16:
	adrp	x8, _atkbd_skip_deactivate@GOTPAGE
Lloh17:
	ldr	x8, [x8, _atkbd_skip_deactivate@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cbnz	w8, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_atkbd_deactivate
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_atkbd_reset,8,3                ; @atkbd_reset
	.comm	_ATKBD_CMD_RESET_BAT,4,2        ; @ATKBD_CMD_RESET_BAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"keyboard reset failed on %s\n"

	.comm	_ATKBD_CMD_GETID,4,2            ; @ATKBD_CMD_GETID
	.comm	_ATKBD_CMD_SETLEDS,4,2          ; @ATKBD_CMD_SETLEDS
l_.str.1:                               ; @.str.1
	.asciz	"NCD terminal keyboards are only supported on non-translating controllers. Use i8042.direct=1 to disable translation.\n"

	.comm	_atkbd_skip_deactivate,4,2      ; @atkbd_skip_deactivate
	.no_dead_strip	_atkbd_probe
.subsections_via_symbols
