	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_pcie_force_speedup
_rcar_pcie_force_speedup:               ## @rcar_pcie_force_speedup
	.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, %r15
	movq	(%rdi), %r14
	movq	_MACS2R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rcar_pci_read_reg
	movq	_LINK_SPEED@GOTPCREL(%rip), %r12
	andl	(%r12), %eax
	movq	_LINK_SPEED_5_0GTS@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_14
## %bb.1:
	movq	_MACCTLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rcar_pci_read_reg
	movq	_SPEED_CHANGE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.15:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_MACSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rcar_pci_read_reg
	movl	%eax, %ebx
	movl	(%r12), %eax
	andl	%ebx, %eax
	cmpl	(%r13), %eax
	je	LBB0_13
## %bb.3:
	movl	$12, %edi
	callq	_EXPCAP
	movq	_PCI_EXP_LNKSTA_CLS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_PCI_EXP_LNKSTA_CLS_5_0GB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rcar_rmw32
	movq	_MACCGSPSETR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SPCNGRSN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_rcar_rmw32
	movq	_SPCHGFIN@GOTPCREL(%rip), %r12
	movq	_SPCHGSUC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r12), %eax
	movq	_SPCHGFAIL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	testl	%ebx, %eax
	je	LBB0_5
## %bb.4:
	movq	_MACSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_rcar_pci_write_reg
LBB0_5:
	movq	_MACCTLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SPEED_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ecx, %edx
	callq	_rcar_rmw32
	movl	$-1000, %r13d                   ## imm = 0xFC18
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MACSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rcar_pci_read_reg
	movl	%eax, %ebx
	testl	%eax, (%r12)
	jne	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_msleep
	incl	%r13d
	jne	LBB0_6
## %bb.11:
	movq	_LINK_SPEED@GOTPCREL(%rip), %r12
	movq	_LINK_SPEED_5_0GTS@GOTPCREL(%rip), %r13
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_12
LBB0_7:
	movq	_MACSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_rcar_pci_write_reg
	movq	_SPCHGFAIL@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_8
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	movq	_LINK_SPEED@GOTPCREL(%rip), %r12
	movq	_LINK_SPEED_5_0GTS@GOTPCREL(%rip), %r13
LBB0_12:
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_13
LBB0_8:
	movq	_LINK_SPEED@GOTPCREL(%rip), %r12
	movq	_LINK_SPEED_5_0GTS@GOTPCREL(%rip), %r13
