	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w8001_command
_w8001_command:                         ## @w8001_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	$0, (%rdi)
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_init_completion
	movl	12(%rbx), %edi
	movl	%r12d, %esi
	callq	_serio_write
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	movq	(%rbx), %rcx
	movq	_W8001_QUERY_PACKET@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_4
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_W8001_QUERY_PACKET,8,3         ## @W8001_QUERY_PACKET
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_w8001_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w8001_command
_w8001_command:                         ; @w8001_command
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	str	xzr, [x0]
	add	x20, x0, #8
	mov	x0, x20
	bl	_init_completion
	ldr	w0, [x19, #12]
	mov	x1, x22
	bl	_serio_write
	cbz	w21, LBB0_5
; %bb.1:
	cbnz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _W8001_QUERY_PACKET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _W8001_QUERY_PACKET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_W8001_QUERY_PACKET,8,3         ; @W8001_QUERY_PACKET
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_w8001_command
.subsections_via_symbols
