	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_video_layout_load              ## -- Begin function video_layout_load
	.p2align	4, 0x90
_video_layout_load:                     ## @video_layout_load
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$1, %ebx
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	movq	%rdi, %r14
	callq	_strlen
	testl	%eax, %eax
	je	LBB0_11
## %bb.2:
	movq	%r14, %rdi
	callq	_path_is_compressed_file
	movq	_video_layout_state@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	%rax, 8(%rcx)
	movq	%rsp, %r13
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_strlcpy
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_strlcat
	movq	(%r12), %rdi
	addq	$4, %rdi
	movq	%rbx, %rsi
	callq	_set_string
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_strlcat
	xorl	%r15d, %r15d
	leaq	-64(%rbp), %rsi
	leaq	-56(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_file_archive_compressed_read
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	-64(%rbp), %rdi
	movq	-56(%rbp), %rsi
	incq	%rsi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rax, %rbx
	movq	-56(%rbp), %rax
	movb	$0, (%rbx,%rax)
	movq	%rbx, %rdi
	callq	_rxml_load_document_string
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_free
	jmp	LBB0_8
LBB0_7:
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_fill_pathname_basedir
	movq	(%r12), %rdi
	addq	$4, %rdi
	movq	%r15, %rsi
	callq	_set_string
	movq	%r14, %rdi
	callq	_rxml_load_document
	movq	%rax, %r15
	jmp	LBB0_8
LBB0_6:
	movq	-64(%rbp), %rdi
	callq	_free
	xorl	%r15d, %r15d
LBB0_8:
	movq	%r13, %rsp
	testq	%r15, %r15
	je	LBB0_9
## %bb.10:
	movq	(%r12), %rdi
	movq	%r15, %rsi
	callq	_load
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_rxml_free_document
	xorl	%eax, %eax
	callq	_video_layout_view_index
	movl	%eax, %edi
	callq	_video_layout_view_select
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	callq	_RARCH_LOG
	xorl	%ebx, %ebx
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_video_layout_state,8,3         ## @video_layout_state
	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"#"

L_.str.1:                               ## @.str.1
	.asciz	"default.lay"

L_.str.2:                               ## @.str.2
	.asciz	"video_layout: unable to open file \"%s\"\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_video_layout_load              ; -- Begin function video_layout_load
	.p2align	2
_video_layout_load:                     ; @video_layout_load
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	bl	_strlen
	cbz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_path_is_compressed_file
Lloh3:
	adrp	x22, _video_layout_state@GOTPAGE
Lloh4:
	ldr	x22, [x22, _video_layout_state@GOTPAGEOFF]
	ldr	x8, [x22]
	str	x0, [x8, #8]
	cbz	x0, LBB0_7
; %bb.3:
	mov	x23, sp
Lloh5:
	adrp	x8, _PATH_MAX_LENGTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PATH_MAX_LENGTH@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	mov	x9, x20
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x20, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_strlcpy
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_strlcat
	ldr	x8, [x22]
	add	x0, x8, #4
	mov	x1, x21
	bl	_set_string
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_strlcat
	sub	x1, x29, #64
	sub	x3, x29, #72
	mov	x0, x21
	mov	x2, #0
	bl	_file_archive_compressed_read
	cbz	x0, LBB0_10
; %bb.4:
	ldp	x8, x0, [x29, #-72]
	add	x1, x8, #1
	bl	_realloc
	cbz	x0, LBB0_9
; %bb.5:
	mov	x21, x0
	ldur	x8, [x29, #-72]
	strb	wzr, [x0, x8]
	bl	_rxml_load_document_string
	mov	x20, x0
	mov	x0, x21
	bl	_free
	mov	sp, x23
	cbnz	x20, LBB0_11
	b	LBB0_8
LBB0_6:
	mov	w19, #1
	b	LBB0_12
LBB0_7:
	mov	x21, sp
Lloh14:
	adrp	x8, _PATH_MAX_LENGTH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PATH_MAX_LENGTH@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x9, x2
Lloh17:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh18:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
	mov	x0, x20
	mov	x1, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_fill_pathname_basedir
	ldr	x8, [x22]
	add	x0, x8, #4
	mov	x1, x20
	bl	_set_string
	mov	x0, x19
	bl	_rxml_load_document
	mov	x20, x0
	mov	sp, x21
	cbnz	x20, LBB0_11
LBB0_8:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_RARCH_LOG
	mov	w19, #0
	b	LBB0_12
LBB0_9:
	ldur	x0, [x29, #-64]
	bl	_free
LBB0_10:
	mov	x20, #0
	mov	sp, x23
	cbz	x20, LBB0_8
LBB0_11:
	ldr	x0, [x22]
	mov	x1, x20
	bl	_load
	mov	x19, x0
	mov	x0, x20
	bl	_rxml_free_document
	bl	_video_layout_view_index
	bl	_video_layout_view_select
LBB0_12:
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x19
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_video_layout_state,8,3         ; @video_layout_state
	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"#"

l_.str.1:                               ; @.str.1
	.asciz	"default.lay"

l_.str.2:                               ; @.str.2
	.asciz	"video_layout: unable to open file \"%s\"\n"

.subsections_via_symbols
