	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_acquire_next_image      ## -- Begin function vulkan_acquire_next_image
	.p2align	4, 0x90
_vulkan_acquire_next_image:             ## @vulkan_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	_VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	leaq	48(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movb	$1, %r15b
	movq	_VK_NULL_HANDLE@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_21:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_vulkan_acquire_clear_fences
	xorl	%r15d, %r15d
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	jne	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	44(%rbx), %esi
	movl	36(%rbx), %ecx
	movl	40(%rbx), %edx
	movq	%rbx, %rdi
	callq	_vulkan_create_swapchain
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	je	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%edi, %edi
	cmpl	$0, 16(%rbx)
	sete	%dil
	callq	_retro_assert
	cmpq	$0, 56(%rbx)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_vulkan_emulated_mailbox_acquire_next_image
	movq	%rax, %r12
	movq	(%r13), %rax
	movq	%rax, -48(%rbp)
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	32(%rbx), %edi
	leaq	-72(%rbp), %rsi
	xorl	%edx, %edx
	leaq	-48(%rbp), %rcx
	callq	_vkCreateFence
	movl	32(%rbx), %edi
	movq	(%rbx), %rsi
	movq	_UINT64_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r13), %rcx
	movq	-48(%rbp), %r8
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	callq	_vkAcquireNextImageKHR
	movq	%rax, %r12
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r14d, %r14d
	movq	_VK_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rax
	movl	$1, %r14d
	cmpq	(%r13), %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	32(%rbx), %edi
	movq	_UINT64_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$1, %r14d
	movl	$1, %esi
	leaq	-48(%rbp), %rdx
	movl	$1, %ecx
	callq	_vkWaitForFences
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, 16(%rbx)
	movq	-48(%rbp), %rsi
	cmpq	(%r13), %rsi
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	32(%rbx), %edi
	xorl	%edx, %edx
	callq	_vkDestroyFence
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_VK_NOT_READY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_VK_TIMEOUT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_VK_ERROR_OUT_OF_DATE_KHR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_vulkan_destroy_swapchain
	testb	$1, %r15b
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movl	$10, %edi
	callq	_retro_sleep
	jmp	LBB0_21
LBB0_16:
	movl	8(%rbx), %eax
	incl	%eax
	cltd
	idivl	20(%rbx)
	movl	%edx, 8(%rbx)
	jmp	LBB0_24
LBB0_22:
	movq	_VK_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_27
## %bb.23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
LBB0_24:
	movq	24(%rbx), %rax
	movl	%edx, %ecx
	movq	(%rax,%rcx,8), %rdx
	cmpq	(%r13), %rdx
	jne	LBB0_26
## %bb.25:
	leaq	(%rax,%rcx,8), %rcx
	movl	32(%rbx), %edi
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	callq	_vkCreateSemaphore
LBB0_26:
	movq	%rbx, %rdi
	callq	_vulkan_acquire_wait_fences
	jmp	LBB0_30
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_30
LBB0_5:
	movl	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_vulkan_acquire_clear_fences
	movq	%rbx, %rdi
	callq	_vulkan_acquire_wait_fences
	movl	$1, 12(%rbx)
	jmp	LBB0_30
LBB0_27:
	movq	%rbx, %rdi
	callq	_vulkan_destroy_swapchain
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movq	_VK_ERROR_SURFACE_LOST_KHR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_29
## %bb.28:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_29:
	movl	$1, 12(%rbx)
	movq	%rbx, %rdi
	callq	_vulkan_acquire_clear_fences
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,4,2 ## @VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
	.comm	_VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,4,2 ## @VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
	.comm	_VK_NULL_HANDLE,8,3             ## @VK_NULL_HANDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Vulkan]: Failed to create new swapchain.\n"

	.comm	_UINT64_MAX,4,2                 ## @UINT64_MAX
	.comm	_VK_SUCCESS,8,3                 ## @VK_SUCCESS
	.comm	_VK_NOT_READY,8,3               ## @VK_NOT_READY
	.comm	_VK_TIMEOUT,8,3                 ## @VK_TIMEOUT
	.comm	_VK_ERROR_OUT_OF_DATE_KHR,8,3   ## @VK_ERROR_OUT_OF_DATE_KHR
L_.str.1:                               ## @.str.1
	.asciz	"[Vulkan]: Swapchain is out of date, trying to create new one. Have tried multiple times ...\n"

L_.str.2:                               ## @.str.2
	.asciz	"[Vulkan]: Swapchain is out of date, trying to create new one.\n"

L_.str.3:                               ## @.str.3
	.asciz	"[Vulkan]: Failed to acquire from swapchain (err = %d).\n"

	.comm	_VK_ERROR_SURFACE_LOST_KHR,8,3  ## @VK_ERROR_SURFACE_LOST_KHR
L_.str.4:                               ## @.str.4
	.asciz	"[Vulkan]: Got VK_ERROR_SURFACE_LOST_KHR.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_acquire_next_image      ; -- Begin function vulkan_acquire_next_image
	.p2align	2
_vulkan_acquire_next_image:             ; @vulkan_acquire_next_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
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, #16]
Lloh3:
	adrp	x8, _VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	add	x21, x0, #48
	add	x20, x0, #8
	mov	w27, #1
Lloh6:
	adrp	x25, _VK_NULL_HANDLE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _VK_NULL_HANDLE@GOTPAGEOFF]
Lloh8:
	adrp	x26, _VK_SUCCESS@GOTPAGE
