	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps2_handle_response            ## -- Begin function ps2_handle_response
	.p2align	4, 0x90
_ps2_handle_response:                   ## @ps2_handle_response
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movslq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	16(%rbx), %rcx
	leaq	-1(%rax), %rdx
	movl	%edx, (%rbx)
	movl	%esi, -4(%rcx,%rax,4)
LBB0_2:
	movl	4(%rbx), %eax
	movq	_PS2_FLAG_CMD1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_5
## %bb.3:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, 4(%rbx)
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.4:
	leaq	8(%rbx), %rdi
	callq	_wake_up
LBB0_5:
	cmpl	$0, (%rbx)
	jne	LBB0_8
## %bb.6:
	movl	4(%rbx), %eax
LBB0_7:
	movq	_PS2_FLAG_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, 4(%rbx)
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_wake_up
LBB0_8:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS2_FLAG_CMD1,4,2              ## @PS2_FLAG_CMD1
	.comm	_PS2_FLAG_CMD,4,2               ## @PS2_FLAG_CMD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps2_handle_response            ; -- Begin function ps2_handle_response
	.p2align	2
_ps2_handle_response:                   ; @ps2_handle_response
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x9, [x19, #16]
	sub	w8, w8, #1
	str	w8, [x19]
	str	w1, [x9, w8, sxtw #2]
LBB0_2:
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x9, _PS2_FLAG_CMD1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PS2_FLAG_CMD1@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	bic	w8, w8, w9
	str	w8, [x19, #4]
	ldr	w9, [x19]
	cbz	w9, LBB0_7
; %bb.4:
	add	x0, x19, #8
	bl	_wake_up
LBB0_5:
	ldr	w8, [x19]
	cbnz	w8, LBB0_8
; %bb.6:
	ldr	w8, [x19, #4]
LBB0_7:
Lloh3:
	adrp	x9, _PS2_FLAG_CMD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PS2_FLAG_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19, #4]
	add	x0, x19, #8
	bl	_wake_up
LBB0_8:
	mov	w0, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PS2_FLAG_CMD1,4,2              ; @PS2_FLAG_CMD1
	.comm	_PS2_FLAG_CMD,4,2               ; @PS2_FLAG_CMD
.subsections_via_symbols
