	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_pcib_enable
_mv_pcib_enable:                        ## @mv_pcib_enable
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	cmpq	$0, (%rdi)
	je	LBB0_1
LBB0_6:
	movq	8(%r13), %rax
	movq	_MV_MODE_ROOT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	movl	16(%r13), %esi
	movl	20(%r13), %edi
	movq	_PCIR_COMMAND@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_bus_space_read_4
	movq	_PCIM_CMD_SERRESPEN@GOTPCREL(%rip), %rcx
	movq	_PCIM_CMD_BUSMASTEREN@GOTPCREL(%rip), %rdx
	movq	_PCIM_CMD_MEMEN@GOTPCREL(%rip), %rsi
	movq	_PCIM_CMD_PORTEN@GOTPCREL(%rip), %rdi
	orl	(%rcx), %eax
	orl	(%rdx), %eax
	orl	(%rsi), %eax
	orl	(%rdi), %eax
	movl	16(%r13), %esi
	movl	20(%r13), %edi
	movl	(%rbx), %edx
	movl	%eax, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_space_write_4              ## TAILCALL
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%esi, %r14d
	movq	_CPU_CONTROL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_read_cpu_ctrl
	movl	%eax, %r15d
	movl	%r14d, %edi
	callq	_CPU_CONTROL_PCIE_DISABLE
	testl	%r15d, %eax
	je	LBB0_6
## %bb.2:
	movl	(%rbx), %r15d
	movl	%r15d, %edi
	callq	_read_cpu_ctrl
	movl	%eax, %r12d
	movl	%r14d, %edi
	callq	_CPU_CONTROL_PCIE_DISABLE
	notl	%eax
	andl	%eax, %r12d
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_write_cpu_ctrl
	movq	_PCIE_LINK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	16(%r13), %esi
	movl	20(%r13), %edi
	movq	_PCIE_REG_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_bus_space_read_4
	movq	_PCIE_STATUS_LINK_DOWN@GOTPCREL(%rip), %r15
	andl	(%r15), %eax
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.3:
	testl	%ebx, %ebx
	jle	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	movl	16(%r13), %esi
	movl	20(%r13), %edi
	movl	(%r14), %edx
	callq	_bus_space_read_4
	andl	(%r15), %eax
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-1000(%rbx), %eax
	cmpl	$1000, %ebx                     ## imm = 0x3E8
	movl	%eax, %ebx
	ja	LBB0_4
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CPU_CONTROL,4,2                ## @CPU_CONTROL
	.comm	_PCIE_LINK_TIMEOUT,4,2          ## @PCIE_LINK_TIMEOUT
	.comm	_PCIE_REG_STATUS,4,2            ## @PCIE_REG_STATUS
	.comm	_PCIE_STATUS_LINK_DOWN,4,2      ## @PCIE_STATUS_LINK_DOWN
	.comm	_MV_MODE_ROOT,8,3               ## @MV_MODE_ROOT
	.comm	_PCIR_COMMAND,4,2               ## @PCIR_COMMAND
	.comm	_PCIM_CMD_SERRESPEN,4,2         ## @PCIM_CMD_SERRESPEN
	.comm	_PCIM_CMD_BUSMASTEREN,4,2       ## @PCIM_CMD_BUSMASTEREN
	.comm	_PCIM_CMD_MEMEN,4,2             ## @PCIM_CMD_MEMEN
	.comm	_PCIM_CMD_PORTEN,4,2            ## @PCIM_CMD_PORTEN
	.no_dead_strip	_mv_pcib_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_pcib_enable
_mv_pcib_enable:                        ; @mv_pcib_enable
	.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	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_4
