	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elantech_ps2_command
_elantech_ps2_command:                  ## @elantech_ps2_command
	.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
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%rdi), %r12
	movq	_ETP_PS2_COMMAND_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	incl	%r13d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_ps2_command
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-2(%r13), %edx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_elantech_debug
	movq	_ETP_PS2_COMMAND_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	decl	%r13d
	cmpl	$1, %r13d
	jg	LBB0_1
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_psmouse_err
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_PS2_COMMAND_TRIES,4,2      ## @ETP_PS2_COMMAND_TRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"retrying ps2 command 0x%02x (%d).\n"

	.comm	_ETP_PS2_COMMAND_DELAY,4,2      ## @ETP_PS2_COMMAND_DELAY
L_.str.1:                               ## @.str.1
	.asciz	"ps2 command 0x%02x failed.\n"

	.no_dead_strip	_elantech_ps2_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elantech_ps2_command
_elantech_ps2_command:                  ; @elantech_ps2_command
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	add	x22, x0, #8
Lloh0:
	adrp	x8, _ETP_PS2_COMMAND_TRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETP_PS2_COMMAND_TRIES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w25, w8, #1
Lloh3:
	adrp	x23, l_.str@PAGE
Lloh4:
	add	x23, x23, l_.str@PAGEOFF
Lloh5:
	adrp	x26, _ETP_PS2_COMMAND_DELAY@GOTPAGE
Lloh6:
	ldr	x26, [x26, _ETP_PS2_COMMAND_DELAY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	bl	_ps2_command
	mov	x24, x0
	cbz	w0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w2, w25, #2
	mov	x0, x23
	mov	x1, x19
	bl	_elantech_debug
	ldr	w0, [x26]
	bl	_msleep
	sub	w25, w25, #1
	cmp	w25, #1
	b.gt	LBB0_1
; %bb.3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_psmouse_err
LBB0_4:
	mov	x0, x24
	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	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_PS2_COMMAND_TRIES,4,2      ; @ETP_PS2_COMMAND_TRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"retrying ps2 command 0x%02x (%d).\n"

	.comm	_ETP_PS2_COMMAND_DELAY,4,2      ; @ETP_PS2_COMMAND_DELAY
l_.str.1:                               ; @.str.1
	.asciz	"ps2 command 0x%02x failed.\n"

	.no_dead_strip	_elantech_ps2_command
.subsections_via_symbols
