	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function poll_for_response
_poll_for_response:                     ## @poll_for_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rdx
	leaq	-84(%rbp), %rcx
	movq	_FSI_MASTER_MAX_BUSY@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%rcx, %r14
	callq	_read_one_response
	movl	%eax, %ebx
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_6
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_FSI_CRC_ERR_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jg	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	incl	%r12d
	movl	4(%r13), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	movq	%rcx, %rbx
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_trace_fsi_master_gpio_crc_rsp_error
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_build_epoll_command
	callq	_local_irq_save
	movq	_FSI_MASTER_EPOLL_CLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_clock_zeros
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_serial_out
	movq	%r13, %rdi
	callq	_echo_delay
	callq	_local_irq_restore
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rcx
	callq	_read_one_response
	movq	%rbx, %rcx
	movl	%eax, %ebx
	movl	(%rcx), %eax
	addl	%ebx, %eax
	je	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_FSI_MASTER_MAX_BUSY@GOTPCREL(%rip), %r15
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%ebx, %ebx
	jne	LBB0_26
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-84(%rbp), %eax
	cmpl	$130, %eax
	jne	LBB0_8
## %bb.19:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leal	1(%rax), %edx
	cmpl	(%r15), %eax
	jge	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	-80(%rbp), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rbx
	movl	%edx, %r15d
	callq	_build_dpoll_command
	callq	_local_irq_save
	movq	_FSI_MASTER_DPOLL_CLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_clock_zeros
	movq	%r13, %rdi
	leaq	-80(%rbp), %rsi
	callq	_serial_out
	movq	%r13, %rdi
	callq	_echo_delay
	callq	_local_irq_restore
	movl	%r15d, %eax
	movq	%rbx, %r15
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leaq	-48(%rbp), %rdx
	movq	%r14, %rcx
	jmp	LBB0_1
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_8:
	cmpl	$128, %eax
	je	LBB0_23
## %bb.9:
	cmpl	$129, %eax
	je	LBB0_22
## %bb.10:
	xorl	%ebx, %ebx
	cmpl	$131, %eax
	jne	LBB0_24
## %bb.11:
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_24
## %bb.12:
	movq	-96(%rbp), %r10                 ## 8-byte Reload
	testq	%r10, %r10
	je	LBB0_24
## %bb.13:
	movl	-48(%rbp), %edx
	sarl	$4, %edx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	leal	(,%rsi,8), %ecx
	movq	$-1, %rax
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rax
	notl	%eax
	andl	%edx, %eax
	movl	%esi, %r8d
	movl	$-1, %edx
	cmpl	$1, %esi
	je	LBB0_17
## %bb.14:
	movl	%r8d, %r9d
	andl	$-2, %r9d
	xorl	%edx, %edx
	movq	%r8, %rdi
	movq	-64(%rbp), %r11                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	leal	-1(%rdi), %ecx
	movslq	%ecx, %rcx
	movl	%eax, (%r10,%rcx,4)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movl	%edx, %esi
	xorl	$-2, %esi
	addl	%r11d, %esi
	movslq	%esi, %rsi
	movl	%ecx, (%r10,%rsi,4)
	sarl	$16, %eax
	addq	$2, %rdx
	addq	$-2, %rdi
	cmpq	%rdx, %r9
	jne	LBB0_15
## %bb.16:
	notl	%edx
LBB0_17:
	testb	$1, %r8b
	je	LBB0_24
## %bb.18:
	addl	-64(%rbp), %edx                 ## 4-byte Folded Reload
	movslq	%edx, %rcx
	movl	%eax, (%r10,%rcx,4)
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_25
	jmp	LBB0_26
LBB0_23:
	movl	4(%r13), %edi
	movl	-48(%rbp), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%rcx, %r14
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_trace_fsi_master_gpio_crc_cmd_error
	xorl	%ebx, %ebx
	subl	(%r14), %ebx
LBB0_24:
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_25
	jmp	LBB0_26
