	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_pcib_read_config
_tegra_pcib_read_config:                ## @tegra_pcib_read_config
	.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
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r14
	callq	_device_get_softc
	movq	%rax, %r12
	testq	%r14, %r14
	je	LBB0_1
## %bb.8:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	movq	%rbx, %rcx
	movq	%r15, %r8
	callq	_tegra_pcbib_map_cfg
	movl	%eax, %ecx
	movl	$-1, %eax
	testl	%ecx, %ecx
	jne	LBB0_14
## %bb.9:
	movl	4(%r12), %ebx
	movq	%r15, %rdi
	callq	_PCI_CFG_BASE_REG
	movl	%eax, %r15d
LBB0_10:
	movl	(%r12), %edi
	movl	%r15d, %edx
	andl	$-4, %edx
	movl	%ebx, %esi
	callq	_bus_space_read_4
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$1, %ecx
	je	LBB0_13
## %bb.11:
	cmpl	$2, %ecx
	jne	LBB0_14
## %bb.12:
	movl	%eax, %ecx
	shrl	$16, %ecx
	testb	$3, %r15b
	cmovel	%eax, %ecx
	movzwl	%cx, %eax
	jmp	LBB0_14
LBB0_1:
	movl	$-1, %eax
	testq	%rbx, %rbx
	jne	LBB0_14
## %bb.2:
	movq	_TEGRA_PCIB_MAX_PORTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.3:
	movq	8(%r12), %rdx
	xorl	%esi, %esi
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rsi
	cmpq	%rsi, %rcx
	je	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r13, (%rdi)
	jne	LBB0_7
## %bb.6:
	movl	8(%rdi), %ebx
	andl	$4095, %r15d                    ## imm = 0xFFF
	jmp	LBB0_10
LBB0_13:
	shll	$3, %r15d
	movl	%r15d, %ecx
	sarl	%cl, %eax
	movzbl	%al, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TEGRA_PCIB_MAX_PORTS,4,2       ## @TEGRA_PCIB_MAX_PORTS
	.no_dead_strip	_tegra_pcib_read_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_pcib_read_config
_tegra_pcib_read_config:                ; @tegra_pcib_read_config
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x5
	mov	x21, x4
	mov	x23, x3
	mov	x22, x2
	mov	x24, x1
	bl	_device_get_softc
	mov	x20, x0
	cbz	x24, LBB0_6
; %bb.1:
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	bl	_tegra_pcbib_map_cfg
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	w22, [x20, #4]
	mov	x0, x21
	bl	_PCI_CFG_BASE_REG
	mov	x21, x0
LBB0_3:
	ldr	w0, [x20]
	and	w2, w21, #0xfffffffc
	mov	x1, x22
	bl	_bus_space_read_4
	cmp	w19, #1
	b.eq	LBB0_15
; %bb.4:
	cmp	w19, #2
	b.ne	LBB0_8
; %bb.5:
	lsr	w8, w0, #16
	tst	w21, #0x3
	csel	w8, w0, w8, eq
	and	w0, w8, #0xffff
	b	LBB0_8
LBB0_6:
	cbz	x23, LBB0_9
LBB0_7:
	mov	w0, #-1
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh0:
	adrp	x8, _TEGRA_PCIB_MAX_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TEGRA_PCIB_MAX_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.10:
	ldr	x9, [x20, #8]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_7
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x10, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x11, [x10]
	cmp	x11, x22
	b.ne	LBB0_11
; %bb.14:
	ldr	w22, [x10, #8]
	and	w21, w21, #0xfff
	b	LBB0_3
LBB0_15:
	ubfiz	w8, w21, #3, #2
	asr	w8, w0, w8
	and	w0, w8, #0xff
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TEGRA_PCIB_MAX_PORTS,4,2       ; @TEGRA_PCIB_MAX_PORTS
	.no_dead_strip	_tegra_pcib_read_config
.subsections_via_symbols
