	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_init_apertures             ## -- Begin function kfd_init_apertures
	.p2align	4, 0x90
_kfd_init_apertures:                    ## @kfd_init_apertures
	.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	%rdi, %r15
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rsi
	xorl	%edi, %edi
	callq	_kfd_topology_enum_kfd_devices
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movl	$1, %ebx
	movq	_kfd_device@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r13)
	movups	%xmm0, 16(%r13)
	movups	%xmm0, (%r13)
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	48(%r13), %rax
	movq	(%rax), %rdx
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	40(%r13), %rdx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	32(%r13), %rdx
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	24(%r13), %rdx
	leaq	L_.str.6(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	16(%r13), %rdx
	leaq	L_.str.7(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	8(%r13), %rdx
	leaq	L_.str.8(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %edi
	movq	(%r13), %rdx
	leaq	L_.str.9(%rip), %rsi
	callq	_dev_dbg
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rsi
	callq	_kfd_topology_enum_kfd_devices
	incq	%rbx
	testq	%rax, %rax
	jne	LBB0_4
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rsi
	callq	_kfd_create_process_device_data
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	leaq	-1(%rbx), %r14
	cmpq	$0, (%r15)
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	leal	-128(%rdx), %eax
	cmpl	$14, %eax
	ja	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$15825, %ecx                    ## imm = 0x3DD1
	movq	%r13, %rdi
	movq	%r14, %rsi
	btl	%eax, %ecx
	jae	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_kfd_init_apertures_vi
	jmp	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_kfd_init_apertures_v9
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	cmpl	$0, 4(%rax)
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_SVM_CWSR_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%r13)
	movq	_SVM_IB_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r13)
	jmp	LBB0_18
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create process device data\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Unexpected ASIC family %u"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SVM_CWSR_BASE,4,2              ## @SVM_CWSR_BASE
	.comm	_SVM_IB_BASE,4,2                ## @SVM_IB_BASE
	.comm	_kfd_device,4,2                 ## @kfd_device
L_.str.2:                               ## @.str.2
	.asciz	"node id %u\n"

L_.str.3:                               ## @.str.3
	.asciz	"gpu id %u\n"

L_.str.4:                               ## @.str.4
	.asciz	"lds_base %llX\n"

L_.str.5:                               ## @.str.5
	.asciz	"lds_limit %llX\n"

L_.str.6:                               ## @.str.6
	.asciz	"gpuvm_base %llX\n"

L_.str.7:                               ## @.str.7
	.asciz	"gpuvm_limit %llX\n"

L_.str.8:                               ## @.str.8
	.asciz	"scratch_base %llX\n"

L_.str.9:                               ## @.str.9
	.asciz	"scratch_limit %llX\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_init_apertures             ; -- Begin function kfd_init_apertures
	.p2align	2
_kfd_init_apertures:                    ; @kfd_init_apertures
	.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	x19, x0
	add	x1, sp, #8
	mov	x0, #0
	bl	_kfd_topology_enum_kfd_devices
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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
LBB0_3:
Lloh0:
	adrp	x22, _kfd_device@GOTPAGE
Lloh1:
	ldr	x22, [x22, _kfd_device@GOTPAGEOFF]
Lloh2:
	adrp	x23, l_.str.5@PAGE
Lloh3:
	add	x23, x23, l_.str.5@PAGEOFF
Lloh4:
	adrp	x24, l_.str.6@PAGE
Lloh5:
	add	x24, x24, l_.str.6@PAGEOFF
Lloh6:
	adrp	x25, l_.str.7@PAGE
Lloh7:
	add	x25, x25, l_.str.7@PAGEOFF
Lloh8:
	adrp	x26, l_.str.8@PAGE
Lloh9:
	add	x26, x26, l_.str.8@PAGEOFF
	mov	w27, #1
Lloh10:
	adrp	x28, l_.str.9@PAGE
Lloh11:
	add	x28, x28, l_.str.9@PAGEOFF
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #16]
	str	q0, [x20]
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x22]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x8, [x20, #48]
	ldr	x2, [x8]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20, #40]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20, #32]
	mov	x1, x23
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20, #24]
	mov	x1, x24
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20, #16]
	mov	x1, x25
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20, #8]
	mov	x1, x26
	bl	_dev_dbg
	ldr	w0, [x22]
	ldr	x2, [x20]
	mov	x1, x28
	bl	_dev_dbg
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x1, sp, #8
	mov	x0, x27
	bl	_kfd_topology_enum_kfd_devices
	add	x27, x27, #1
	cbnz	x0, LBB0_1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x19
	bl	_kfd_create_process_device_data
	cbz	x0, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x20, x0
	sub	x21, x27, #1
	ldr	x8, [x19]
	cbnz	x8, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	w2, [x8]
	sub	w8, w2, #128
	cmp	w8, #14
	b.hi	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #15825
	mov	x0, x20
	mov	x1, x21
	tst	w8, w9
	b.eq	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	bl	_kfd_init_apertures_vi
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_kfd_init_apertures_v9
LBB0_14:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	w8, [x8, #4]
	cbnz	w8, LBB0_5
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh18:
	adrp	x8, _SVM_CWSR_BASE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SVM_CWSR_BASE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _SVM_IB_BASE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SVM_IB_BASE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #56]
	b	LBB0_5
LBB0_16:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
LBB0_18:
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_WARN
Lloh30:
	adrp	x8, _EINVAL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_17
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create process device data\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Unexpected ASIC family %u"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SVM_CWSR_BASE,4,2              ; @SVM_CWSR_BASE
	.comm	_SVM_IB_BASE,4,2                ; @SVM_IB_BASE
	.comm	_kfd_device,4,2                 ; @kfd_device
l_.str.2:                               ; @.str.2
	.asciz	"node id %u\n"

l_.str.3:                               ; @.str.3
	.asciz	"gpu id %u\n"

l_.str.4:                               ; @.str.4
	.asciz	"lds_base %llX\n"

l_.str.5:                               ; @.str.5
	.asciz	"lds_limit %llX\n"

l_.str.6:                               ; @.str.6
	.asciz	"gpuvm_base %llX\n"

l_.str.7:                               ; @.str.7
	.asciz	"gpuvm_limit %llX\n"

l_.str.8:                               ; @.str.8
	.asciz	"scratch_base %llX\n"

l_.str.9:                               ; @.str.9
	.asciz	"scratch_limit %llX\n"

.subsections_via_symbols
