	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_alias
_get_alias:                             ## @get_alias
	.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	%rdi, %rbx
	callq	_to_pci_dev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_get_device_id
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dev_is_pci
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_amd_iommu_alias_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rbx
	movq	___last_alias@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_for_each_dma_alias
	movq	-48(%rbp), %rax
	cmpq	%rax, %rbx
	je	LBB0_10
## %bb.3:
	cmpq	%r15, %rbx
	jne	LBB0_7
## %bb.4:
	movq	_amd_iommu_rlookup_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rcx,%rax,8)
	je	LBB0_6
## %bb.5:
	movq	%rax, %rbx
	jmp	LBB0_10
LBB0_1:
	movq	%r15, %rbx
LBB0_10:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, %rdi
	callq	_PCI_BUS_NUM
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_PCI_SLOT
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_PCI_FUNC
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	8(%r14), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	12(%r14), %r13d
	movq	-48(%rbp), %rdi
	callq	_PCI_BUS_NUM
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi
	callq	_PCI_SLOT
	movl	%eax, %r12d
	movq	-48(%rbp), %rdi
	callq	_PCI_FUNC
	movl	%eax, %r10d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	%r13d, %r9d
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	callq	_pci_info
	addq	$32, %rsp
	cmpq	%r15, -48(%rbp)
	jne	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_PCI_BUS_NUM
	movq	(%r14), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movzbl	%bl, %esi
	movq	%r14, %rdi
	callq	_pci_add_dma_alias
	movq	%rbx, %rdi
	callq	_PCI_SLOT
	movslq	%eax, %r15
	movq	%rbx, %rdi
	callq	_PCI_FUNC
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_pci_info
	jmp	LBB0_10
LBB0_6:
	movq	(%rcx,%r15,8), %rdx
	movq	%rdx, (%rcx,%rax,8)
	movq	_amd_iommu_dev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx
	movl	(%rax,%rcx,4), %edi
	movl	(%rax,%r15,4), %esi
	movl	$4, %edx
	callq	_memcpy
	movq	-48(%rbp), %rbx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_amd_iommu_alias_table,8,3      ## @amd_iommu_alias_table
	.comm	___last_alias,4,2               ## @__last_alias
	.comm	_amd_iommu_rlookup_table,8,3    ## @amd_iommu_rlookup_table
	.comm	_amd_iommu_dev_table,8,3        ## @amd_iommu_dev_table
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Using IVRS reported alias %02x:%02x.%d for device [%04x:%04x], kernel reported alias %02x:%02x.%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Added PCI DMA alias %02x.%d\n"

	.no_dead_strip	_get_alias
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_alias
_get_alias:                             ; @get_alias
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x19, x0
	bl	_to_pci_dev
	mov	x20, x0
	mov	x0, x19
	bl	_get_device_id
	mov	x21, x0
	mov	x0, x19
	bl	_dev_is_pci
	cbz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _amd_iommu_alias_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amd_iommu_alias_table@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x19, [x8, x21, lsl #3]
Lloh3:
	adrp	x8, ___last_alias@GOTPAGE
Lloh4:
	ldr	x8, [x8, ___last_alias@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #56
	mov	x0, x20
	bl	_pci_for_each_dma_alias
	ldr	x8, [sp, #56]
	cmp	x19, x8
	b.eq	LBB0_6
; %bb.2:
	cmp	x19, x21
	b.ne	LBB0_7
; %bb.3:
Lloh6:
	adrp	x9, _amd_iommu_rlookup_table@GOTPAGE
Lloh7:
	ldr	x9, [x9, _amd_iommu_rlookup_table@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x10, [x9, x8, lsl #3]
	cbz	x10, LBB0_10
; %bb.4:
	mov	x19, x8
	b	LBB0_6
LBB0_5:
	mov	x19, x21
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_7:
	mov	x0, x19
	bl	_PCI_BUS_NUM
	mov	x22, x0
	mov	x0, x19
	bl	_PCI_SLOT
	mov	x23, x0
	mov	x0, x19
	bl	_PCI_FUNC
	mov	x24, x0
	ldr	x0, [sp, #56]
	ldp	w28, w27, [x20, #8]
	bl	_PCI_BUS_NUM
	mov	x25, x0
	ldr	x0, [sp, #56]
	bl	_PCI_SLOT
	mov	x26, x0
	ldr	x0, [sp, #56]
	bl	_PCI_FUNC
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x26, x0, [sp, #32]
	stp	x28, x25, [sp, #16]
	stp	x24, x27, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	mov	x3, x23
	bl	_pci_info
	ldr	x8, [sp, #56]
	cmp	x8, x21
	b.ne	LBB0_6
; %bb.8:
	mov	x0, x19
	bl	_PCI_BUS_NUM
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.9:
	and	x1, x19, #0xff
	mov	x0, x20
	bl	_pci_add_dma_alias
	mov	x0, x19
	bl	_PCI_SLOT
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x21, w0
	mov	x0, x19
	bl	_PCI_FUNC
	mov	x3, x0
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_pci_info
	b	LBB0_6
LBB0_10:
	ldr	x10, [x9, x21, lsl #3]
	str	x10, [x9, x8, lsl #3]
Lloh13:
	adrp	x8, _amd_iommu_dev_table@GOTPAGE
Lloh14:
	ldr	x8, [x8, _amd_iommu_dev_table@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x9, [sp, #56]
	ldr	w0, [x8, x9, lsl #2]
	ldr	w1, [x8, x21, lsl #2]
	mov	w2, #4
	bl	_memcpy
	ldr	x19, [sp, #56]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_amd_iommu_alias_table,8,3      ; @amd_iommu_alias_table
	.comm	___last_alias,4,2               ; @__last_alias
	.comm	_amd_iommu_rlookup_table,8,3    ; @amd_iommu_rlookup_table
	.comm	_amd_iommu_dev_table,8,3        ; @amd_iommu_dev_table
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Using IVRS reported alias %02x:%02x.%d for device [%04x:%04x], kernel reported alias %02x:%02x.%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Added PCI DMA alias %02x.%d\n"

	.no_dead_strip	_get_alias
.subsections_via_symbols
