	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsi_master_acf_setup
_fsi_master_acf_setup:                  ## @fsi_master_acf_setup
	.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	%rdi, %r14
	callq	_reset_cf
	movq	8(%r14), %rdi
	movq	_SRAM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset_io
	movq	%r14, %rdi
	callq	_setup_gpios_for_copro
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.1:
	movq	%r14, %rdi
	callq	_load_copro_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.2:
	movq	%r14, %rdi
	callq	_check_firmware_image
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpq	$0, 32(%r14)
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_setup_ast2500_cf_maps
	movq	%r14, %rdi
	callq	_setup_ast2500_fw_config
	jmp	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	callq	_setup_ast2400_cf_maps
	movq	%r14, %rdi
	callq	_setup_ast2400_fw_config
LBB0_6:
	movq	%r14, %rdi
	callq	_start_cf
	movq	_CF_STARTED@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.7:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.8:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.9:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.10:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.11:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.12:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.13:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.14:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:
	movl	$1, %edi
	callq	_msleep
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_ioread8
	testq	%rax, %rax
	je	LBB0_16
LBB0_17:
	movl	20(%r14), %edi
	movq	_SEND_DLY_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_iowrite8
	movl	16(%r14), %edi
	movq	_ECHO_DLY_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_iowrite8
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	je	LBB0_20
## %bb.18:
	movq	%r14, %rdi
	callq	_copro_enable_sw_irq
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_20
LBB0_19:
	movq	%r14, %rdi
	callq	_reset_cf
	movq	%r14, %rdi
	callq	_release_copro_gpios
	movl	%r15d, %ebx
	jmp	LBB0_20
LBB0_16:
	movl	$1, %edi
	callq	_msleep
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_SRAM_SIZE,4,2                  ## @SRAM_SIZE
	.comm	_CF_STARTED,8,3                 ## @CF_STARTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Coprocessor startup timeout !\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SEND_DLY_REG,8,3               ## @SEND_DLY_REG
	.comm	_ECHO_DLY_REG,8,3               ## @ECHO_DLY_REG
	.no_dead_strip	_fsi_master_acf_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsi_master_acf_setup
_fsi_master_acf_setup:                  ; @fsi_master_acf_setup
	.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
	bl	_reset_cf
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x8, _SRAM_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SRAM_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset_io
	mov	x0, x19
	bl	_setup_gpios_for_copro
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_load_copro_firmware
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_check_firmware_image
	mov	x20, x0
	cbz	w0, LBB0_4
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_setup_ast2500_cf_maps
	mov	x0, x19
	bl	_setup_ast2500_fw_config
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_setup_ast2400_cf_maps
	mov	x0, x19
	bl	_setup_ast2400_fw_config
LBB0_7:
	mov	x0, x19
	bl	_start_cf
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x20, _CF_STARTED@GOTPAGE
Lloh4:
	ldr	x20, [x20, _CF_STARTED@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.8:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.9:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.10:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.11:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.12:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.13:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.14:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.15:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbnz	x0, LBB0_17
; %bb.16:
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread8
	cbz	x0, LBB0_21
LBB0_17:
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _SEND_DLY_REG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SEND_DLY_REG@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite8
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _ECHO_DLY_REG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ECHO_DLY_REG@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite8
	ldr	x8, [x19]
	cbz	x8, LBB0_20
; %bb.18:
	mov	x0, x19
	bl	_copro_enable_sw_irq
	mov	x20, x0
	cbz	w0, LBB0_3
LBB0_19:
	mov	x0, x19
	bl	_reset_cf
	mov	x0, x19
	bl	_release_copro_gpios
	b	LBB0_3
LBB0_20:
	mov	w20, #0
	b	LBB0_3
LBB0_21:
	mov	w0, #1
	bl	_msleep
	ldr	w0, [x19, #24]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SRAM_SIZE,4,2                  ; @SRAM_SIZE
	.comm	_CF_STARTED,8,3                 ; @CF_STARTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Coprocessor startup timeout !\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SEND_DLY_REG,8,3               ; @SEND_DLY_REG
	.comm	_ECHO_DLY_REG,8,3               ; @ECHO_DLY_REG
	.no_dead_strip	_fsi_master_acf_setup
.subsections_via_symbols
