	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_pcie_config_access
_rcar_pcie_config_access:               ## @rcar_pcie_config_access
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	%ecx, %edi
	callq	_PCI_SLOT
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_PCI_FUNC
	movl	%eax, %ebx
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	andl	$-4, %r12d
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_pci_is_root_bus
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rbx
	jmp	LBB0_21
LBB0_9:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rbx
	cmpl	$0, (%r13)
	js	LBB0_21
## %bb.10:
	movq	_PCIEERRFR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_rcar_pci_read_reg
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_rcar_pci_write_reg
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	8(%r14), %edi
	callq	_PCIE_CONF_BUS
	movl	%eax, %r15d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PCIE_CONF_DEV
	movl	%eax, %ebx
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_PCIE_CONF_FUNC
	orl	%r12d, %r15d
	orl	%eax, %ebx
	orl	%r15d, %ebx
	movq	_PCIECAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_rcar_pci_write_reg
	movq	(%r14), %rax
	movl	(%rax), %ecx
	movq	_CONFIG_SEND_ENABLE@GOTPCREL(%rip), %rax
	cmpl	(%r13), %ecx
	jne	LBB0_11
## %bb.12:
	movq	_TYPE0@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_3:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	shrl	$2, %ebx
	movq	_RCAR_PCI_ACCESS_READ@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpb	%cl, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	callq	_PCICONF
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_rcar_pci_read_reg
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	jmp	LBB0_20
LBB0_11:
	movq	_TYPE1@GOTPCREL(%rip), %rcx
LBB0_13:
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rbx
	movq	_PCIEERRFR@GOTPCREL(%rip), %r14
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_PCIECCTLR@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r13, %rdi
	callq	_rcar_pci_write_reg
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_rcar_pci_read_reg
	movq	_UNSUPPORTED_REQUEST@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_21
## %bb.14:
	movq	_PCI_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RCONF
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_rcar_read_conf
	movq	_PCI_STATUS_REC_MASTER_ABORT@GOTPCREL(%rip), %rcx
	movq	_PCI_STATUS_REC_TARGET_ABORT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	jne	LBB0_21
## %bb.15:
	movq	_RCAR_PCI_ACCESS_READ@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpb	%cl, (%rax)
	jne	LBB0_17
## %bb.16:
	movq	_PCIECDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_rcar_pci_read_reg
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	jmp	LBB0_18
LBB0_5:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_pci_is_root_bus
	testq	%rax, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_8
## %bb.6:
	movq	_PCI_PRIMARY_BUS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_8
## %bb.7:
	movzbl	(%rcx), %eax
	movl	%eax, (%r13)
LBB0_8:
	movl	(%rcx), %r14d
	movl	%ebx, %edi
	callq	_PCICONF
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	jmp	LBB0_19
LBB0_17:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	_PCIECDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_rcar_pci_write_reg
LBB0_18:
	movl	(%r15), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
LBB0_19:
	callq	_rcar_pci_write_reg
LBB0_20:
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rbx
LBB0_21:
	movl	(%rbx), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ## @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_RCAR_PCI_ACCESS_READ,1,0       ## @RCAR_PCI_ACCESS_READ
	.comm	_PCI_PRIMARY_BUS,4,2            ## @PCI_PRIMARY_BUS
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ## @PCIBIOS_SUCCESSFUL
	.comm	_PCIEERRFR,4,2                  ## @PCIEERRFR
	.comm	_PCIECAR,4,2                    ## @PCIECAR
	.comm	_CONFIG_SEND_ENABLE,4,2         ## @CONFIG_SEND_ENABLE
	.comm	_TYPE0,4,2                      ## @TYPE0
	.comm	_PCIECCTLR,4,2                  ## @PCIECCTLR
	.comm	_TYPE1,4,2                      ## @TYPE1
	.comm	_UNSUPPORTED_REQUEST,4,2        ## @UNSUPPORTED_REQUEST
	.comm	_PCI_STATUS,4,2                 ## @PCI_STATUS
	.comm	_PCI_STATUS_REC_MASTER_ABORT,4,2 ## @PCI_STATUS_REC_MASTER_ABORT
	.comm	_PCI_STATUS_REC_TARGET_ABORT,4,2 ## @PCI_STATUS_REC_TARGET_ABORT
	.comm	_PCIECDR,4,2                    ## @PCIECDR
	.no_dead_strip	_rcar_pcie_config_access
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_pcie_config_access
_rcar_pcie_config_access:               ; @rcar_pcie_config_access
	.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, x5
	mov	x25, x4
	mov	x24, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	mov	x0, x3
	bl	_PCI_SLOT
	mov	x23, x0
	mov	x0, x24
	bl	_PCI_FUNC
	mov	x24, x0
	and	w26, w25, #0xfffffffc
	mov	x0, x22
	bl	_pci_is_root_bus
	cbz	x0, LBB0_4
; %bb.1:
	cbnz	w23, LBB0_7
; %bb.2:
	lsr	w23, w25, #2
Lloh0:
	adrp	x8, _RCAR_PCI_ACCESS_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RCAR_PCI_ACCESS_READ@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_8
; %bb.3:
	mov	x0, x23
	bl	_PCICONF
	mov	x1, x0
	mov	x0, x19
	bl	_rcar_pci_read_reg
	str	w0, [x20]
	b	LBB0_17