LBB0_1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _MV_MODE_ROOT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MV_MODE_ROOT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldp	w1, w0, [x19, #16]
Lloh3:
	adrp	x20, _PCIR_COMMAND@GOTPAGE
Lloh4:
	ldr	x20, [x20, _PCIR_COMMAND@GOTPAGEOFF]
	ldr	w2, [x20]
	bl	_bus_space_read_4
Lloh5:
	adrp	x8, _PCIM_CMD_SERRESPEN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCIM_CMD_SERRESPEN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _PCIM_CMD_BUSMASTEREN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCIM_CMD_BUSMASTEREN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _PCIM_CMD_MEMEN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PCIM_CMD_MEMEN@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
Lloh14:
	adrp	x11, _PCIM_CMD_PORTEN@GOTPAGE
Lloh15:
	ldr	x11, [x11, _PCIM_CMD_PORTEN@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	orr	w8, w8, w0
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w3, w8, w11
	ldp	w1, w0, [x19, #16]
	ldr	w2, [x20]
	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	_bus_space_write_4
LBB0_3:
	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
LBB0_4:
	mov	x20, x1
Lloh17:
	adrp	x22, _CPU_CONTROL@GOTPAGE
Lloh18:
	ldr	x22, [x22, _CPU_CONTROL@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_read_cpu_ctrl
	mov	x21, x0
	mov	x0, x20
	bl	_CPU_CONTROL_PCIE_DISABLE
	tst	w0, w21
	b.eq	LBB0_1
; %bb.5:
	ldr	w21, [x22]
	mov	x0, x21
	bl	_read_cpu_ctrl
	mov	x22, x0
	mov	x0, x20
	bl	_CPU_CONTROL_PCIE_DISABLE
	bic	w1, w22, w0
	mov	x0, x21
	bl	_write_cpu_ctrl
Lloh19:
	adrp	x8, _PCIE_LINK_TIMEOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PCIE_LINK_TIMEOUT@GOTPAGEOFF]
Lloh21:
	ldr	w20, [x8]
	ldp	w1, w0, [x19, #16]
Lloh22:
	adrp	x21, _PCIE_REG_STATUS@GOTPAGE
Lloh23:
	ldr	x21, [x21, _PCIE_REG_STATUS@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_bus_space_read_4
Lloh24:
	adrp	x22, _PCIE_STATUS_LINK_DOWN@GOTPAGE
Lloh25:
	ldr	x22, [x22, _PCIE_STATUS_LINK_DOWN@GOTPAGEOFF]
	ldr	w8, [x22]
	and	w8, w8, w0
	cmp	w8, #1
	ccmp	w20, #1, #8, eq
	b.lt	LBB0_1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1000
	bl	_DELAY
	ldp	w1, w0, [x19, #16]
	ldr	w2, [x21]
	bl	_bus_space_read_4
	ldr	w8, [x22]
	and	w8, w8, w0
	cmp	w8, #1
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w8, w20, #1000
	cmp	w20, #1000
	mov	x20, x8
	b.hi	LBB0_6
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_CPU_CONTROL,4,2                ; @CPU_CONTROL
	.comm	_PCIE_LINK_TIMEOUT,4,2          ; @PCIE_LINK_TIMEOUT
	.comm	_PCIE_REG_STATUS,4,2            ; @PCIE_REG_STATUS
	.comm	_PCIE_STATUS_LINK_DOWN,4,2      ; @PCIE_STATUS_LINK_DOWN
	.comm	_MV_MODE_ROOT,8,3               ; @MV_MODE_ROOT
	.comm	_PCIR_COMMAND,4,2               ; @PCIR_COMMAND
	.comm	_PCIM_CMD_SERRESPEN,4,2         ; @PCIM_CMD_SERRESPEN
	.comm	_PCIM_CMD_BUSMASTEREN,4,2       ; @PCIM_CMD_BUSMASTEREN
	.comm	_PCIM_CMD_MEMEN,4,2             ; @PCIM_CMD_MEMEN
	.comm	_PCIM_CMD_PORTEN,4,2            ; @PCIM_CMD_PORTEN
	.no_dead_strip	_mv_pcib_enable
.subsections_via_symbols
