	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_fill_cu_for_cpu
_kfd_fill_cu_for_cpu:                   ## @kfd_fill_cu_for_cpu
	.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	$-24, (%rsi)
	js	LBB0_1
## %bb.3:
	movq	%rcx, %rbx
	movl	%edx, %r12d
	movl	%edi, %r15d
	xorl	%r14d, %r14d
	movq	%rcx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movl	$24, (%rbx)
	movq	_CRAT_SUBTYPE_FLAGS_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movl	%r15d, %edi
	callq	_cpumask_of_node
	movq	%rax, %r13
	movq	_CRAT_CU_FLAGS_CPU_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	movl	%r12d, 4(%rbx)
	movl	%r15d, %edi
	callq	_kfd_numa_node_to_apic_id
	movl	%eax, 8(%rbx)
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	movq	%r13, %rdi
	callq	_cpumask_weight
	movl	%eax, 12(%rbx)
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_6:
	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_COMPUTEUNIT_AFFINITY,4,2 ## @CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY
	.comm	_CRAT_SUBTYPE_FLAGS_ENABLED,4,2 ## @CRAT_SUBTYPE_FLAGS_ENABLED
	.comm	_CRAT_CU_FLAGS_CPU_PRESENT,4,2  ## @CRAT_CU_FLAGS_CPU_PRESENT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kfd_fill_cu_for_cpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_fill_cu_for_cpu
_kfd_fill_cu_for_cpu:                   ; @kfd_fill_cu_for_cpu
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x1]
	subs	w8, w8, #24
	str	w8, [x1]
	b.mi	LBB0_3
; %bb.1:
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	mov	w22, #24
	mov	x0, x3
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh0:
	adrp	x8, _CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w22, [x19]
Lloh3:
	adrp	x9, _CRAT_SUBTYPE_FLAGS_ENABLED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CRAT_SUBTYPE_FLAGS_ENABLED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
	mov	x0, x20
	bl	_cpumask_of_node
	mov	x22, x0
Lloh6:
	adrp	x8, _CRAT_CU_FLAGS_CPU_PRESENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CRAT_CU_FLAGS_CPU_PRESENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	str	w21, [x19, #4]
	mov	x0, x20
	bl	_kfd_numa_node_to_apic_id
	str	w0, [x19, #8]
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_cpumask_weight
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #12]
	b	LBB0_6
LBB0_3:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY,4,2 ; @CRAT_SUBTYPE_COMPUTEUNIT_AFFINITY
	.comm	_CRAT_SUBTYPE_FLAGS_ENABLED,4,2 ; @CRAT_SUBTYPE_FLAGS_ENABLED
	.comm	_CRAT_CU_FLAGS_CPU_PRESENT,4,2  ; @CRAT_CU_FLAGS_CPU_PRESENT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kfd_fill_cu_for_cpu
.subsections_via_symbols
