	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_pcbib_map_cfg
_tegra_pcbib_map_cfg:                   ## @tegra_pcbib_map_cfg
	.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	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	%rdi, %r14
	movl	(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %edi
	callq	_PCI_CFG_BUS
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_PCI_CFG_DEV
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_PCI_CFG_FUN
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_PCI_CFG_EXT_REG
	orl	%r13d, %ebx
	orl	%r12d, %ebx
	orl	%eax, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	12(%r14), %esi
	testl	%esi, %esi
	je	LBB0_3
## %bb.1:
	xorl	%r15d, %r15d
	cmpl	%ebx, 4(%r14)
	je	LBB0_6
## %bb.2:
	movl	16(%r14), %edi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_bus_space_unmap
LBB0_3:
	leaq	12(%r14), %r8
	movl	16(%r14), %edi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	movl	$2048, %edx                     ## imm = 0x800
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	movl	%r12d, %r15d
	jmp	LBB0_6
LBB0_5:
	movl	%ebx, 4(%r14)
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot map config space\n"

	.no_dead_strip	_tegra_pcbib_map_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_pcbib_map_cfg
_tegra_pcbib_map_cfg:                   ; @tegra_pcbib_map_cfg
	.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	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x0
	ldr	w24, [x0]
	mov	x0, x1
	bl	_PCI_CFG_BUS
	mov	x23, x0
	mov	x0, x22
	bl	_PCI_CFG_DEV
	mov	x22, x0
	mov	x0, x21
	bl	_PCI_CFG_FUN
	mov	x21, x0
	mov	x0, x20
	bl	_PCI_CFG_EXT_REG
	orr	w8, w23, w24
	orr	w8, w8, w22
	orr	w8, w8, w21
	orr	w20, w8, w0
	mov	x21, x19
	ldr	w1, [x21, #12]!
	cbz	w1, LBB0_4
; %bb.1:
	ldr	w8, [x19, #4]
	cmp	w8, w20
	b.ne	LBB0_3
; %bb.2:
	mov	w21, #0
	b	LBB0_7
LBB0_3:
	ldr	w0, [x19, #16]
	mov	w2, #2048
	bl	_bus_space_unmap
LBB0_4:
	ldr	w0, [x19, #16]
	mov	x1, x20
	mov	w2, #2048
	mov	w3, #0
	mov	x4, x21
	bl	_bus_space_map
	mov	x21, x0
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	b	LBB0_7
LBB0_6:
	str	w20, [x19, #4]
LBB0_7:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot map config space\n"

	.no_dead_strip	_tegra_pcbib_map_cfg
.subsections_via_symbols
