	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vulkan_context_init_gpu
_vulkan_context_init_gpu:               ## @vulkan_context_init_gpu
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	$0, -44(%rbp)
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %r13
	movl	8(%r15), %edi
	leaq	-44(%rbp), %rsi
	xorl	%edx, %edx
	callq	_vkEnumeratePhysicalDevices
	movq	_VK_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_1
## %bb.2:
	movl	-44(%rbp), %edi
	movl	$8, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movl	8(%r15), %edi
	leaq	-44(%rbp), %rsi
	movq	%rax, %rdx
	callq	_vkEnumeratePhysicalDevices
	cmpq	(%rbx), %rax
	jne	LBB0_4
## %bb.6:
	cmpl	$0, -44(%rbp)
	jle	LBB0_7
## %bb.8:
	movq	_vulkan_gpu_list@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_string_list_free
LBB0_10:
	xorl	%eax, %eax
	callq	_string_list_new
	movq	%rax, (%rbx)
	cmpl	$0, -44(%rbp)
	je	LBB0_14
## %bb.11:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %r12
	leaq	L_.str.2(%rip), %r13
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%r15,8), %rdi
	movq	%r12, %rsi
	callq	_vkGetPhysicalDeviceProperties
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	(%rbx), %rdi
	movl	-48(%rbp), %esi
	xorl	%edx, %edx
	callq	_string_list_append
	incq	%r15
	movl	-44(%rbp), %eax
	cmpq	%rax, %r15
	jb	LBB0_12
## %bb.13:
	movq	(%rbx), %rax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_14:
	movq	_GFX_CTX_VULKAN_API@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	%rax, %rsi
	callq	_video_driver_set_gpu_api_devices
	movslq	(%r13), %rsi
	testq	%rsi, %rsi
	js	LBB0_17
## %bb.15:
	cmpl	-44(%rbp), %esi
	jge	LBB0_17
## %bb.16:
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movslq	(%r13), %rax
	leaq	(%r14,%rax,8), %rax
	jmp	LBB0_18
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	jmp	LBB0_19
LBB0_4:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_5
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
LBB0_5:
	callq	_RARCH_ERR
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_19
LBB0_17:
	leaq	L_.str.4(%rip), %rdi
	callq	_RARCH_WARN
	movq	%r14, %rax
LBB0_18:
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	%r14, %rdi
	callq	_free
	movl	$1, %r12d
LBB0_19:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VK_SUCCESS,8,3                 ## @VK_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Vulkan]: Failed to enumerate physical devices.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[Vulkan]: Failed to enumerate Vulkan physical device.\n"

	.comm	_vulkan_gpu_list,8,3            ## @vulkan_gpu_list
L_.str.2:                               ## @.str.2
	.asciz	"[Vulkan]: Found GPU at index %d: %s\n"

	.comm	_GFX_CTX_VULKAN_API,4,2         ## @GFX_CTX_VULKAN_API
L_.str.3:                               ## @.str.3
	.asciz	"[Vulkan]: Using GPU index %d.\n"

L_.str.4:                               ## @.str.4
	.asciz	"[Vulkan]: Invalid GPU index %d, using first device found.\n"

	.no_dead_strip	_vulkan_context_init_gpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vulkan_context_init_gpu
_vulkan_context_init_gpu:               ; @vulkan_context_init_gpu
	.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
	mov	x19, x0
	str	wzr, [sp, #12]
	bl	_config_get_ptr
	mov	x21, x0
	ldr	w0, [x19, #8]
	add	x1, sp, #12
	mov	x2, #0
	bl	_vkEnumeratePhysicalDevices
Lloh0:
	adrp	x22, _VK_SUCCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VK_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.1:
	ldr	w0, [sp, #12]
	mov	w1, #8
	bl	_calloc
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
	ldr	w0, [x19, #8]
	add	x1, sp, #12
	mov	x2, x20
	bl	_vkEnumeratePhysicalDevices
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.3:
	ldr	w8, [sp, #12]
	cmp	w8, #0
	b.le	LBB0_12
; %bb.4:
Lloh2:
	adrp	x24, _vulkan_gpu_list@GOTPAGE
Lloh3:
	ldr	x24, [x24, _vulkan_gpu_list@GOTPAGEOFF]
	ldr	x0, [x24]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_string_list_free
LBB0_6:
	bl	_string_list_new
	str	x0, [x24]
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_14
; %bb.7:
	mov	x22, #0
Lloh4:
	adrp	x23, l_.str.2@PAGE
Lloh5:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20, x22, lsl #3]
	add	x1, sp, #8
	bl	_vkGetPhysicalDeviceProperties
	ldr	w8, [sp, #8]
	str	x8, [sp]
	mov	x0, x23
	mov	x1, x22
	bl	_RARCH_LOG
	ldr	x0, [x24]
	ldr	w1, [sp, #8]
	mov	x2, #0
	bl	_string_list_append
	add	x22, x22, #1
	ldr	w8, [sp, #12]
	cmp	x22, x8
	b.lo	LBB0_8
; %bb.9:
	ldr	x1, [x24]
	b	LBB0_15
LBB0_10:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #0
	b	LBB0_20
LBB0_11:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_13:
	bl	_RARCH_ERR
	mov	x0, x20
	bl	_free
	mov	w0, #0
	b	LBB0_20
LBB0_14:
	mov	x1, x0
LBB0_15:
Lloh12:
	adrp	x8, _GFX_CTX_VULKAN_API@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFX_CTX_VULKAN_API@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_video_driver_set_gpu_api_devices
	ldr	w8, [x21]
	sxtw	x1, w8
	tbnz	w8, #31, LBB0_18
; %bb.16:
	ldr	w9, [sp, #12]
	cmp	w8, w9
	b.ge	LBB0_18
; %bb.17:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_RARCH_LOG
	ldrsw	x8, [x21]
	add	x8, x20, x8, lsl #3
	b	LBB0_19
LBB0_18:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_RARCH_WARN
	mov	x8, x20
LBB0_19:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x20
	bl	_free
	mov	w0, #1
LBB0_20:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_VK_SUCCESS,8,3                 ; @VK_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Vulkan]: Failed to enumerate physical devices.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[Vulkan]: Failed to enumerate Vulkan physical device.\n"

	.comm	_vulkan_gpu_list,8,3            ; @vulkan_gpu_list
l_.str.2:                               ; @.str.2
	.asciz	"[Vulkan]: Found GPU at index %d: %s\n"

	.comm	_GFX_CTX_VULKAN_API,4,2         ; @GFX_CTX_VULKAN_API
l_.str.3:                               ; @.str.3
	.asciz	"[Vulkan]: Using GPU index %d.\n"

l_.str.4:                               ; @.str.4
	.asciz	"[Vulkan]: Invalid GPU index %d, using first device found.\n"

	.no_dead_strip	_vulkan_context_init_gpu
.subsections_via_symbols
