	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vulkan_emulated_mailbox_loop
_vulkan_emulated_mailbox_loop:          ## @vulkan_emulated_mailbox_loop
	.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
	movq	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.1:
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rcx
	xorl	%edx, %edx
	callq	_vkCreateFence
	movl	24(%rbx), %edi
	callq	_slock_lock
	cmpq	$0, 40(%rbx)
	je	LBB0_2
LBB0_11:
	movl	24(%rbx), %edi
	callq	_slock_unlock
	movl	20(%rbx), %edi
	movl	-44(%rbp), %esi
	xorl	%edx, %edx
	callq	_vkDestroyFence
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	32(%rbx), %r14
	movq	_UINT64_MAX@GOTPCREL(%rip), %r12
	movq	_VK_SUCCESS@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rbx), %edi
	callq	_slock_lock
	cmpq	$0, 40(%rbx)
	jne	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rbx)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, (%rbx)
	movl	24(%rbx), %edi
	callq	_slock_unlock
	movl	20(%rbx), %edi
	movl	36(%rbx), %esi
	movl	(%r12), %edx
	movq	_VK_NULL_HANDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-44(%rbp), %r8d
	movq	%r14, %r9
	callq	_vkAcquireNextImageKHR
	movq	%rax, 8(%rbx)
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%rbx), %edi
	movl	(%r12), %r8d
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_vkWaitForFences
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%rbx), %edi
	movl	$1, %esi
	movq	%r15, %rdx
	callq	_vkResetFences
	movq	8(%rbx), %rax
	cmpq	(%r13), %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rbx), %edi
	callq	_slock_lock
	movl	$1, 16(%rbx)
	movl	28(%rbx), %edi
	callq	_scond_signal
	movl	24(%rbx), %edi
	callq	_slock_unlock
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_scond_wait
	cmpq	$0, 40(%rbx)
	je	LBB0_3
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,4,2 ## @VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
	.comm	_UINT64_MAX,4,2                 ## @UINT64_MAX
	.comm	_VK_NULL_HANDLE,4,2             ## @VK_NULL_HANDLE
	.comm	_VK_SUCCESS,8,3                 ## @VK_SUCCESS
	.no_dead_strip	_vulkan_emulated_mailbox_loop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vulkan_emulated_mailbox_loop
_vulkan_emulated_mailbox_loop:          ; @vulkan_emulated_mailbox_loop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
Lloh0:
	adrp	x8, _VK_STRUCTURE_TYPE_FENCE_CREATE_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VK_STRUCTURE_TYPE_FENCE_CREATE_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #20]
	add	x1, sp, #8
	add	x3, sp, #12
	mov	x2, #0
	bl	_vkCreateFence
	ldr	w0, [x19, #24]
	bl	_slock_lock
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_4
LBB0_2:
	ldr	w0, [x19, #24]
	bl	_slock_unlock
	ldr	w0, [x19, #20]
	ldr	w1, [sp, #12]
	mov	x2, #0
	bl	_vkDestroyFence
LBB0_3:
	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
	add	sp, sp, #80
	ret
LBB0_4:
Lloh3:
	adrp	x21, _UINT64_MAX@GOTPAGE
Lloh4:
	ldr	x21, [x21, _UINT64_MAX@GOTPAGEOFF]
	add	x20, x19, #32
Lloh5:
	adrp	x22, _VK_NULL_HANDLE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _VK_NULL_HANDLE@GOTPAGEOFF]
	mov	w23, #1
Lloh7:
	adrp	x24, _VK_SUCCESS@GOTPAGE
Lloh8:
	ldr	x24, [x24, _VK_SUCCESS@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #24]
	bl	_slock_lock
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_2
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	cbz	w8, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	str	wzr, [x19]
	ldr	w0, [x19, #24]
	bl	_slock_unlock
	ldr	w0, [x19, #20]
	ldr	w1, [x19, #36]
	ldr	w2, [x21]
	ldr	w3, [x22]
	ldr	w4, [sp, #12]
	mov	x5, x20
	bl	_vkAcquireNextImageKHR
	str	x0, [x19, #8]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #20]
	ldr	w4, [x21]
	add	x2, sp, #12
	mov	w1, #1
	mov	w3, #1
	bl	_vkWaitForFences
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #20]
	add	x2, sp, #12
	mov	w1, #1
	bl	_vkResetFences
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #24]
	bl	_slock_lock
	str	w23, [x19, #16]
	ldr	w0, [x19, #28]
	bl	_scond_signal
	ldr	w0, [x19, #24]
	bl	_slock_unlock
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	w1, w0, [x19, #24]
	bl	_scond_wait
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_6
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,4,2 ; @VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
	.comm	_UINT64_MAX,4,2                 ; @UINT64_MAX
	.comm	_VK_NULL_HANDLE,4,2             ; @VK_NULL_HANDLE
	.comm	_VK_SUCCESS,8,3                 ; @VK_SUCCESS
	.no_dead_strip	_vulkan_emulated_mailbox_loop
.subsections_via_symbols
