	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_pcie_inbound_ranges
_rcar_pcie_inbound_ranges:              ## @rcar_pcie_inbound_ranges
	.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	%rsi, %r14
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rsi), %r12d
	movq	_LAM_64BIT@GOTPCREL(%rip), %rax
	movq	_LAR_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_IORESOURCE_PREFETCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	andl	(%rsi), %r13d
	je	LBB0_2
## %bb.1:
	movq	_LAM_PREFETCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_2:
	movl	8(%r14), %edi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	orl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movabsq	$4294967296, %rsi               ## imm = 0x100000000
	movl	12(%r14), %ebx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %r15d
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_4
## %bb.3:
	movl	%r12d, %edi
	callq	___ffs64
	movl	8(%r14), %edi
	movabsq	$4294967296, %rsi               ## imm = 0x100000000
	movl	%eax, %ecx
	shlq	%cl, %rsi
	sarq	$32, %rsi
	callq	_min
	movabsq	$4294967296, %rsi               ## imm = 0x100000000
	movl	%eax, %edi
LBB0_4:
	addl	%r12d, -48(%rbp)                ## 4-byte Folded Spill
	orl	%r13d, -44(%rbp)                ## 4-byte Folded Spill
	callq	_min
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_roundup_pow_of_two
	decl	%eax
	andl	$-16, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	jge	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %edi
	callq	_lower_32_bits
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_PCIEPRAR
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	%r12d, %edi
	callq	_lower_32_bits
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_PCIELAR
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_lower_32_bits
	movl	%eax, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%r15d, %edi
	callq	_PCIELAMR
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_upper_32_bits
	movl	%eax, %ebx
	leal	1(%r15), %r14d
	movl	%r14d, %edi
	callq	_PCIEPRAR
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	%r12d, %edi
	callq	_upper_32_bits
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_PCIELAR
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	%r14d, %edi
	callq	_PCIELAMR
	movq	%r13, %rdi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_rcar_pci_write_reg
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %ebx
	addl	%eax, %r12d
	addl	$2, %r15d
	movq	_MAX_NR_INBOUND_MAPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jle	LBB0_5
## %bb.7:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_8:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%eax, %eax
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LAM_64BIT,4,2                  ## @LAM_64BIT
	.comm	_LAR_ENABLE,4,2                 ## @LAR_ENABLE
	.comm	_IORESOURCE_PREFETCH,4,2        ## @IORESOURCE_PREFETCH
	.comm	_LAM_PREFETCH,4,2               ## @LAM_PREFETCH
	.comm	_MAX_NR_INBOUND_MAPS,4,2        ## @MAX_NR_INBOUND_MAPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to map inbound regions!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rcar_pcie_inbound_ranges
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_pcie_inbound_ranges
_rcar_pcie_inbound_ranges:              ; @rcar_pcie_inbound_ranges
	.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
	mov	x20, x0
	ldp	w8, w28, [x1]
	ldp	w19, w9, [x1, #8]
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
Lloh0:
	adrp	x9, _LAM_64BIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LAM_64BIT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _LAR_ENABLE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _LAR_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w21, w10, w9
	str	x2, [sp]                        ; 8-byte Folded Spill
	ldr	w22, [x2]
Lloh6:
	adrp	x9, _IORESOURCE_PREFETCH@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IORESOURCE_PREFETCH@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _LAM_PREFETCH@GOTPAGE
Lloh10:
	ldr	x10, [x10, _LAM_PREFETCH@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w24, wzr, w10, eq
	cmp	w28, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x23, x1
	mov	x0, x28
	bl	___ffs64
	ldr	w8, [x23, #8]
	mov	x9, #4294967296
	lsl	x9, x9, x0
	asr	x1, x9, #32
	mov	x0, x8
	bl	_min
	b	LBB0_3
LBB0_2:
	mov	x0, x19
LBB0_3:
	add	w19, w19, w28
	orr	w8, w21, w24
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mov	x1, #4294967296
	bl	_min
	mov	x23, x0
	bl	_roundup_pow_of_two
	mov	w21, #0
	sub	w8, w0, #1
	and	w24, w8, #0xfffffff0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w25, w28, w21
	cmp	w25, w19
	b.ge	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w26, w8, w21
	mov	x0, x26
	bl	_lower_32_bits
	mov	x27, x0
	mov	x0, x22
	bl	_PCIEPRAR
	mov	x2, x0
	mov	x0, x20
	mov	x1, x27
	bl	_rcar_pci_write_reg
	mov	x0, x25
	bl	_lower_32_bits
	mov	x27, x0
	mov	x0, x22
	bl	_PCIELAR
	mov	x2, x0
	mov	x0, x20
	mov	x1, x27
	bl	_rcar_pci_write_reg
	mov	x0, x24
	bl	_lower_32_bits
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	orr	w27, w8, w0
	mov	x0, x22
	bl	_PCIELAMR
	mov	x2, x0
	mov	x0, x20
	mov	x1, x27
	bl	_rcar_pci_write_reg
	mov	x0, x26
	bl	_upper_32_bits
	mov	x26, x0
	add	w27, w22, #1
	mov	x0, x27
	bl	_PCIEPRAR
	mov	x2, x0
	mov	x0, x20
	mov	x1, x26
	bl	_rcar_pci_write_reg
	mov	x0, x25
	bl	_upper_32_bits
	mov	x25, x0
	mov	x0, x27
	bl	_PCIELAR
	mov	x2, x0
	mov	x0, x20
	mov	x1, x25
	bl	_rcar_pci_write_reg
	mov	x0, x27
	bl	_PCIELAMR
	mov	x2, x0
	mov	x0, x20
	mov	w1, #0
	bl	_rcar_pci_write_reg
	add	w22, w22, #2
Lloh12:
	adrp	x8, _MAX_NR_INBOUND_MAPS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX_NR_INBOUND_MAPS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	add	w21, w21, w23
	cmp	w22, w8
	b.le	LBB0_4
; %bb.6:
	ldr	w0, [x20]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	w0, #0
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	w22, [x8]
LBB0_8:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_LAM_64BIT,4,2                  ; @LAM_64BIT
	.comm	_LAR_ENABLE,4,2                 ; @LAR_ENABLE
	.comm	_IORESOURCE_PREFETCH,4,2        ; @IORESOURCE_PREFETCH
	.comm	_LAM_PREFETCH,4,2               ; @LAM_PREFETCH
	.comm	_MAX_NR_INBOUND_MAPS,4,2        ; @MAX_NR_INBOUND_MAPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to map inbound regions!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rcar_pcie_inbound_ranges
.subsections_via_symbols
