	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_exec_cia                       ## -- Begin function exec_cia
	.p2align	4, 0x90
_exec_cia:                              ## @exec_cia
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EINVAL@GOTPCREL(%rip), %rbx
	testq	%rdi, %rdi
	je	LBB0_25
## %bb.1:
	movq	%rdi, %r15
	cmpb	$0, (%rdi)
	je	LBB0_25
## %bb.2:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_ENOENT@GOTPCREL(%rip), %rbx
	jmp	LBB0_25
LBB0_4:
	movl	-48(%rbp), %edi
	callq	_S_ISDIR
	testq	%rax, %rax
	jne	LBB0_25
## %bb.5:
	xorl	%eax, %eax
	callq	_amInit
	movl	%eax, %edi
	callq	_R_SUCCEEDED
	testq	%rax, %rax
	je	LBB0_24
## %bb.6:
	xorl	%eax, %eax
	callq	_fsInit
	movl	%eax, %edi
	callq	_R_SUCCEEDED
	testq	%rax, %rax
	je	LBB0_24
## %bb.7:
	movq	_ARCHIVE_SDMC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_PATH_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fsMakePath
	leaq	-32(%rbp), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_FSUSER_OpenArchive
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_errorAndQuit
LBB0_9:
	movl	-32(%rbp), %r14d
	movq	_PATH_ASCII@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$5, %r15
	movq	%r15, %rsi
	callq	_fsMakePath
	movq	_FS_OPEN_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	-28(%rbp), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	_FSUSER_OpenFile
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	callq	_errorAndQuit
LBB0_11:
	movq	_MEDIATYPE_SD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-28(%rbp), %edx
	leaq	-40(%rbp), %rsi
	callq	_AM_GetCiaFileInfo
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	callq	_errorAndQuit
LBB0_13:
	movl	-40(%rbp), %edi
	movl	-36(%rbp), %esi
	callq	_isCiaInstalled
	cmpl	$-1, %eax
	je	LBB0_14
## %bb.15:
	testl	%eax, %eax
	jne	LBB0_19
## %bb.16:
	movl	-28(%rbp), %edi
	callq	_installCia
	cmpl	$-1, %eax
	jne	LBB0_19
## %bb.17:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_18
LBB0_24:
	xorl	%eax, %eax
	callq	_amExit
	xorl	%eax, %eax
	callq	_fsExit
	movq	_ENOTSUP@GOTPCREL(%rip), %rbx
LBB0_25:
	movl	(%rbx), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
LBB0_18:
	callq	_errorAndQuit
LBB0_19:
	movl	-28(%rbp), %edi
	callq	_FSFILE_Close
	movl	-32(%rbp), %edi
	callq	_FSUSER_CloseArchive
	movq	$0, -64(%rbp)
	movl	-40(%rbp), %esi
	xorl	%edi, %edi
	movl	$1, %edx
	callq	_APT_PrepareToDoApplicationJump
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	leaq	L_.str.6(%rip), %rdi
	callq	_errorAndQuit
LBB0_21:
	movq	_argvHmac@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rdi
	movl	$8, %esi
	callq	_APT_DoApplicationJump
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	leaq	L_.str.7(%rip), %rdi
	callq	_errorAndQuit
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ARCHIVE_SDMC,4,2               ## @ARCHIVE_SDMC
	.comm	_PATH_EMPTY,4,2                 ## @PATH_EMPTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

L_.str.1:                               ## @.str.1
	.asciz	"Cant open SD FS archive."

	.comm	_PATH_ASCII,4,2                 ## @PATH_ASCII
	.comm	_FS_OPEN_READ,4,2               ## @FS_OPEN_READ
L_.str.2:                               ## @.str.2
	.asciz	"Cant open CIA file."

	.comm	_MEDIATYPE_SD,4,2               ## @MEDIATYPE_SD
L_.str.3:                               ## @.str.3
	.asciz	"Cant get CIA file info."

L_.str.4:                               ## @.str.4
	.asciz	"Could not read title id list."

L_.str.5:                               ## @.str.5
	.asciz	"Cant install CIA."

L_.str.6:                               ## @.str.6
	.asciz	"CIA cant run, cant prepare."

	.comm	_argvHmac,4,2                   ## @argvHmac
L_.str.7:                               ## @.str.7
	.asciz	"CIA cant run, cant jump."

	.comm	_ENOTSUP,4,2                    ## @ENOTSUP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_exec_cia                       ; -- Begin function exec_cia
	.p2align	2
