	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_emulated_mailbox_acquire_next_image ## -- Begin function vulkan_emulated_mailbox_acquire_next_image
	.p2align	4, 0x90
_vulkan_emulated_mailbox_acquire_next_image: ## @vulkan_emulated_mailbox_acquire_next_image
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_VK_NULL_HANDLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_VK_ERROR_OUT_OF_DATE_KHR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	callq	_slock_lock
	cmpl	$0, 8(%rbx)
	jne	LBB0_4
## %bb.3:
	movl	$1, 12(%rbx)
	movl	32(%rbx), %edi
	callq	_scond_signal
LBB0_4:
	movl	$1, 8(%rbx)
	cmpl	$0, 16(%rbx)
	je	LBB0_6
## %bb.5:
	movl	20(%rbx), %eax
	movl	28(%rbx), %r15d
	movl	%eax, (%r14)
	movl	$0, 8(%rbx)
	movl	$0, 16(%rbx)
	jmp	LBB0_7
LBB0_6:
	movq	_VK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	movl	24(%rbx), %edi
	callq	_slock_unlock
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VK_NULL_HANDLE,8,3             ## @VK_NULL_HANDLE
	.comm	_VK_ERROR_OUT_OF_DATE_KHR,4,2   ## @VK_ERROR_OUT_OF_DATE_KHR
	.comm	_VK_TIMEOUT,4,2                 ## @VK_TIMEOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_emulated_mailbox_acquire_next_image ; -- Begin function vulkan_emulated_mailbox_acquire_next_image
	.p2align	2
_vulkan_emulated_mailbox_acquire_next_image: ; @vulkan_emulated_mailbox_acquire_next_image
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _VK_NULL_HANDLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VK_NULL_HANDLE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _VK_ERROR_OUT_OF_DATE_KHR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VK_ERROR_OUT_OF_DATE_KHR@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_slock_lock
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_4
; %bb.3:
	mov	w8, #1
	str	w8, [x19, #12]
	ldr	w0, [x19, #32]
	bl	_scond_signal
LBB0_4:
	mov	w8, #1
	str	w8, [x19, #8]
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_6
; %bb.5:
	ldr	w21, [x19, #28]
	ldr	w8, [x19, #20]
	str	w8, [x20]
	str	wzr, [x19, #8]
	str	wzr, [x19, #16]
	b	LBB0_7
LBB0_6:
Lloh6:
	adrp	x8, _VK_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VK_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
LBB0_7:
	ldr	w0, [x19, #24]
	bl	_slock_unlock
LBB0_8:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VK_NULL_HANDLE,8,3             ; @VK_NULL_HANDLE
	.comm	_VK_ERROR_OUT_OF_DATE_KHR,4,2   ; @VK_ERROR_OUT_OF_DATE_KHR
	.comm	_VK_TIMEOUT,4,2                 ; @VK_TIMEOUT
.subsections_via_symbols