LBB0_22:
	movl	4(%r13), %edi
	movl	-48(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_25
	jmp	LBB0_26
LBB0_21:
	movl	4(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%edx, %r14d
	callq	_dev_warn
	callq	_local_irq_save
	movq	_FSI_MASTER_DPOLL_CLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_clock_zeros
	callq	_local_irq_restore
	movq	%r13, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_issue_term
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	%r14d, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_25:
	movq	%r13, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_trace_fsi_master_gpio_poll_response_busy
LBB0_26:
	callq	_local_irq_save
	movl	(%r13), %esi
	movq	%r13, %rdi
	callq	_clock_zeros
	callq	_local_irq_restore
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_FSI_CRC_ERR_RETRIES,4,2        ## @FSI_CRC_ERR_RETRIES
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CRC error retry %d\n"

	.comm	_FSI_MASTER_EPOLL_CLOCKS,4,2    ## @FSI_MASTER_EPOLL_CLOCKS
	.comm	_FSI_MASTER_MAX_BUSY,4,2        ## @FSI_MASTER_MAX_BUSY
	.comm	_FSI_MASTER_DPOLL_CLOCKS,4,2    ## @FSI_MASTER_DPOLL_CLOCKS
L_.str.1:                               ## @.str.1
	.asciz	"ERR slave is stuck in busy state, issuing TERM\n"

L_.str.2:                               ## @.str.2
	.asciz	"ERRA received: 0x%x\n"

L_.str.3:                               ## @.str.3
	.asciz	"ERRC received: 0x%x\n"

	.no_dead_strip	_poll_for_response
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function poll_for_response
_poll_for_response:                     ; @poll_for_response
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x3, [sp]                        ; 8-byte Folded Spill
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	mov	w20, #0
	mov	w24, #0
Lloh0:
	adrp	x27, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x27, [x27, _EAGAIN@GOTPAGEOFF]
Lloh2:
	adrp	x28, _FSI_CRC_ERR_RETRIES@GOTPAGE
Lloh3:
	ldr	x28, [x28, _FSI_CRC_ERR_RETRIES@GOTPAGEOFF]
Lloh4:
	adrp	x21, _FSI_MASTER_EPOLL_CLOCKS@GOTPAGE
Lloh5:
	ldr	x21, [x21, _FSI_MASTER_EPOLL_CLOCKS@GOTPAGEOFF]
Lloh6:
	adrp	x25, l_.str@PAGE
Lloh7:
	add	x25, x25, l_.str@PAGEOFF
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #16
	mov	x1, x23
	bl	_build_dpoll_command
	bl	_local_irq_save
Lloh8:
	adrp	x8, _FSI_MASTER_DPOLL_CLOCKS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FSI_MASTER_DPOLL_CLOCKS@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_clock_zeros
	add	x1, sp, #16
	mov	x0, x19
	bl	_serial_out
	mov	x0, x19
	bl	_echo_delay
	bl	_local_irq_restore
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #24
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_read_one_response
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	cmp	w24, w8
	b.gt	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #1
	ldr	w0, [x19, #4]
	mov	x1, x25
	mov	x2, x24
	bl	_dev_dbg
	mov	x0, x19
	bl	_trace_fsi_master_gpio_crc_rsp_error
	add	x0, sp, #16
	mov	x1, x23
	bl	_build_epoll_command
	bl	_local_irq_save
	ldr	w1, [x21]
	b	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, x0
	cbnz	w0, LBB0_24
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, #130
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x9, x20
	add	w20, w20, #1
Lloh11:
	adrp	x8, _FSI_MASTER_MAX_BUSY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FSI_MASTER_MAX_BUSY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w9, w8
	b.lt	LBB0_1
; %bb.9:
	ldr	w0, [x19, #4]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	bl	_local_irq_save
Lloh16:
	adrp	x8, _FSI_MASTER_DPOLL_CLOCKS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FSI_MASTER_DPOLL_CLOCKS@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_clock_zeros
	bl	_local_irq_restore
	mov	x0, x19
	mov	x1, x23
	bl	_issue_term
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_23
LBB0_10:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_24
LBB0_11:
	cmp	w8, #128
	b.eq	LBB0_19
; %bb.12:
	cmp	w8, #129
	b.eq	LBB0_20
; %bb.13:
	cmp	w8, #131
	b.ne	LBB0_18
; %bb.14:
	mov	w26, #0
	cmp	w22, #1
	b.lt	LBB0_22
; %bb.15:
	ldr	x11, [sp]                       ; 8-byte Folded Reload
	cbz	x11, LBB0_22
; %bb.16:
	ldr	w8, [sp, #24]
	lsl	w9, w22, #3
	mov	x10, #-1
	lsl	x9, x10, x9
	mvn	w9, w9
	and	w8, w9, w8, asr #4
	mov	w9, w22
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	subs	x9, x9, #1
	str	w8, [x11, w9, sxtw #2]
	asr	w8, w8, #8
	b.ne	LBB0_17
LBB0_18:
	mov	w26, #0
	b	LBB0_22
LBB0_19:
	ldr	w0, [x19, #4]
	ldr	w2, [sp, #24]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	bl	_trace_fsi_master_gpio_crc_cmd_error
	ldr	w8, [x27]
	b	LBB0_21
LBB0_20:
	ldr	w0, [x19, #4]
	ldr	w2, [sp, #24]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh29:
	adrp	x8, _EIO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
LBB0_21:
	neg	w26, w8
LBB0_22:
	cbz	w20, LBB0_24
LBB0_23:
	mov	x0, x19
	mov	x1, x20
	bl	_trace_fsi_master_gpio_poll_response_busy
LBB0_24:
	bl	_local_irq_save
	ldr	w1, [x19]
	mov	x0, x19
	bl	_clock_zeros
	bl	_local_irq_restore
	mov	x0, x26
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_FSI_CRC_ERR_RETRIES,4,2        ; @FSI_CRC_ERR_RETRIES
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CRC error retry %d\n"

	.comm	_FSI_MASTER_EPOLL_CLOCKS,4,2    ; @FSI_MASTER_EPOLL_CLOCKS
	.comm	_FSI_MASTER_MAX_BUSY,4,2        ; @FSI_MASTER_MAX_BUSY
	.comm	_FSI_MASTER_DPOLL_CLOCKS,4,2    ; @FSI_MASTER_DPOLL_CLOCKS
l_.str.1:                               ; @.str.1
	.asciz	"ERR slave is stuck in busy state, issuing TERM\n"

l_.str.2:                               ; @.str.2
	.asciz	"ERRA received: 0x%x\n"

l_.str.3:                               ; @.str.3
	.asciz	"ERRC received: 0x%x\n"

	.no_dead_strip	_poll_for_response
.subsections_via_symbols