LBB0_13:
	andl	(%r12), %ebx
	cmpl	(%r13), %ebx
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.5(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_info                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MACS2R,4,2                     ## @MACS2R
	.comm	_LINK_SPEED,4,2                 ## @LINK_SPEED
	.comm	_LINK_SPEED_5_0GTS,4,2          ## @LINK_SPEED_5_0GTS
	.comm	_MACCTLR,4,2                    ## @MACCTLR
	.comm	_SPEED_CHANGE,4,2               ## @SPEED_CHANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Speed change already in progress\n"

	.comm	_MACSR,4,2                      ## @MACSR
	.comm	_PCI_EXP_LNKSTA_CLS,4,2         ## @PCI_EXP_LNKSTA_CLS
	.comm	_PCI_EXP_LNKSTA_CLS_5_0GB,4,2   ## @PCI_EXP_LNKSTA_CLS_5_0GB
	.comm	_MACCGSPSETR,4,2                ## @MACCGSPSETR
	.comm	_SPCNGRSN,4,2                   ## @SPCNGRSN
	.comm	_SPCHGFIN,4,2                   ## @SPCHGFIN
	.comm	_SPCHGSUC,4,2                   ## @SPCHGSUC
	.comm	_SPCHGFAIL,4,2                  ## @SPCHGFAIL
L_.str.1:                               ## @.str.1
	.asciz	"Speed change failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Speed change timed out\n"

L_.str.3:                               ## @.str.3
	.asciz	"Current link speed is %s GT/s\n"

L_.str.4:                               ## @.str.4
	.asciz	"5"

L_.str.5:                               ## @.str.5
	.asciz	"2.5"

	.no_dead_strip	_rcar_pcie_force_speedup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_pcie_force_speedup
_rcar_pcie_force_speedup:               ; @rcar_pcie_force_speedup
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MACS2R@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MACS2R@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_rcar_pci_read_reg
Lloh3:
	adrp	x23, _LINK_SPEED@GOTPAGE
Lloh4:
	ldr	x23, [x23, _LINK_SPEED@GOTPAGEOFF]
	ldr	w8, [x23]
	and	w8, w8, w0
Lloh5:
	adrp	x24, _LINK_SPEED_5_0GTS@GOTPAGE
Lloh6:
	ldr	x24, [x24, _LINK_SPEED_5_0GTS@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
Lloh7:
	adrp	x22, _MACCTLR@GOTPAGE
Lloh8:
	ldr	x22, [x22, _MACCTLR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_rcar_pci_read_reg
Lloh9:
	adrp	x26, _SPEED_CHANGE@GOTPAGE
Lloh10:
	ldr	x26, [x26, _SPEED_CHANGE@GOTPAGEOFF]
	ldr	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.2:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dev_err
LBB0_3:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh13:
	adrp	x25, _MACSR@GOTPAGE
Lloh14:
	ldr	x25, [x25, _MACSR@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_rcar_pci_read_reg
	mov	x21, x0
	ldr	w8, [x23]
	and	w8, w8, w0
	ldr	w9, [x24]
	cmp	w8, w9
	b.eq	LBB0_13
; %bb.5:
	mov	w0, #12
	bl	_EXPCAP
	mov	x1, x0
Lloh15:
	adrp	x8, _PCI_EXP_LNKSTA_CLS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PCI_EXP_LNKSTA_CLS@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _PCI_EXP_LNKSTA_CLS_5_0GB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCI_EXP_LNKSTA_CLS_5_0GB@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_rcar_rmw32
Lloh21:
	adrp	x8, _MACCGSPSETR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MACCGSPSETR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _SPCNGRSN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SPCNGRSN@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #0
	bl	_rcar_rmw32
Lloh27:
	adrp	x28, _SPCHGFIN@GOTPAGE
Lloh28:
	ldr	x28, [x28, _SPCHGFIN@GOTPAGEOFF]
	ldr	w8, [x28]
Lloh29:
	adrp	x9, _SPCHGSUC@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SPCHGSUC@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh32:
	adrp	x27, _SPCHGFAIL@GOTPAGE
Lloh33:
	ldr	x27, [x27, _SPCHGFAIL@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w8, w8, w9
	tst	w8, w21
	b.eq	LBB0_7
; %bb.6:
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x21
	bl	_rcar_pci_write_reg
LBB0_7:
	ldr	w1, [x22]
	ldr	w2, [x26]
	mov	x0, x20
	mov	x3, x2
	bl	_rcar_rmw32
	mov	w26, #-1000
Lloh34:
	adrp	x22, l_.str.2@PAGE
Lloh35:
	add	x22, x22, l_.str.2@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x20
	bl	_rcar_pci_read_reg
	mov	x21, x0
	ldr	w8, [x28]
	tst	w8, w0
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #1
	bl	_msleep
	adds	w26, w26, #1
	b.lo	LBB0_8
	b	LBB0_12
LBB0_10:
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x21
	bl	_rcar_pci_write_reg
	ldr	w8, [x27]
	tst	w8, w21
	b.eq	LBB0_13
; %bb.11:
Lloh36:
	adrp	x22, l_.str.1@PAGE
Lloh37:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_12:
	mov	x0, x19
	mov	x1, x22
	bl	_dev_err
LBB0_13:
	ldr	w8, [x23]
	and	w8, w8, w21
	ldr	w9, [x24]
Lloh38:
	adrp	x10, l_.str.5@PAGE
Lloh39:
	add	x10, x10, l_.str.5@PAGEOFF
Lloh40:
	adrp	x11, l_.str.4@PAGE
Lloh41:
	add	x11, x11, l_.str.4@PAGEOFF
	cmp	w8, w9
	csel	x2, x11, x10, eq
Lloh42:
	adrp	x1, l_.str.3@PAGE
Lloh43:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dev_info
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_MACS2R,4,2                     ; @MACS2R
	.comm	_LINK_SPEED,4,2                 ; @LINK_SPEED
	.comm	_LINK_SPEED_5_0GTS,4,2          ; @LINK_SPEED_5_0GTS
	.comm	_MACCTLR,4,2                    ; @MACCTLR
	.comm	_SPEED_CHANGE,4,2               ; @SPEED_CHANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Speed change already in progress\n"

	.comm	_MACSR,4,2                      ; @MACSR
	.comm	_PCI_EXP_LNKSTA_CLS,4,2         ; @PCI_EXP_LNKSTA_CLS
	.comm	_PCI_EXP_LNKSTA_CLS_5_0GB,4,2   ; @PCI_EXP_LNKSTA_CLS_5_0GB
	.comm	_MACCGSPSETR,4,2                ; @MACCGSPSETR
	.comm	_SPCNGRSN,4,2                   ; @SPCNGRSN
	.comm	_SPCHGFIN,4,2                   ; @SPCHGFIN
	.comm	_SPCHGSUC,4,2                   ; @SPCHGSUC
	.comm	_SPCHGFAIL,4,2                  ; @SPCHGFAIL
l_.str.1:                               ; @.str.1
	.asciz	"Speed change failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Speed change timed out\n"

l_.str.3:                               ; @.str.3
	.asciz	"Current link speed is %s GT/s\n"

l_.str.4:                               ; @.str.4
	.asciz	"5"

l_.str.5:                               ; @.str.5
	.asciz	"2.5"

	.no_dead_strip	_rcar_pcie_force_speedup
.subsections_via_symbols
