	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_device_resources
_get_device_resources:                  ## @get_device_resources
	.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	$0, (%rsi)
	movq	$0, (%rdx)
	movq	$65535, (%rcx)                  ## imm = 0xFFFF
	movq	(%rdi), %rax
	xorl	%r15d, %r15d
	cmpq	_pci_bus_type@GOTPCREL(%rip), %rax
	jne	LBB0_9
## %bb.1:
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_to_pci_dev
	movq	8(%rax), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	callq	_calc_devid
	movq	_amd_iommu_last_bdf@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	ja	LBB0_9
## %bb.2:
	movq	_amd_iommu_alias_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %rdi
	movq	%rdi, (%rbx)
	movq	_amd_iommu_rlookup_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rdi,8), %rcx
	movq	%rcx, (%r12)
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.3:
	movq	%rax, %r15
	callq	_domain_for_device
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	(%rbx), %rdi
	callq	_find_protection_domain
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	(%r12), %rax
	movq	(%rax), %rax
LBB0_6:
	movq	%rax, (%r14)
	movq	(%r12), %rdi
	movq	(%rbx), %rdx
	movq	%rax, %rsi
	callq	_attach_device
	movq	(%r14), %rax
	movl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_dev_name
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_DUMP_printk
LBB0_7:
	movq	%r15, %rbx
	movq	%r15, %rdi
	callq	_domain_for_device
	movl	$1, %r15d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	(%r12), %rdi
	movq	(%r14), %rsi
	movq	%rbx, %rdx
	callq	_attach_device
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pci_bus_type,4,2               ## @pci_bus_type
	.comm	_amd_iommu_last_bdf,8,3         ## @amd_iommu_last_bdf
	.comm	_amd_iommu_alias_table,8,3      ## @amd_iommu_alias_table
	.comm	_amd_iommu_rlookup_table,8,3    ## @amd_iommu_rlookup_table
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Using protection domain %d for device %s\n"

	.no_dead_strip	_get_device_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_device_resources
_get_device_resources:                  ; @get_device_resources
	.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
	str	xzr, [x1]
	str	xzr, [x2]
	mov	w8, #65535
	str	x8, [x3]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _pci_bus_type@GOTPAGE
Lloh1:
	ldr	x9, [x9, _pci_bus_type@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.1:
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_to_pci_dev
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	ldr	w1, [x0]
	mov	x0, x8
	bl	_calc_devid
Lloh2:
	adrp	x8, _amd_iommu_last_bdf@GOTPAGE
Lloh3:
	ldr	x8, [x8, _amd_iommu_last_bdf@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hi	LBB0_10
; %bb.2:
	mov	x22, x0
Lloh5:
	adrp	x8, _amd_iommu_alias_table@GOTPAGE
Lloh6:
	ldr	x8, [x8, _amd_iommu_alias_table@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x0, [x8, x0, lsl #3]
	str	x0, [x23]
Lloh8:
	adrp	x8, _amd_iommu_rlookup_table@GOTPAGE
Lloh9:
	ldr	x8, [x8, _amd_iommu_rlookup_table@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x8, [x8, x0, lsl #3]
	str	x8, [x20]
	cbz	x8, LBB0_10
; %bb.3:
	bl	_domain_for_device
	str	x0, [x19]
	cbnz	x0, LBB0_7
; %bb.4:
	ldr	x0, [x23]
	bl	_find_protection_domain
	mov	x1, x0
	cbnz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x20]
	ldr	x1, [x8]
LBB0_6:
	str	x1, [x19]
	ldr	x0, [x20]
	ldr	x2, [x23]
	bl	_attach_device
	ldr	x8, [x19]
	ldr	w23, [x8]
	mov	x0, x21
	bl	_dev_name
	mov	x2, x0
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_DUMP_printk
LBB0_7:
	mov	x0, x22
	bl	_domain_for_device
	cbnz	x0, LBB0_9
; %bb.8:
	ldr	x0, [x20]
	ldr	x1, [x19]
	mov	x2, x22
	bl	_attach_device
LBB0_9:
	mov	w0, #1
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_pci_bus_type,4,2               ; @pci_bus_type
	.comm	_amd_iommu_last_bdf,8,3         ; @amd_iommu_last_bdf
	.comm	_amd_iommu_alias_table,8,3      ; @amd_iommu_alias_table
	.comm	_amd_iommu_rlookup_table,8,3    ; @amd_iommu_rlookup_table
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Using protection domain %d for device %s\n"

	.no_dead_strip	_get_device_resources
.subsections_via_symbols
