	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sync_fence              ## -- Begin function amdgpu_sync_fence
	.p2align	4, 0x90
_amdgpu_sync_fence:                     ## @amdgpu_sync_fence
	.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
	xorl	%r14d, %r14d
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.1:
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdx, %rsi
	callq	_amdgpu_sync_same_dev
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_amdgpu_sync_get_owner
	movq	_AMDGPU_FENCE_OWNER_VM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	4(%r12), %rdi
	movq	%rbx, %rsi
	callq	_amdgpu_sync_keep_later
LBB0_4:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_amdgpu_sync_add_later
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:
	movq	_amdgpu_sync_slab@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmem_cache_alloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r13
	movl	%r15d, (%rax)
	movl	(%r12), %edi
	movq	%rax, %rsi
	addq	$8, %rsi
	movl	(%rbx), %edx
	callq	_hash_add
	movq	%rbx, %rdi
	callq	_dma_fence_get
	movl	%eax, 4(%r13)
	jmp	LBB0_8
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_FENCE_OWNER_VM,8,3      ## @AMDGPU_FENCE_OWNER_VM
	.comm	_amdgpu_sync_slab,4,2           ## @amdgpu_sync_slab
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sync_fence              ; -- Begin function amdgpu_sync_fence
	.p2align	2
_amdgpu_sync_fence:                     ; @amdgpu_sync_fence
	.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
	cbz	x2, LBB0_5
; %bb.1:
	mov	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x1, x2
	bl	_amdgpu_sync_same_dev
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_amdgpu_sync_get_owner
Lloh0:
	adrp	x8, _AMDGPU_FENCE_OWNER_VM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_FENCE_OWNER_VM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	add	x0, x21, #4
	mov	x1, x19
	bl	_amdgpu_sync_keep_later
LBB0_4:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_amdgpu_sync_add_later
	cbz	x0, LBB0_7
LBB0_5:
	mov	w0, #0
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
LBB0_7:
Lloh3:
	adrp	x8, _amdgpu_sync_slab@GOTPAGE
Lloh4:
	ldr	x8, [x8, _amdgpu_sync_slab@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_kmem_cache_alloc
	cbz	x0, LBB0_9
; %bb.8:
	mov	x22, x0
	str	w20, [x0]
	ldr	w0, [x21]
	add	x1, x22, #8
	ldr	w2, [x19]
	bl	_hash_add
	mov	x0, x19
	bl	_dma_fence_get
	mov	x8, x0
	mov	w0, #0
	str	w8, [x22, #4]
	b	LBB0_6
LBB0_9:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_FENCE_OWNER_VM,8,3      ; @AMDGPU_FENCE_OWNER_VM
	.comm	_amdgpu_sync_slab,4,2           ; @amdgpu_sync_slab
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
