	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_alloc_gws        ## -- Begin function amdgpu_amdkfd_alloc_gws
	.p2align	4, 0x90
_amdgpu_amdkfd_alloc_gws:               ## @amdgpu_amdkfd_alloc_gws
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -40(%rbp)
	leaq	-80(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%rbx, -80(%rbp)
	movl	$1, -72(%rbp)
	movq	_AMDGPU_GEM_DOMAIN_GWS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_ttm_bo_type_device@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	$0, -64(%rbp)
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_amdgpu_bo_create
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_3
LBB0_2:
	movq	-40(%rbp), %rax
	movq	%rax, (%r14)
LBB0_3:
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_DOMAIN_GWS,4,2      ## @AMDGPU_GEM_DOMAIN_GWS
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ## @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_ttm_bo_type_device,4,2         ## @ttm_bo_type_device
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate gws BO for amdkfd (%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_alloc_gws        ; -- Begin function amdgpu_amdkfd_alloc_gws
	.p2align	2
_amdgpu_amdkfd_alloc_gws:               ; @amdgpu_amdkfd_alloc_gws
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [sp, #40]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	str	x21, [sp]
	mov	w8, #1
Lloh0:
	adrp	x9, _AMDGPU_GEM_DOMAIN_GWS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_GWS@GOTPAGEOFF]
	str	w8, [sp, #8]
Lloh2:
	ldr	w8, [x9]
	str	w8, [sp, #32]
Lloh3:
	adrp	x8, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _ttm_bo_type_device@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ttm_bo_type_device@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
	str	xzr, [sp, #16]
	mov	x1, sp
	add	x2, sp, #40
	mov	x0, x20
	bl	_amdgpu_bo_create
	mov	x21, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	ldr	x8, [sp, #40]
	str	x8, [x19]
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_DOMAIN_GWS,4,2      ; @AMDGPU_GEM_DOMAIN_GWS
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ; @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_ttm_bo_type_device,4,2         ; @ttm_bo_type_device
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate gws BO for amdkfd (%d)\n"

.subsections_via_symbols
