	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsi_slave_scan
_fsi_slave_scan:                        ## @fsi_slave_scan
	.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	_engine_page_size@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	cmpl	$12, %ecx
	jb	LBB0_15
## %bb.1:
	movq	%rdi, %r15
	leal	(%rcx,%rcx,2), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$2, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$12, %ebx
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	leaq	-72(%rbp), %rdx
	movl	$4, %ecx
	callq	_fsi_slave_read
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-72(%rbp), %edi
	callq	_be32_to_cpu
	movl	%eax, %r14d
	xorl	%edi, %edi
	movl	%eax, %esi
	movl	$32, %edx
	callq	_crc4
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movq	_FSI_SLAVE_CONF_SLOTS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	%r14d, %r12d
	movq	_FSI_SLAVE_CONF_SLOTS_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %r12d
	movq	_FSI_SLAVE_CONF_VERSION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	%r14d, %r13d
	movq	_FSI_SLAVE_CONF_VERSION_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %r13d
	movq	_FSI_SLAVE_CONF_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	%r14d, %ebx
	movq	_FSI_SLAVE_CONF_TYPE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %ebx
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%r12d, %r12d
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_fsi_create_device
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r15
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r15)
	movl	%ebx, (%r15)
	movl	%r13d, 4(%r15)
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, 8(%r15)
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	movl	%r9d, 12(%r15)
	movq	_engine_page_size@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r12d, %eax
	movl	%eax, 16(%r15)
	movl	%eax, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%ebx, %ecx
	movl	%r13d, %r8d
	callq	_dev_dbg
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	addq	$20, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r8d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %ecx
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
	movq	-80(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_dev_set_name
	movq	%r15, %rdi
	callq	_fsi_device_find_of_node
	movl	%eax, 20(%r15)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%rbx, %r13
	movq	%rbx, %rdi
	callq	_device_register
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r13, %rdi
	callq	_put_device
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_FSI_SLAVE_CONF_NEXT_MASK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movq	_engine_page_size@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imull	%eax, %r12d
	addl	%r12d, -52(%rbp)                ## 4-byte Folded Spill
	shrq	$2, %rax
	incq	-80(%rbp)                       ## 8-byte Folded Spill
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	addl	$4, %ebx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpq	%rcx, %rax
	ja	LBB0_2
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dev_warn
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_engine_page_size,4,2           ## @engine_page_size
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error reading slave registers\n"

L_.str.1:                               ## @.str.1
	.asciz	"crc error in slave register at 0x%04x\n"

	.comm	_FSI_SLAVE_CONF_SLOTS_MASK,4,2  ## @FSI_SLAVE_CONF_SLOTS_MASK
	.comm	_FSI_SLAVE_CONF_SLOTS_SHIFT,4,2 ## @FSI_SLAVE_CONF_SLOTS_SHIFT
	.comm	_FSI_SLAVE_CONF_VERSION_MASK,4,2 ## @FSI_SLAVE_CONF_VERSION_MASK
	.comm	_FSI_SLAVE_CONF_VERSION_SHIFT,4,2 ## @FSI_SLAVE_CONF_VERSION_SHIFT
	.comm	_FSI_SLAVE_CONF_TYPE_MASK,4,2   ## @FSI_SLAVE_CONF_TYPE_MASK
	.comm	_FSI_SLAVE_CONF_TYPE_SHIFT,4,2  ## @FSI_SLAVE_CONF_TYPE_SHIFT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"engine[%i]: type %x, version %x, addr %x size %x\n"

L_.str.3:                               ## @.str.3
	.asciz	"%02x:%02x:%02x:%02x"

L_.str.4:                               ## @.str.4
	.asciz	"add failed: %d\n"

	.comm	_FSI_SLAVE_CONF_NEXT_MASK,4,2   ## @FSI_SLAVE_CONF_NEXT_MASK
	.no_dead_strip	_fsi_slave_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsi_slave_scan
_fsi_slave_scan:                        ; @fsi_slave_scan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x23, _engine_page_size@GOTPAGE
Lloh1:
	ldr	x23, [x23, _engine_page_size@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #12
	b.lo	LBB0_10
; %bb.1:
	mov	x27, x0
	mov	x21, #0
	add	w20, w8, w8, lsl #1
	mov	w22, #12
Lloh2:
	adrp	x19, _FSI_SLAVE_CONF_SLOTS_MASK@GOTPAGE
Lloh3:
	ldr	x19, [x19, _FSI_SLAVE_CONF_SLOTS_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x24, _FSI_SLAVE_CONF_SLOTS_SHIFT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _FSI_SLAVE_CONF_SLOTS_SHIFT@GOTPAGEOFF]
Lloh6:
	adrp	x25, _FSI_SLAVE_CONF_TYPE_MASK@GOTPAGE
Lloh7:
	ldr	x25, [x25, _FSI_SLAVE_CONF_TYPE_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #12
	mov	x0, x27
	mov	x1, x22
	mov	w3, #4
	bl	_fsi_slave_read
	cbnz	w0, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #12]
	bl	_be32_to_cpu
	mov	x26, x0
	mov	w0, #0
	mov	x1, x26
	mov	w2, #32
	bl	_crc4
	cbnz	w0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x19]
	and	w8, w8, w26
	ldr	w9, [x24]
	asr	w10, w8, w9
	ldr	w8, [x25]
	and	w8, w8, w26
Lloh8:
	adrp	x9, _FSI_SLAVE_CONF_TYPE_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FSI_SLAVE_CONF_TYPE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	asr	w28, w8, w9
	cmp	w28, #0
	str	w10, [sp, #8]                   ; 4-byte Folded Spill
	ccmp	w10, #0, #4, ne
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x19, x23
Lloh11:
	adrp	x8, _FSI_SLAVE_CONF_VERSION_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FSI_SLAVE_CONF_VERSION_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w25, [x8]
Lloh14:
	adrp	x8, _FSI_SLAVE_CONF_VERSION_SHIFT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FSI_SLAVE_CONF_VERSION_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w23, [x8]
	mov	x0, x27
	bl	_fsi_create_device
	cbz	x0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x27
	mov	x27, x0
	and	w8, w25, w26
	asr	w4, w8, w23
	str	x24, [x0, #24]
	stp	w28, w4, [x0]
	add	w2, w21, #2
	stp	w2, w20, [x0, #8]
	mov	x23, x19
	ldr	w8, [x19]
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	mul	w6, w8, w9
	str	w6, [x0, #16]
	mov	x0, x24
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x3, x28
	mov	x5, x20
	bl	_dev_dbg
	add	x28, x27, #20
	ldr	x8, [x24, #16]
	ldr	w2, [x8]
	ldp	w4, w3, [x24, #4]
	mov	x0, x28
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x5, x21
	bl	_dev_set_name
	mov	x0, x27
	bl	_fsi_device_find_of_node
	str	w0, [x27, #20]
	mov	x0, x28
	bl	_device_register
                                        ; kill: def $w0 killed $w0 def $x0
	mov	x27, x24
Lloh21:
	adrp	x19, _FSI_SLAVE_CONF_SLOTS_MASK@GOTPAGE
Lloh22:
	ldr	x19, [x19, _FSI_SLAVE_CONF_SLOTS_MASK@GOTPAGEOFF]
Lloh23:
	adrp	x24, _FSI_SLAVE_CONF_SLOTS_SHIFT@GOTPAGE
Lloh24:
	ldr	x24, [x24, _FSI_SLAVE_CONF_SLOTS_SHIFT@GOTPAGEOFF]
Lloh25:
	adrp	x25, _FSI_SLAVE_CONF_TYPE_MASK@GOTPAGE
Lloh26:
	ldr	x25, [x25, _FSI_SLAVE_CONF_TYPE_MASK@GOTPAGEOFF]
	cbz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	str	x0, [sp]
	mov	x0, x27
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_warn
	mov	x0, x28
	bl	_put_device
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh29:
	adrp	x8, _FSI_SLAVE_CONF_NEXT_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _FSI_SLAVE_CONF_NEXT_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	tst	w8, w26
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrsw	x8, [x23]
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	madd	w20, w8, w9, w20
	add	x9, x21, #3
	add	x21, x21, #1
	add	w22, w22, #4
	cmp	x9, x8, lsr #2
	b.lo	LBB0_2
LBB0_10:
	mov	w0, #0
	b	LBB0_15
LBB0_11:
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_12:
	add	x8, x21, #2
	str	x8, [sp]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_13:
	mov	x0, x27
	bl	_dev_warn
	mov	w0, #-1
	b	LBB0_15
LBB0_14:
Lloh36:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_engine_page_size,4,2           ; @engine_page_size
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error reading slave registers\n"

l_.str.1:                               ; @.str.1
	.asciz	"crc error in slave register at 0x%04x\n"

	.comm	_FSI_SLAVE_CONF_SLOTS_MASK,4,2  ; @FSI_SLAVE_CONF_SLOTS_MASK
	.comm	_FSI_SLAVE_CONF_SLOTS_SHIFT,4,2 ; @FSI_SLAVE_CONF_SLOTS_SHIFT
	.comm	_FSI_SLAVE_CONF_VERSION_MASK,4,2 ; @FSI_SLAVE_CONF_VERSION_MASK
	.comm	_FSI_SLAVE_CONF_VERSION_SHIFT,4,2 ; @FSI_SLAVE_CONF_VERSION_SHIFT
	.comm	_FSI_SLAVE_CONF_TYPE_MASK,4,2   ; @FSI_SLAVE_CONF_TYPE_MASK
	.comm	_FSI_SLAVE_CONF_TYPE_SHIFT,4,2  ; @FSI_SLAVE_CONF_TYPE_SHIFT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"engine[%i]: type %x, version %x, addr %x size %x\n"

l_.str.3:                               ; @.str.3
	.asciz	"%02x:%02x:%02x:%02x"

l_.str.4:                               ; @.str.4
	.asciz	"add failed: %d\n"

	.comm	_FSI_SLAVE_CONF_NEXT_MASK,4,2   ; @FSI_SLAVE_CONF_NEXT_MASK
	.no_dead_strip	_fsi_slave_scan
.subsections_via_symbols
