	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vulkan_read_viewport
_vulkan_read_viewport:                  ## @vulkan_read_viewport
	.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
	xorl	%eax, %eax
	testq	%rdi, %rdi
	je	LBB0_30
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %rcx
	movq	48(%rdi), %r13
	movq	(%rcx), %r12
	shlq	$5, %r12
	leaq	(%r12,%r13), %rbx
	cmpq	$0, 40(%rdi)
	je	LBB0_6
## %bb.2:
	movq	$0, -56(%rbp)
	movl	8(%rcx), %edx
	addl	$-128, %edx
	cmpl	$3, %edx
	jae	LBB0_3
## %bb.4:
	movq	(%rbx), %rsi
	movq	_VK_NULL_HANDLE@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	je	LBB0_30
## %bb.5:
	movslq	%edx, %rax
	leaq	l_switch.table.vulkan_read_viewport(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	%r14, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %eax
	leal	(%rax,%rax,2), %eax
	addl	$-3, %eax
	movslq	12(%r14), %rdx
	cltq
	imulq	%rdx, %rax
	leaq	(%r15,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	12(%rcx), %edi
	movl	24(%r13,%r12), %ecx
	movl	28(%r13,%r12), %edx
	movq	%rbx, %r15
	leaq	-56(%rbp), %r9
	xorl	%r8d, %r8d
	callq	_vkMapMemory
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_vulkan_sync_texture_to_cpu
	movl	8(%r13,%r12), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%r14,%rcx)
	movl	12(%r14), %eax
	leal	(%rax,%rax,2), %eax
	negl	%eax
	movl	%eax, (%r14,%rcx)
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_scaler_ctx_scale_direct
	movq	(%r14), %rax
	movl	12(%rax), %edi
	movq	(%rbx), %rsi
	callq	_vkUnmapMemory
	jmp	LBB0_29
LBB0_6:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$1, 16(%r14)
	testl	%edx, %edx
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_video_driver_cached_frame
	movq	(%r14), %rcx
LBB0_8:
	movl	20(%rcx), %edi
	callq	_vkQueueWaitIdle
	leaq	(%r12,%r13), %rbx
	addq	$16, %rbx
	cmpq	$0, 16(%r13,%r12)
	jne	LBB0_10
## %bb.9:
	movq	(%r14), %rax
	movl	12(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_vulkan_map_persistent_texture
LBB0_10:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_vulkan_sync_texture_to_cpu
	movq	(%rbx), %r11
	movl	8(%r14), %edi
	leal	(%rdi,%rdi,2), %eax
	addl	$-3, %eax
	movl	12(%r14), %esi
	imull	%esi, %eax
	cltq
	leaq	(%r15,%rax,4), %rdx
	movq	(%r14), %r8
	movl	8(%r8), %eax
	cmpl	$128, %eax
	je	LBB0_20
## %bb.11:
	cmpl	$130, %eax
	je	LBB0_20
## %bb.12:
	cmpl	$129, %eax
	jne	LBB0_27
## %bb.13:
	testl	%edi, %edi
	je	LBB0_28
## %bb.14:
	leaq	(%r12,%r13), %r9
	addq	$8, %r9
	xorl	%r10d, %r10d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=1
	incl	%r10d
	movslq	(%r9), %rax
	leaq	(%r11,%rax,4), %r11
	leal	(%rsi,%rsi,2), %eax
	cltq
	shlq	$2, %rax
	subq	%rax, %rdx
	cmpl	%edi, %r10d
	jae	LBB0_28
LBB0_15:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	testl	%esi, %esi
	movl	$0, %esi
	je	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	$2, %edi
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_15 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-2(%rdi), %esi
	movl	(%r11,%rsi,4), %esi
	leal	-2(%rax), %ecx
	movl	%esi, (%rdx,%rcx,4)
	leal	-1(%rdi), %ecx
	movl	(%r11,%rcx,4), %ecx
	leal	-1(%rax), %esi
	movl	%ecx, (%rdx,%rsi,4)
	movl	%edi, %ecx
	movl	(%r11,%rcx,4), %ecx
	movl	%eax, %esi
	movl	%ecx, (%rdx,%rsi,4)
	incq	%rbx
	movl	12(%r14), %esi
	addl	$3, %eax
	addl	$4, %edi
	cmpq	%rsi, %rbx
	jb	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	8(%r14), %edi
	jmp	LBB0_19
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	jmp	LBB0_29
LBB0_20:
	testl	%edi, %edi
	je	LBB0_28
## %bb.21:
	leaq	(%r12,%r13), %r9
	addq	$8, %r9
	xorl	%r10d, %r10d
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_22 Depth=1
	incl	%r10d
	movslq	(%r9), %rax
	leaq	(%r11,%rax,4), %r11
	leal	(%rsi,%rsi,2), %eax
	cltq
	shlq	$2, %rax
	subq	%rax, %rdx
	cmpl	%edi, %r10d
	jae	LBB0_28
LBB0_22:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
	testl	%esi, %esi
	movl	$0, %esi
	je	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	xorl	%edi, %edi
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_22 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-2(%rax), %ecx
	movl	(%r11,%rcx,4), %ecx
	leal	2(%rdi), %esi
	movl	%ecx, (%rdx,%rsi,4)
	leal	-1(%rax), %ecx
	movl	(%r11,%rcx,4), %ecx
	leal	1(%rdi), %esi
	movl	%ecx, (%rdx,%rsi,4)
	movl	%eax, %ecx
	movl	(%r11,%rcx,4), %ecx
	movl	%edi, %esi
	movl	%ecx, (%rdx,%rsi,4)
	incq	%rbx
	movl	12(%r14), %esi
	addl	$3, %edi
	addl	$4, %eax
	cmpq	%rsi, %rbx
	jb	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	8(%r14), %edi
	jmp	LBB0_26
LBB0_27:
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_ERR
	movq	(%r14), %r8
LBB0_28:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	12(%r8), %edi
	callq	_vulkan_destroy_texture
LBB0_29:
	movl	$1, %eax
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Vulkan]: Unexpected swapchain format. Cannot readback.\n"

	.comm	_VK_NULL_HANDLE,8,3             ## @VK_NULL_HANDLE
L_.str.1:                               ## @.str.1
	.asciz	"[Vulkan]: Unexpected swapchain format.\n"

	.no_dead_strip	_vulkan_read_viewport
	.section	__TEXT,__const
	.p2align	3                               ## @switch.table.vulkan_read_viewport
l_switch.table.vulkan_read_viewport:
	.quad	28                              ## 0x1c
	.quad	20                              ## 0x14
	.quad	28                              ## 0x1c

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vulkan_read_viewport
_vulkan_read_viewport:                  ; @vulkan_read_viewport
	.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
	cbz	x0, LBB0_31
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x23, [x8]
	ldp	x9, x24, [x0, #40]
	add	x19, x24, x23, lsl #5
	cbz	x9, LBB0_5
; %bb.2:
	str	xzr, [sp, #8]
	ldr	w9, [x8, #8]
	sub	w9, w9, #128
	cmp	w9, #3
	b.hs	LBB0_19
; %bb.3:
	ldr	x1, [x19]
Lloh0:
	adrp	x10, _VK_NULL_HANDLE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _VK_NULL_HANDLE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x1, x10
	b.ne	LBB0_27
; %bb.4:
	mov	w0, #0
	b	LBB0_31
LBB0_5:
	mov	w9, #1
	str	w9, [x20, #16]
	cbnz	w2, LBB0_7
; %bb.6:
	bl	_video_driver_cached_frame
	ldr	x8, [x20]
LBB0_7:
	ldr	w0, [x8, #20]
	bl	_vkQueueWaitIdle
	add	x22, x24, x23, lsl #5
	ldr	x8, [x22, #16]!
	cbnz	x8, LBB0_9
; %bb.8:
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	mov	x1, x19
	bl	_vulkan_map_persistent_texture
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_vulkan_sync_texture_to_cpu
	ldr	x9, [x22]
	ldp	w11, w12, [x20, #8]
	add	w8, w11, w11, lsl #1
	sub	w8, w8, #3
	mul	w8, w8, w12
	add	x10, x21, w8, sxtw #2
	ldr	x8, [x20]
	ldr	w13, [x8, #8]
	cmp	w13, #128
	b.eq	LBB0_20
; %bb.10:
	cmp	w13, #130
	b.eq	LBB0_20
; %bb.11:
	cmp	w13, #129
	b.ne	LBB0_28
; %bb.12:
	cbz	w11, LBB0_29
; %bb.13:
	mov	w13, #0
	add	x14, x24, x23, lsl #5
	add	x14, x14, #8
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	w13, w13, #1
	ldrsw	x15, [x14]
	add	x9, x9, x15, lsl #2
	add	w15, w12, w12, lsl #1
	sub	x10, x10, w15, sxtw #2
	cmp	w13, w11
	b.hs	LBB0_29
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
	cbz	w12, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x11, #0
	mov	w15, #2
	mov	w16, #2
LBB0_17:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w12, w15, #2
	ldr	w12, [x9, w12, uxtw #2]
	sub	w17, w16, #2
	str	w12, [x10, w17, uxtw #2]
	sub	w12, w15, #1
	ldr	w12, [x9, w12, uxtw #2]
	sub	w17, w16, #1
	str	w12, [x10, w17, uxtw #2]
	ldr	w12, [x9, w15, uxtw #2]
	str	w12, [x10, w16, uxtw #2]
	add	x11, x11, #1
	ldr	w12, [x20, #12]
	add	w16, w16, #3
	add	w15, w15, #4
	cmp	x11, x12
	b.lo	LBB0_17
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w11, [x20, #8]
	b	LBB0_14
LBB0_19:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_30
LBB0_20:
	cbz	w11, LBB0_29
; %bb.21:
	mov	w13, #0
	add	x14, x24, x23, lsl #5
	add	x14, x14, #8
                                        ; kill: def $w12 killed $w12 killed $x12 def $x12
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w13, w13, #1
	ldrsw	x15, [x14]
	add	x9, x9, x15, lsl #2
	add	w15, w12, w12, lsl #1
	sub	x10, x10, w15, sxtw #2
	cmp	w13, w11
	b.hs	LBB0_29
LBB0_23:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_25 Depth 2
	cbz	w12, LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w11, #0
	mov	x15, #0
	mov	w16, #2
LBB0_25:                                ;   Parent Loop BB0_23 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w12, w16, #2
	ldr	w12, [x9, w12, uxtw #2]
	add	w17, w11, #2
	str	w12, [x10, w17, uxtw #2]
	sub	w12, w16, #1
	ldr	w12, [x9, w12, uxtw #2]
	add	w17, w11, #1
	str	w12, [x10, w17, uxtw #2]
	ldr	w12, [x9, w16, uxtw #2]
	str	w12, [x10, w11, uxtw #2]
	add	x15, x15, #1
	ldr	w12, [x20, #12]
	add	w11, w11, #3
	add	w16, w16, #4
	cmp	x15, x12
	b.lo	LBB0_25
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w11, [x20, #8]
	b	LBB0_22
LBB0_27:
Lloh5:
	adrp	x10, l_switch.table.vulkan_read_viewport@PAGE
Lloh6:
	add	x10, x10, l_switch.table.vulkan_read_viewport@PAGEOFF
	ldr	x9, [x10, w9, sxtw #3]
	add	x22, x20, x9
	ldp	w9, w10, [x20, #8]
	add	w9, w9, w9, lsl #1
	sub	w9, w9, #3
	mul	w9, w9, w10
	add	x21, x21, w9, sxtw #2
	ldr	w0, [x8, #12]
	add	x23, x24, x23, lsl #5
	ldp	w3, w2, [x23, #24]
	add	x5, sp, #8
	mov	w4, #0
	bl	_vkMapMemory
	mov	x0, x20
	mov	x1, x19
	bl	_vulkan_sync_texture_to_cpu
	ldr	w8, [x23, #8]
	ldr	w9, [x20, #12]
	sub	w9, w9, w9, lsl #2
	stp	w9, w8, [x22]
	ldr	x2, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_scaler_ctx_scale_direct
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	ldr	x1, [x19]
	bl	_vkUnmapMemory
	b	LBB0_30
LBB0_28:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
	ldr	x8, [x20]
LBB0_29:
	ldr	w0, [x8, #12]
	mov	x1, x19
	bl	_vulkan_destroy_texture
LBB0_30:
	mov	w0, #1
LBB0_31:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Vulkan]: Unexpected swapchain format. Cannot readback.\n"

	.comm	_VK_NULL_HANDLE,8,3             ; @VK_NULL_HANDLE
l_.str.1:                               ; @.str.1
	.asciz	"[Vulkan]: Unexpected swapchain format.\n"

	.no_dead_strip	_vulkan_read_viewport
	.section	__TEXT,__const
	.p2align	3                               ; @switch.table.vulkan_read_viewport
l_switch.table.vulkan_read_viewport:
	.quad	28                              ; 0x1c
	.quad	20                              ; 0x14
	.quad	28                              ; 0x1c

.subsections_via_symbols
