	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_one_response
_read_one_response:                     ## @read_one_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r13
	callq	_local_irq_save
	movq	_FSI_MASTER_MTOE_COUNT@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_4
## %bb.1:
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, -48(%rbp)
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_serial_in
	cmpl	$0, -44(%rbp)
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	jl	LBB0_2
LBB0_4:
	cmpl	%eax, %ebx
	jne	LBB0_7
LBB0_5:
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	callq	_local_irq_restore
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_6:
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	je	LBB0_5
LBB0_7:
	movq	$0, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	movl	$4, %edx
	callq	_serial_in
	movl	-44(%rbp), %r14d
	andl	$3, %r14d
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.8:
	movq	_FSI_RESP_ACK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_10
## %bb.9:
	shll	$3, %r12d
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_serial_in
LBB0_10:
	movq	_FSI_CRC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_serial_in
	callq	_local_irq_restore
	xorl	%edi, %edi
	movl	$1, %esi
	movl	$1, %edx
	callq	_crc4
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %esi
	movq	%rax, %rdi
	callq	_crc4
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movl	-48(%rbp), %ecx
	movq	$-1, %rax
	shlq	%cl, %rax
	movslq	-44(%rbp), %rdx
	movq	%rdx, %rsi
	notq	%rsi
	notq	%rax
	testq	%rsi, %rax
	je	LBB0_17
## %bb.12:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_13:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.14:
	movq	-48(%rbp), %rax
	movq	%rax, (%rcx)
LBB0_15:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:
	movl	%r14d, (%rax)
	jmp	LBB0_19
LBB0_17:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_18:
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FSI_MASTER_MTOE_COUNT,4,2      ## @FSI_MASTER_MTOE_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Master time out waiting for response\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_FSI_RESP_ACK,4,2               ## @FSI_RESP_ACK
	.comm	_FSI_CRC_SIZE,4,2               ## @FSI_CRC_SIZE
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"ERR response CRC msg: 0x%016llx (%d bits)\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_read_one_response
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_one_response
_read_one_response:                     ; @read_one_response
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_local_irq_save
Lloh0:
	adrp	x24, _FSI_MASTER_MTOE_COUNT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _FSI_MASTER_MTOE_COUNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [sp, #24]
	add	x1, sp, #24
	mov	x0, x19
	mov	w2, #1
	bl	_serial_in
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w23, #1
	ldr	w8, [x24]
	cmp	w23, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	cmp	w23, w8
	b.ne	LBB0_8
LBB0_6:
	ldr	w0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	bl	_local_irq_restore
Lloh4:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_19
LBB0_7:
	ldr	w8, [x24]
	cmp	w23, w8
	b.eq	LBB0_6
LBB0_8:
	str	xzr, [sp, #24]
	add	x1, sp, #24
	mov	x0, x19
	mov	w2, #4
	bl	_serial_in
	ldr	w8, [sp, #28]
	and	w23, w8, #0x3
	cbz	w22, LBB0_11
; %bb.9:
Lloh6:
	adrp	x8, _FSI_RESP_ACK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FSI_RESP_ACK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_11
; %bb.10:
	lsl	w2, w22, #3
	add	x1, sp, #24
	mov	x0, x19
	bl	_serial_in
LBB0_11:
Lloh9:
	adrp	x8, _FSI_CRC_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FSI_CRC_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x1, sp, #24
	mov	x0, x19
	bl	_serial_in
	bl	_local_irq_restore
	mov	x0, #0
	mov	w1, #1
	mov	w2, #1
	bl	_crc4
	ldp	w2, w1, [sp, #24]
	bl	_crc4
	cbz	x0, LBB0_14
; %bb.12:
	ldp	w9, w8, [sp, #24]
	mvn	w10, w8
	sxtw	x10, w10
	mov	x11, #-1
	lsl	x11, x11, x9
	bics	xzr, x10, x11
	b.eq	LBB0_18
; %bb.13:
	ldr	w0, [x19]
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	stp	x8, x9, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh14:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_19
LBB0_14:
	cbz	x21, LBB0_16
; %bb.15:
	ldr	x8, [sp, #24]
	str	x8, [x21]
LBB0_16:
	mov	w0, #0
	cbz	x20, LBB0_20
; %bb.17:
	str	w23, [x20]
	b	LBB0_20
LBB0_18:
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FSI_MASTER_MTOE_COUNT,4,2      ; @FSI_MASTER_MTOE_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Master time out waiting for response\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_FSI_RESP_ACK,4,2               ; @FSI_RESP_ACK
	.comm	_FSI_CRC_SIZE,4,2               ; @FSI_CRC_SIZE
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"ERR response CRC msg: 0x%016llx (%d bits)\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_read_one_response
.subsections_via_symbols