_exec_cia:                              ; @exec_cia
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_5
; %bb.2:
	sub	x1, x29, #24
	mov	x0, x19
	bl	_stat
	cbz	x0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldur	w0, [x29, #-24]
	bl	_S_ISDIR
	cbz	x0, LBB0_7
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _errno@GOTPAGE
Lloh5:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh6:
	str	w8, [x9]
	mov	w0, #-1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	bl	_amInit
	bl	_R_SUCCEEDED
	cbz	x0, LBB0_19
; %bb.8:
	bl	_fsInit
	bl	_R_SUCCEEDED
	cbz	x0, LBB0_19
; %bb.9:
Lloh7:
	adrp	x8, _ARCHIVE_SDMC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ARCHIVE_SDMC@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
Lloh10:
	adrp	x8, _PATH_EMPTY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PATH_EMPTY@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fsMakePath
	mov	x2, x0
	add	x0, sp, #28
	mov	x1, x20
	bl	_FSUSER_OpenArchive
	bl	_R_FAILED
	cbz	x0, LBB0_11
; %bb.10:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errorAndQuit
LBB0_11:
	ldr	w20, [sp, #28]
Lloh17:
	adrp	x8, _PATH_ASCII@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PATH_ASCII@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	add	x1, x19, #5
	bl	_fsMakePath
	mov	x2, x0
Lloh20:
	adrp	x8, _FS_OPEN_READ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FS_OPEN_READ@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	add	x0, sp, #24
	mov	x1, x20
	mov	w4, #0
	bl	_FSUSER_OpenFile
	bl	_R_FAILED
	cbz	x0, LBB0_13
; %bb.12:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errorAndQuit
LBB0_13:
Lloh25:
	adrp	x8, _MEDIATYPE_SD@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MEDIATYPE_SD@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	ldr	w2, [sp, #24]
	add	x1, sp, #32
	bl	_AM_GetCiaFileInfo
	bl	_R_FAILED
	cbz	x0, LBB0_15
; %bb.14:
Lloh28:
	adrp	x0, l_.str.3@PAGE
Lloh29:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_errorAndQuit
LBB0_15:
	ldp	w0, w1, [sp, #32]
	bl	_isCiaInstalled
	cmn	w0, #1
	b.eq	LBB0_20
; %bb.16:
	cbnz	w0, LBB0_22
; %bb.17:
	ldr	w0, [sp, #24]
	bl	_installCia
	cmn	w0, #1
	b.ne	LBB0_22
; %bb.18:
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_21
LBB0_19:
	bl	_amExit
	bl	_fsExit
Lloh32:
	adrp	x8, _ENOTSUP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ENOTSUP@GOTPAGEOFF]
	b	LBB0_6
LBB0_20:
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_21:
	bl	_errorAndQuit
LBB0_22:
	ldr	w0, [sp, #24]
	bl	_FSFILE_Close
	ldr	w0, [sp, #28]
	bl	_FSUSER_CloseArchive
	str	xzr, [sp, #8]
	ldr	w1, [sp, #32]
	mov	w0, #0
	mov	w2, #1
	bl	_APT_PrepareToDoApplicationJump
	bl	_R_FAILED
	cbz	x0, LBB0_24
; %bb.23:
Lloh36:
	adrp	x0, l_.str.6@PAGE
Lloh37:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_errorAndQuit
LBB0_24:
Lloh38:
	adrp	x8, _argvHmac@GOTPAGE
Lloh39:
	ldr	x8, [x8, _argvHmac@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	w1, #8
	bl	_APT_DoApplicationJump
	bl	_R_FAILED
	cbz	x0, LBB0_26
; %bb.25:
Lloh41:
	adrp	x0, l_.str.7@PAGE
Lloh42:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_errorAndQuit
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	b	LBB0_26
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ARCHIVE_SDMC,4,2               ; @ARCHIVE_SDMC
	.comm	_PATH_EMPTY,4,2                 ; @PATH_EMPTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

l_.str.1:                               ; @.str.1
	.asciz	"Cant open SD FS archive."

	.comm	_PATH_ASCII,4,2                 ; @PATH_ASCII
	.comm	_FS_OPEN_READ,4,2               ; @FS_OPEN_READ
l_.str.2:                               ; @.str.2
	.asciz	"Cant open CIA file."

	.comm	_MEDIATYPE_SD,4,2               ; @MEDIATYPE_SD
l_.str.3:                               ; @.str.3
	.asciz	"Cant get CIA file info."

l_.str.4:                               ; @.str.4
	.asciz	"Could not read title id list."

l_.str.5:                               ; @.str.5
	.asciz	"Cant install CIA."

l_.str.6:                               ; @.str.6
	.asciz	"CIA cant run, cant prepare."

	.comm	_argvHmac,4,2                   ; @argvHmac
l_.str.7:                               ; @.str.7
	.asciz	"CIA cant run, cant jump."

	.comm	_ENOTSUP,4,2                    ; @ENOTSUP
.subsections_via_symbols
