	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vulkan_destroy_swapchain
_vulkan_destroy_swapchain:              ## @vulkan_destroy_swapchain
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	addq	$48, %rdi
	callq	_vulkan_emulated_mailbox_deinit
	movq	(%r12), %rax
	movq	_VK_NULL_HANDLE@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	je	LBB0_2
## %bb.1:
	movl	40(%r12), %edi
	callq	_vkDeviceWaitIdle
	movl	40(%r12), %edi
	movq	(%r12), %rsi
	xorl	%edx, %edx
	callq	_vkDestroySwapchainKHR
	movq	8(%r12), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	(%r14), %rax
	movq	%rax, (%r12)
	movl	$0, 16(%r12)
LBB0_2:
	movq	_VULKAN_MAX_SWAPCHAIN_IMAGES@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_9
## %bb.3:
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movl	(%r15), %eax
	cmpq	%rax, %rbx
	jae	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	cmpq	(%r14), %rsi
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	40(%r12), %edi
	xorl	%edx, %edx
	callq	_vkDestroySemaphore
	movq	(%r14), %rsi
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	cmpq	%rsi, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	40(%r12), %edi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_vkDestroyFence
	jmp	LBB0_8
LBB0_9:
	movq	24(%r12), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	32(%r12), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VK_NULL_HANDLE,8,3             ## @VK_NULL_HANDLE
	.comm	_VULKAN_MAX_SWAPCHAIN_IMAGES,4,2 ## @VULKAN_MAX_SWAPCHAIN_IMAGES
	.no_dead_strip	_vulkan_destroy_swapchain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vulkan_destroy_swapchain
_vulkan_destroy_swapchain:              ; @vulkan_destroy_swapchain
	.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
	mov	x19, x0
	add	x0, x0, #48
	bl	_vulkan_emulated_mailbox_deinit
	ldr	x8, [x19]
Lloh0:
	adrp	x20, _VK_NULL_HANDLE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _VK_NULL_HANDLE@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #40]
	bl	_vkDeviceWaitIdle
	ldr	w0, [x19, #40]
	ldr	x1, [x19]
	mov	x2, #0
	bl	_vkDestroySwapchainKHR
	ldr	x0, [x19, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x20]
	str	x8, [x19]
	str	wzr, [x19, #16]
LBB0_2:
Lloh2:
	adrp	x21, _VULKAN_MAX_SWAPCHAIN_IMAGES@GOTPAGE
Lloh3:
	ldr	x21, [x21, _VULKAN_MAX_SWAPCHAIN_IMAGES@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_9
; %bb.3:
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldr	w8, [x21]
	cmp	x22, x8
	b.hs	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x1, [x8, x22, lsl #3]
	ldr	x8, [x20]
	cmp	x1, x8
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #40]
	mov	x2, #0
	bl	_vkDestroySemaphore
	ldr	x1, [x20]
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #32]
	ldr	x8, [x8, x22, lsl #3]
	cmp	x8, x1
	b.eq	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #40]
	mov	x1, x8
	mov	x2, #0
	bl	_vkDestroyFence
	b	LBB0_4
LBB0_9:
	ldr	x0, [x19, #24]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x0, [x19, #32]
	mov	w1, #0
	mov	w2, #8
	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
	b	_memset
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_VK_NULL_HANDLE,8,3             ; @VK_NULL_HANDLE
	.comm	_VULKAN_MAX_SWAPCHAIN_IMAGES,4,2 ; @VULKAN_MAX_SWAPCHAIN_IMAGES
	.no_dead_strip	_vulkan_destroy_swapchain
.subsections_via_symbols