LBB0_4:
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_7
; %bb.5:
Lloh2:
	adrp	x27, _PCIEERRFR@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PCIEERRFR@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_rcar_pci_read_reg
	mov	x1, x0
	ldr	w2, [x27]
	mov	x0, x19
	bl	_rcar_pci_write_reg
	ldr	w0, [x22, #8]
	bl	_PCIE_CONF_BUS
	mov	x25, x0
	mov	x0, x23
	bl	_PCIE_CONF_DEV
	mov	x23, x0
	mov	x0, x24
	bl	_PCIE_CONF_FUNC
	orr	w8, w25, w26
	orr	w8, w8, w23
	orr	w1, w8, w0
Lloh4:
	adrp	x8, _PCIECAR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCIECAR@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rcar_pci_write_reg
	ldr	x8, [x22]
	ldr	w8, [x8]
	ldr	w9, [x19]
Lloh7:
	adrp	x10, _CONFIG_SEND_ENABLE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _CONFIG_SEND_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
Lloh10:
	adrp	x11, _TYPE0@GOTPAGE
Lloh11:
	ldr	x11, [x11, _TYPE0@GOTPAGEOFF]
Lloh12:
	adrp	x12, _TYPE1@GOTPAGE
Lloh13:
	ldr	x12, [x12, _TYPE1@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x11, x12, eq
	ldr	w8, [x8]
	orr	w1, w8, w10
Lloh14:
	adrp	x22, _PCIECCTLR@GOTPAGE
Lloh15:
	ldr	x22, [x22, _PCIECCTLR@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_rcar_pci_write_reg
	ldr	w1, [x27]
	mov	x0, x19
	bl	_rcar_pci_read_reg
Lloh16:
	adrp	x8, _UNSUPPORTED_REQUEST@GOTPAGE
Lloh17:
	ldr	x8, [x8, _UNSUPPORTED_REQUEST@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_7
; %bb.6:
Lloh19:
	adrp	x8, _PCI_STATUS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PCI_STATUS@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_RCONF
	mov	x1, x0
	mov	x0, x19
	bl	_rcar_read_conf
Lloh22:
	adrp	x8, _PCI_STATUS_REC_MASTER_ABORT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PCI_STATUS_REC_MASTER_ABORT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _PCI_STATUS_REC_TARGET_ABORT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PCI_STATUS_REC_TARGET_ABORT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_12
LBB0_7:
Lloh28:
	adrp	x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGEOFF]
	b	LBB0_18
LBB0_8:
	mov	x0, x22
	bl	_pci_is_root_bus
	cbz	x0, LBB0_11
; %bb.9:
Lloh30:
	adrp	x8, _PCI_PRIMARY_BUS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCI_PRIMARY_BUS@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w26, w8
	b.ne	LBB0_11
; %bb.10:
	ldrb	w8, [x20]
	str	w8, [x19]
LBB0_11:
	ldr	w20, [x20]
	mov	x0, x23
	bl	_PCICONF
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	b	LBB0_16
LBB0_12:
Lloh33:
	adrp	x8, _RCAR_PCI_ACCESS_READ@GOTPAGE
Lloh34:
	ldr	x8, [x8, _RCAR_PCI_ACCESS_READ@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_14
; %bb.13:
Lloh35:
	adrp	x8, _PCIECDR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PCIECDR@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rcar_pci_read_reg
	str	w0, [x20]
	b	LBB0_15
LBB0_14:
	ldr	w1, [x20]
Lloh38:
	adrp	x8, _PCIECDR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _PCIECDR@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rcar_pci_write_reg
LBB0_15:
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #0
LBB0_16:
	bl	_rcar_pci_write_reg
LBB0_17:
Lloh41:
	adrp	x8, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
LBB0_18:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ; @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_RCAR_PCI_ACCESS_READ,1,0       ; @RCAR_PCI_ACCESS_READ
	.comm	_PCI_PRIMARY_BUS,4,2            ; @PCI_PRIMARY_BUS
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ; @PCIBIOS_SUCCESSFUL
	.comm	_PCIEERRFR,4,2                  ; @PCIEERRFR
	.comm	_PCIECAR,4,2                    ; @PCIECAR
	.comm	_CONFIG_SEND_ENABLE,4,2         ; @CONFIG_SEND_ENABLE
	.comm	_TYPE0,4,2                      ; @TYPE0
	.comm	_PCIECCTLR,4,2                  ; @PCIECCTLR
	.comm	_TYPE1,4,2                      ; @TYPE1
	.comm	_UNSUPPORTED_REQUEST,4,2        ; @UNSUPPORTED_REQUEST
	.comm	_PCI_STATUS,4,2                 ; @PCI_STATUS
	.comm	_PCI_STATUS_REC_MASTER_ABORT,4,2 ; @PCI_STATUS_REC_MASTER_ABORT
	.comm	_PCI_STATUS_REC_TARGET_ABORT,4,2 ; @PCI_STATUS_REC_TARGET_ABORT
	.comm	_PCIECDR,4,2                    ; @PCIECDR
	.no_dead_strip	_rcar_pcie_config_access
.subsections_via_symbols
