	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_fill_gpu_xgmi_link_to_gpu
_kfd_fill_gpu_xgmi_link_to_gpu:         ## @kfd_fill_gpu_xgmi_link_to_gpu
	.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
	addl	$-40, (%rdi)
	js	LBB0_1
## %bb.2:
	movq	%r8, %r13
	movq	%rcx, %rbx
	movq	%rsi, %r15
	xorl	%r14d, %r14d
	movq	%rcx, %rdi
	xorl	%esi, %esi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	$40, %edx
	movq	%r9, %r12
	callq	_memset
	movq	_CRAT_SUBTYPE_IOLINK_AFFINITY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movl	$40, (%rbx)
	movq	_CRAT_SUBTYPE_FLAGS_ENABLED@GOTPCREL(%rip), %rax
	movq	_CRAT_IOLINK_FLAGS_BI_DIRECTIONAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 4(%rbx)
	movq	_CRAT_IOLINK_TYPE_XGMI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	%r13, 24(%rbx)
	movq	%r12, 16(%rbx)
	movl	(%r15), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	callq	_amdgpu_amdkfd_get_xgmi_hops_count
	movl	%eax, 8(%rbx)
	jmp	LBB0_3
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CRAT_SUBTYPE_IOLINK_AFFINITY,4,2 ## @CRAT_SUBTYPE_IOLINK_AFFINITY
	.comm	_CRAT_SUBTYPE_FLAGS_ENABLED,4,2 ## @CRAT_SUBTYPE_FLAGS_ENABLED
	.comm	_CRAT_IOLINK_FLAGS_BI_DIRECTIONAL,4,2 ## @CRAT_IOLINK_FLAGS_BI_DIRECTIONAL
	.comm	_CRAT_IOLINK_TYPE_XGMI,4,2      ## @CRAT_IOLINK_TYPE_XGMI
	.no_dead_strip	_kfd_fill_gpu_xgmi_link_to_gpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_fill_gpu_xgmi_link_to_gpu
_kfd_fill_gpu_xgmi_link_to_gpu:         ; @kfd_fill_gpu_xgmi_link_to_gpu
	.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
	ldr	w8, [x0]
	subs	w8, w8, #40
	str	w8, [x0]
	b.mi	LBB0_2
; %bb.1:
	mov	x20, x5
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x23, x1
	mov	w24, #40
	mov	x0, x3
	mov	w1, #0
	mov	w2, #40
	bl	_memset
Lloh0:
	adrp	x8, _CRAT_SUBTYPE_IOLINK_AFFINITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CRAT_SUBTYPE_IOLINK_AFFINITY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _CRAT_SUBTYPE_FLAGS_ENABLED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CRAT_SUBTYPE_FLAGS_ENABLED@GOTPAGEOFF]
	str	w24, [x19]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _CRAT_IOLINK_FLAGS_BI_DIRECTIONAL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CRAT_IOLINK_FLAGS_BI_DIRECTIONAL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w9, w10, w9
	ldr	w10, [x19, #4]
	orr	w9, w9, w10
	str	w9, [x19, #4]
Lloh9:
	adrp	x9, _CRAT_IOLINK_TYPE_XGMI@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CRAT_IOLINK_TYPE_XGMI@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
	stp	x20, x22, [x19, #16]
	ldr	w0, [x23]
	ldr	w1, [x21]
	bl	_amdgpu_amdkfd_get_xgmi_hops_count
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #8]
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CRAT_SUBTYPE_IOLINK_AFFINITY,4,2 ; @CRAT_SUBTYPE_IOLINK_AFFINITY
	.comm	_CRAT_SUBTYPE_FLAGS_ENABLED,4,2 ; @CRAT_SUBTYPE_FLAGS_ENABLED
	.comm	_CRAT_IOLINK_FLAGS_BI_DIRECTIONAL,4,2 ; @CRAT_IOLINK_FLAGS_BI_DIRECTIONAL
	.comm	_CRAT_IOLINK_TYPE_XGMI,4,2      ; @CRAT_IOLINK_TYPE_XGMI
	.no_dead_strip	_kfd_fill_gpu_xgmi_link_to_gpu
.subsections_via_symbols
