	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_cs_wait_all_fences
_amdgpu_cs_wait_all_fences:             ## @amdgpu_cs_wait_all_fences
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %r14d
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rcx, %rbx
	movl	$1, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	addq	$4, %rbx
	decq	%r14
	je	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	callq	_amdgpu_gem_timeout
	movq	%rax, %r13
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_amdgpu_cs_get_fence
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%r12, %r12
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	callq	_dma_fence_wait_timeout
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_dma_fence_put
	testq	%r15, %r15
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %r12d
	testl	%r12d, %r12d
	je	LBB0_10
	jmp	LBB0_12
LBB0_1:
	movl	$1, %r15d
	jmp	LBB0_11
LBB0_13:
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_6:
	movl	%r15d, %r12d
	jmp	LBB0_12
LBB0_8:
	xorl	%r15d, %r15d
LBB0_11:
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	xorl	%eax, %eax
	testq	%r15, %r15
	setg	%al
	movl	%eax, (%rbx)
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_amdgpu_cs_wait_all_fences
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_cs_wait_all_fences
_amdgpu_cs_wait_all_fences:             ; @amdgpu_cs_wait_all_fences
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	ldr	w26, [x2]
	cbz	w26, LBB0_9
; %bb.1:
	mov	x21, x3
	mov	x22, x1
	mov	x23, x0
	mov	w20, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #4
	subs	x26, x26, #1
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #4]
	bl	_amdgpu_gem_timeout
	mov	x25, x0
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	bl	_amdgpu_cs_get_fence
	mov	x24, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x24, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	mov	w1, #1
	mov	x2, x25
	bl	_dma_fence_wait_timeout
	mov	x20, x0
	mov	x0, x24
	bl	_dma_fence_put
	tbnz	x20, #63, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x20, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	cbz	w8, LBB0_2
; %bb.8:
	mov	x20, x8
	b	LBB0_11
LBB0_9:
	mov	w20, #1
LBB0_10:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	cmp	x20, #0
	mov	w20, #0
	cset	w8, gt
	str	w8, [x19]
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_amdgpu_cs_wait_all_fences
.subsections_via_symbols
