	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applespi_handle_cmd_response
_applespi_handle_cmd_response:          ## @applespi_handle_cmd_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_PACKET_DEV_INFO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	4(%rbx), %edi
	callq	_le16_to_cpu
	cmpl	$4128, %eax                     ## imm = 0x1020
	jne	LBB0_2
## %bb.7:
	movl	12(%rbx), %eax
	movl	%eax, 12(%r14)
	addq	$8, %r14
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_schedule_work                  ## TAILCALL
LBB0_2:
	movl	8(%rbx), %edi
	callq	_le16_to_cpu
	testl	%eax, %eax
	je	LBB0_3
## %bb.8:
	movq	(%r14), %r14
	movl	8(%rbx), %edi
	callq	_le16_to_cpu
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn_ratelimited           ## TAILCALL
LBB0_3:
	movq	(%r15), %rax
	movq	_PACKET_DEV_TPAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movl	4(%rbx), %edi
	callq	_le16_to_cpu
	cmpl	$594, %eax                      ## imm = 0x252
	jne	LBB0_6
## %bb.5:
	movl	(%rbx), %edi
	callq	_le16_to_cpu
	cmpl	$2, %eax
	jne	LBB0_6
## %bb.9:
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_info                       ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PACKET_DEV_INFO,8,3            ## @PACKET_DEV_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Received unexpected write response: length=%x\n"

	.comm	_PACKET_DEV_TPAD,8,3            ## @PACKET_DEV_TPAD
L_.str.1:                               ## @.str.1
	.asciz	"modeswitch done.\n"

	.no_dead_strip	_applespi_handle_cmd_response
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applespi_handle_cmd_response
_applespi_handle_cmd_response:          ; @applespi_handle_cmd_response
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _PACKET_DEV_INFO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PACKET_DEV_INFO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w0, [x20, #4]
	bl	_le16_to_cpu
	mov	w8, #4128
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	w8, [x20, #12]
	str	w8, [x19, #12]
	add	x0, x19, #8
	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
	b	_schedule_work
LBB0_3:
	ldr	w0, [x20, #8]
	bl	_le16_to_cpu
	cbz	w0, LBB0_5
; %bb.4:
	ldr	x19, [x19]
	ldr	w0, [x20, #8]
	bl	_le16_to_cpu
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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
	b	_dev_warn_ratelimited
LBB0_5:
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _PACKET_DEV_TPAD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PACKET_DEV_TPAD@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
	ldr	w0, [x20, #4]
	bl	_le16_to_cpu
	cmp	w0, #594
	b.ne	LBB0_9
; %bb.7:
	ldr	w0, [x20]
	bl	_le16_to_cpu
	cmp	w0, #2
	b.ne	LBB0_9
; %bb.8:
	ldr	x0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	b	_dev_info
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PACKET_DEV_INFO,8,3            ; @PACKET_DEV_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Received unexpected write response: length=%x\n"

	.comm	_PACKET_DEV_TPAD,8,3            ; @PACKET_DEV_TPAD
l_.str.1:                               ; @.str.1
	.asciz	"modeswitch done.\n"

	.no_dead_strip	_applespi_handle_cmd_response
.subsections_via_symbols
