	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function installCia
_installCia:                            ## @installCia
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	%rsp, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_FILE_CHUNK_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_MEDIATYPE_SD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-52(%rbp), %rsi
	callq	_AM_StartCiaInstall
	movl	%eax, %edi
	callq	_R_FAILED
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_13
## %bb.1:
	leaq	-80(%rbp), %rsi
	movl	%r14d, %edi
	callq	_FSFILE_GetSize
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	jne	LBB0_13
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r8
	testq	%r8, %r8
	jle	LBB0_11
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	subq	%rbx, %r8
	movslq	(%r13), %rax
	cmpq	%rax, %r8
	cmovgeq	%rax, %r8
	movl	%r14d, %edi
	leaq	-72(%rbp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rcx
	callq	_FSFILE_Read
	movl	%eax, %edi
	callq	_R_FAILED
	movl	-52(%rbp), %edi
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%r14d, %r15d
	movq	%r13, %r14
	movq	-72(%rbp), %r8
	leaq	-88(%rbp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rcx
	xorl	%r9d, %r9d
	callq	_FSFILE_Write
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_R_FAILED
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-88(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%rax, %rbx
	movq	-80(%rbp), %r8
	cmpq	%rbx, %r8
	movq	%r14, %r13
	movl	%r15d, %r14d
	jg	LBB0_5
LBB0_11:
	movl	-52(%rbp), %edi
	callq	_AM_FinishCiaInstall
	movl	%eax, %edi
	callq	_R_FAILED
	xorl	%ebx, %ebx
	negq	%rax
	sbbl	%ebx, %ebx
	orl	$1, %ebx
	jmp	LBB0_12
LBB0_8:
	movl	-52(%rbp), %edi
	callq	_AM_CancelCIAInstall
	movl	%r13d, %edi
	callq	_R_DESCRIPTION
	movq	_RD_ALREADY_EXISTS@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	leal	(%rdx,%rdx), %ebx
	decl	%ebx
LBB0_12:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_10:
	movl	-52(%rbp), %edi
LBB0_6:
	callq	_AM_CancelCIAInstall
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	$-1, %ebx
LBB0_13:
	movq	%r15, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FILE_CHUNK_SIZE,4,2            ## @FILE_CHUNK_SIZE
	.comm	_MEDIATYPE_SD,4,2               ## @MEDIATYPE_SD
	.comm	_RD_ALREADY_EXISTS,8,3          ## @RD_ALREADY_EXISTS
	.no_dead_strip	_installCia
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function installCia
_installCia:                            ; @installCia
	.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, #48
	mov	x19, x0
	mov	x23, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x24, _FILE_CHUNK_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _FILE_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh7:
	adrp	x8, _MEDIATYPE_SD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MEDIATYPE_SD@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	sub	x1, x29, #60
	bl	_AM_StartCiaInstall
	bl	_R_FAILED
	cbnz	x0, LBB0_2
; %bb.1:
	sub	x1, x29, #72
	mov	x0, x19
	bl	_FSFILE_GetSize
	bl	_R_FAILED
	cbz	x0, LBB0_5
LBB0_2:
	mov	w0, #-1
LBB0_3:
	mov	sp, x23
	ldur	x8, [x29, #-56]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.4:
	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_5:
	ldur	x8, [x29, #-72]
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.6:
	mov	x21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x9, [x24]
	sub	x8, x8, x21
	cmp	x8, x9
	csel	x4, x8, x9, lt
	sub	x1, x29, #80
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	bl	_FSFILE_Read
	bl	_R_FAILED
	mov	x8, x0
	ldur	w0, [x29, #-60]
	cbnz	x8, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldur	x4, [x29, #-80]
	sub	x1, x29, #88
	mov	x2, x21
	mov	x3, x20
	mov	w5, #0
	bl	_FSFILE_Write
	mov	x22, x0
	bl	_R_FAILED
	cbnz	x0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldp	x9, x8, [x29, #-88]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldur	x8, [x29, #-72]
	add	x21, x9, x21
	cmp	x8, x21
	b.gt	LBB0_7
LBB0_11:
	ldur	w0, [x29, #-60]
	bl	_AM_FinishCiaInstall
	bl	_R_FAILED
	cmp	x0, #0
	b	LBB0_13
LBB0_12:
	ldur	w0, [x29, #-60]
	bl	_AM_CancelCIAInstall
	mov	x0, x22
	bl	_R_DESCRIPTION
Lloh13:
	adrp	x8, _RD_ALREADY_EXISTS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RD_ALREADY_EXISTS@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
LBB0_13:
	mov	w8, #1
	cneg	w0, w8, ne
	b	LBB0_3
LBB0_14:
	ldur	w0, [x29, #-60]
LBB0_15:
	bl	_AM_CancelCIAInstall
	b	LBB0_2
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FILE_CHUNK_SIZE,4,2            ; @FILE_CHUNK_SIZE
	.comm	_MEDIATYPE_SD,4,2               ; @MEDIATYPE_SD
	.comm	_RD_ALREADY_EXISTS,8,3          ; @RD_ALREADY_EXISTS
	.no_dead_strip	_installCia
.subsections_via_symbols