Lloh9:
	ldr	x26, [x26, _VK_SUCCESS@GOTPAGEOFF]
Lloh10:
	adrp	x28, _VK_NOT_READY@GOTPAGE
Lloh11:
	ldr	x28, [x28, _VK_NOT_READY@GOTPAGEOFF]
Lloh12:
	adrp	x22, _VK_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _VK_TIMEOUT@GOTPAGEOFF]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_ERR
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_vulkan_acquire_clear_fences
	mov	w27, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w2, w1, [x19, #40]
	ldr	w3, [x19, #36]
	mov	x0, x19
	bl	_vulkan_create_swapchain
	cbz	w0, LBB0_26
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_27
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cset	w0, eq
	bl	_retro_assert
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_vulkan_emulated_mailbox_acquire_next_image
	mov	x24, x0
	ldr	x8, [x25]
	str	x8, [sp, #24]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #32]
	add	x1, sp, #16
	add	x3, sp, #24
	mov	x2, #0
	bl	_vkCreateFence
	ldr	w0, [x19, #32]
	ldr	x1, [x19]
Lloh16:
	adrp	x8, _UINT64_MAX@GOTPAGE
Lloh17:
	ldr	x8, [x8, _UINT64_MAX@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	ldr	x3, [x25]
	ldr	x4, [sp, #24]
	mov	x5, x20
	bl	_vkAcquireNextImageKHR
	mov	x24, x0
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	cmp	x24, x8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp, #24]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #1
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #32]
Lloh19:
	adrp	x8, _UINT64_MAX@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UINT64_MAX@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	mov	w23, #1
	add	x2, sp, #24
	mov	w1, #1
	mov	w3, #1
	bl	_vkWaitForFences
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w23, [x19, #16]
	ldr	x1, [sp, #24]
	ldr	x8, [x25]
	cmp	x1, x8
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #32]
	mov	x2, #0
	bl	_vkDestroyFence
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x28]
	ldr	x9, [x22]
	cmp	x24, x8
	ccmp	x24, x9, #4, ne
	b.eq	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh22:
	adrp	x8, _VK_ERROR_OUT_OF_DATE_KHR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VK_ERROR_OUT_OF_DATE_KHR@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x24, x8
	b.ne	LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_vulkan_destroy_swapchain
	tbnz	w27, #0, LBB0_1
; %bb.19:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #10
	bl	_retro_sleep
	b	LBB0_2
LBB0_20:
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	ldr	w9, [x19, #20]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	str	w8, [x19, #8]
	b	LBB0_23
LBB0_21:
	ldr	x8, [x26]
	cmp	x24, x8
	b.ne	LBB0_28
; %bb.22:
	ldr	w8, [x20]
LBB0_23:
	ldr	x9, [x19, #24]
	add	x3, x9, w8, uxtw #3
	ldr	x8, [x3]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.24:
	ldr	w0, [x19, #32]
	add	x1, sp, #8
	mov	x2, #0
	bl	_vkCreateSemaphore
LBB0_25:
	mov	x0, x19
	bl	_vulkan_acquire_wait_fences
	b	LBB0_31
LBB0_26:
Lloh27:
	adrp	x0, l_.str@PAGE
Lloh28:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_31
LBB0_27:
	str	wzr, [x19, #8]
	mov	x0, x19
	bl	_vulkan_acquire_clear_fences
	mov	x0, x19
	bl	_vulkan_acquire_wait_fences
	mov	w8, #1
	str	w8, [x19, #12]
	b	LBB0_31
LBB0_28:
	mov	x0, x19
	bl	_vulkan_destroy_swapchain
	str	x24, [sp]
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_ERR
Lloh31:
	adrp	x8, _VK_ERROR_SURFACE_LOST_KHR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _VK_ERROR_SURFACE_LOST_KHR@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	cmp	x24, x8
	b.ne	LBB0_30
; %bb.29:
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_RARCH_ERR
LBB0_30:
	mov	w8, #1
	str	w8, [x19, #12]
	mov	x0, x19
	bl	_vulkan_acquire_clear_fences
LBB0_31:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,4,2 ; @VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
	.comm	_VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,4,2 ; @VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
	.comm	_VK_NULL_HANDLE,8,3             ; @VK_NULL_HANDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Vulkan]: Failed to create new swapchain.\n"

	.comm	_UINT64_MAX,4,2                 ; @UINT64_MAX
	.comm	_VK_SUCCESS,8,3                 ; @VK_SUCCESS
	.comm	_VK_NOT_READY,8,3               ; @VK_NOT_READY
	.comm	_VK_TIMEOUT,8,3                 ; @VK_TIMEOUT
	.comm	_VK_ERROR_OUT_OF_DATE_KHR,8,3   ; @VK_ERROR_OUT_OF_DATE_KHR
l_.str.1:                               ; @.str.1
	.asciz	"[Vulkan]: Swapchain is out of date, trying to create new one. Have tried multiple times ...\n"

l_.str.2:                               ; @.str.2
	.asciz	"[Vulkan]: Swapchain is out of date, trying to create new one.\n"

l_.str.3:                               ; @.str.3
	.asciz	"[Vulkan]: Failed to acquire from swapchain (err = %d).\n"

	.comm	_VK_ERROR_SURFACE_LOST_KHR,8,3  ; @VK_ERROR_SURFACE_LOST_KHR
l_.str.4:                               ; @.str.4
	.asciz	"[Vulkan]: Got VK_ERROR_SURFACE_LOST_KHR.\n"

.subsections_via_symbols
