	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_ctx_drm_wait_flip
_gfx_ctx_drm_wait_flip:                 ## @gfx_ctx_drm_wait_flip
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_waiting_for_flip@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	negl	%edi
	sbbl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_drm_wait_flip
	movq	(%r14), %rcx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%rcx, %rcx
	jne	LBB0_2
LBB0_4:
	movl	$1, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.5:
	movq	_g_gbm_surface@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_g_bo@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_gbm_surface_release_buffer
	movq	_g_next_bo@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_waiting_for_flip,8,3           ## @waiting_for_flip
	.comm	_g_gbm_surface,4,2              ## @g_gbm_surface
	.comm	_g_bo,4,2                       ## @g_bo
	.comm	_g_next_bo,4,2                  ## @g_next_bo
	.no_dead_strip	_gfx_ctx_drm_wait_flip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_ctx_drm_wait_flip
_gfx_ctx_drm_wait_flip:                 ; @gfx_ctx_drm_wait_flip
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _waiting_for_flip@GOTPAGE
Lloh1:
	ldr	x20, [x20, _waiting_for_flip@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_6
; %bb.1:
	cmp	w0, #0
	csetm	w19, ne
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_drm_wait_flip
	ldr	x8, [x20]
	cbz	w0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbnz	x8, LBB0_2
LBB0_4:
	cbz	x8, LBB0_7
; %bb.5:
	mov	w0, #1
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _g_gbm_surface@GOTPAGE
Lloh3:
	ldr	x8, [x8, _g_gbm_surface@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x19, _g_bo@GOTPAGE
Lloh6:
	ldr	x19, [x19, _g_bo@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_gbm_surface_release_buffer
	mov	w0, #0
Lloh7:
	adrp	x8, _g_next_bo@GOTPAGE
Lloh8:
	ldr	x8, [x8, _g_next_bo@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_waiting_for_flip,8,3           ; @waiting_for_flip
	.comm	_g_gbm_surface,4,2              ; @g_gbm_surface
	.comm	_g_bo,4,2                       ; @g_bo
	.comm	_g_next_bo,4,2                  ; @g_next_bo
	.no_dead_strip	_gfx_ctx_drm_wait_flip
.subsections_via_symbols
