// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/arc.c
// Function: do_run_arc_spark_internal
static void do_run_arc_spark_internal(deark *c, lctx *d)
{
	i64 members_endpos;
	i64 num_extra_bytes;
	i64 pos = 0;

	if(is_btspk(c, d)) {
		de_warn(c, "This looks like BTSPK format, which is not correctly supported.");
	}

	d->sig_byte = (d->fmt==FMT_ARCMAC) ? 0x1b : 0x1a;

	if(d->sig_byte==0x1a) {
		u8 buf[33];

		// Tolerate up to sizeof(buf)-1 bytes of initial junk
		de_read(buf, 0, sizeof(buf));
		if(!find_arc_marker(c, buf, sizeof(buf), &pos)) {
			de_err(c, "Not a(n) %s file", d->fmtname);
			goto done;
		}
	}

	de_declare_fmt(c, d->fmtname);
	d->curpath = de_strarray_create(c, MAX_NESTING_LEVEL+10);
	d->crco = de_crcobj_create(c, DE_CRCOBJ_CRC16_ARC);

	do_prescan_file(c, d, pos);
	if(d->prescan_found_eoa) {
		members_endpos = d->prescan_pos_after_eoa;
	}
	else {
		members_endpos = c->infile->len;
	}
	mark_end_of_known_data(d, members_endpos);

	if(d->fmt==FMT_ARC) {
		do_pk_comments(c, d);
		do_pak_trailer(c, d);
	}

	do_sequence_of_members(c, d, pos, members_endpos, 0);

	num_extra_bytes = c->infile->len - d->end_of_known_data;
	if(num_extra_bytes>0) {
		de_dbg(c, "extra bytes at end of archive: %"I64_FMT" (at %"I64_FMT")",
			num_extra_bytes, d->end_of_known_data);
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
andq $0x0, 0x28(%rsp)
movq %rdi, %rbx
movl (%rsi), %eax
orl $0x2, %eax
cmpl $0x3, %eax
jne 0x25f0b
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rsi
addq $-0x1f, %rsi
leaq 0xe17c3(%rip), %rdx     # 0x107697
pushq $0xc
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0x25ef1
leaq 0xe1733(%rip), %rsi     # 0x10761a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf05a
movl (%r14), %eax
cmpl $0x3, %eax
sete %cl
orb $0x1a, %cl
movb %cl, 0x24(%r14)
cmpl $0x3, %eax
jne 0x25f10
xorl %r15d, %r15d
jmp 0x25f47
movb $0x1a, 0x24(%r14)
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r15
pushq $0x21
popq %r12
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0xe3cb7
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2695c
testl %eax, %eax
je 0x260ee
movq 0x28(%rsp), %r15
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xe07f7
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xeb95d
movq %rax, 0x50(%r14)
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0xe0ae9
movq %rax, 0x48(%r14)
leaq 0xe172c(%rip), %rsi     # 0x1076a4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
andq $0x0, 0x38(%r14)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
subq %r15, %rcx
leaq 0xa53(%rip), %r9        # 0x269f7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x266d1
movq 0x38(%r14), %rdx
leaq 0xe16ec(%rip), %rsi     # 0x1076ac
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movb 0x25(%r14), %al
testb %al, %al
je 0x25fe3
leaq 0x30(%r14), %rcx
jmp 0x25feb
movq 0x18(%rbx), %rcx
addq $0x18, %rcx
movq (%rcx), %r13
cmpq %r13, 0x40(%r14)
jge 0x25ff8
movq %r13, 0x40(%r14)
cmpl $0x1, (%r14)
jne 0x265fd
testb %al, %al
je 0x2629e
movq 0x18(%rbx), %rax
movq 0x18(%rax), %r12
addq $-0x8, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x26a4f
testl %eax, %eax
je 0x26108
movq %r13, 0x20(%rsp)
leaq 0xe16a9(%rip), %rsi     # 0x1076e1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
leaq 0x8(%r12), %rax
cmpq %rax, 0x40(%r14)
jge 0x2605f
movq %rax, 0x40(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26abd
movq 0x18(%rbx), %rdi
leaq 0x4(%r12), %rsi
callq 0xe409f
movq %rax, %rbp
leaq 0xe168a(%rip), %rsi     # 0x10770c
xorl %r13d, %r13d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r15
pushq $0x4
popq %rcx
movq %r15, %rsi
movq %rbp, %rdx
callq 0xe3cb7
movd (%r15), %xmm0
movd %xmm0, %eax
cmpl $0x202020, %eax         # imm = 0x202020
je 0x26154
movl %eax, %ecx
xorb $0x1, %cl
movl %eax, %edx
shrl $0x18, %edx
xorb $0x20, %dl
orb %cl, %dl
jne 0x2615b
addq $0x20, %rbp
subq %rbp, %r12
xorl %r15d, %r15d
movq %rbp, %r13
cmpq $0x20, %r12
jge 0x261e1
jmp 0x26286
movq 0x8(%r14), %rdx
leaq 0xe1561(%rip), %rsi     # 0x10765a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x26635
movq 0x30(%r14), %r12
pushq $-0x1
popq %r15
addq $0x20, %r12
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
cmpq %rax, %r12
jge 0x2629e
movq 0x38(%r14), %rax
addq $0xa, %rax
incq %r15
cmpq %rax, %r15
jg 0x2629e
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x26a4f
testl %eax, %eax
je 0x26110
jmp 0x2602c
movb $0x1, 0x10(%rsp)
jmp 0x2618d
cmpb $0x1, %al
sete %al
psllq $0x18, %xmm0
pxor %xmm1, %xmm1
pcmpeqb %xmm0, %xmm1
pextrw $0x3, %xmm1, %ecx
testb %cl, %al
je 0x26272
leaq 0x20(%rbp), %r13
movq %r12, %rax
subq %r13, %rax
cmpq $0x20, %rax
setl 0x10(%rsp)
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r15
addq $-0x20, %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x26adf
movq %r15, %rbp
movq %r15, %rdi
callq 0xeb877
leaq 0xe1584(%rip), %rsi     # 0x107743
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpb $0x0, 0x10(%rsp)
je 0x261db
movq %rbp, %r15
jmp 0x26286
subq %r13, %r12
movq %rbp, %r15
movq %r15, 0x10(%rsp)
pushq $0x20
popq %rcx
movq %r12, %rax
cqto
idivq %rcx
movq %rax, %r12
leaq 0xe155e(%rip), %rsi     # 0x107759
xorl %r15d, %r15d
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
cmovleq %r15, %r12
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x2626b
cmpq 0x38(%r14), %rbp
jge 0x2626b
movq 0x58(%r14), %rax
movq (%rax,%r15,2), %rdi
testq %rdi, %rdi
jne 0x2623f
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq 0x58(%r14), %rax
movq %rdi, (%rax,%r15,2)
callq 0xeaf8a
testl %eax, %eax
jne 0x2625e
movq 0x58(%r14), %rax
movq (%rax,%r15,2), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x26adf
incq %rbp
addq $0x20, %r13
addq $0x8, %r15
jmp 0x26214
movq 0x10(%rsp), %r15
jmp 0x26286
leaq 0xe14a7(%rip), %rsi     # 0x107720
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
callq 0xeaf3c
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x20(%rsp), %r13
cmpb $0x0, 0x25(%r14)
je 0x265fd
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
movq 0x30(%r14), %rsi
subq %rsi, %rax
cmpq $0x2, %rax
jl 0x265fd
callq 0xe3eb4
cmpb $-0x2, %al
jne 0x265fd
movq 0x18(%rbx), %rdi
movq 0x30(%r14), %rsi
incq %rsi
callq 0xe3eb4
cmpb $0x4, %al
ja 0x265fd
movq %r13, 0x20(%rsp)
movq 0x30(%r14), %r12
leaq 0xe1487(%rip), %rsi     # 0x10777e
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movb $0x1, 0x27(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26abd
leaq 0xc(%rsp), %rbp
leaq 0x30(%rsp), %r15
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x2, %rax
cmpq %rax, %r12
jg 0x265ed
movq %r12, 0x30(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xdebae
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f2a
movb $0x1, %r13b
cmpb $-0x2, %al
jne 0x26433
movq %rbx, %rdi
leaq 0xe10c8(%rip), %rsi     # 0x107437
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f2a
movzbl %al, %ebp
leaq 0xf8b47(%rip), %rcx     # 0x11eee1
cmpb $0x3, %bpl
ja 0x263b0
movl %ebp, %eax
leaq 0xe18ef(%rip), %rdx     # 0x107c98
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
movq %rbx, %rdi
leaq 0xe13e7(%rip), %rsi     # 0x1077a1
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
testl %ebp, %ebp
je 0x26438
movq %r12, 0x10(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3fc4
movq %rax, %r12
movq %rbx, %rdi
leaq 0xe13cd(%rip), %rsi     # 0x1077b2
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe40bf
movq %rax, %r15
movq %rbx, %rdi
leaq 0x112074(%rip), %rsi    # 0x13847c
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x30(%rsp), %rax
addq %r15, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x26478
xorl %r15d, %r15d
leaq 0xc(%rsp), %rbp
movq 0x10(%rsp), %r12
jmp 0x26441
xorl %r15d, %r15d
jmp 0x26441
pushq $0x2
popq %r15
leaq 0xc(%rsp), %rbp
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq %r15, %r12
cmpq %r12, 0x40(%r14)
jge 0x2645a
movq %r12, 0x40(%r14)
cmpq $0x8, %r15
setl %al
orb %al, %r13b
cmpb $0x1, %r13b
leaq 0x30(%rsp), %r15
jne 0x26329
jmp 0x265ed
testq %r12, %r12
jle 0x26483
cmpq 0x38(%r14), %r12
jle 0x26487
xorl %eax, %eax
jmp 0x26499
movq 0x58(%r14), %rax
movq %r12, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $-0x10, %rax
movq %r15, 0x18(%rsp)
addq $0x8, %r15
cmpl $0x1, %ebp
jne 0x26507
testq %r12, %r12
je 0x26552
testq %rax, %rax
movq 0x10(%rsp), %r12
je 0x265b7
movq %rax, %r13
movq (%rax), %rdi
testq %rdi, %rdi
leaq 0xc(%rsp), %rbp
jne 0x264dd
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq %rax, (%r13)
callq 0xeaf8a
testl %eax, %eax
jne 0x2654a
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq (%r13), %r8
movl 0x14(%r14), %eax
movl %eax, (%rsp)
xorl %r13d, %r13d
movl $0x800, %ecx            # imm = 0x800
jmp 0x265db
xorl %r13d, %r13d
cmpl $0x2, %ebp
jne 0x26427
testq %rax, %rax
leaq 0xc(%rsp), %rbp
movq 0x10(%rsp), %r12
je 0x26441
movq %rax, %r13
movq 0x8(%rax), %rdi
testq %rdi, %rdi
jne 0x26541
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq %rax, 0x8(%r13)
callq 0xeaf8a
testl %eax, %eax
je 0x265bf
xorl %r13d, %r13d
jmp 0x26441
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movl 0x14(%r14), %eax
movl %eax, (%rsp)
xorl %r13d, %r13d
movl $0x4000, %ecx           # imm = 0x4000
movq 0x18(%rsp), %rdx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %rbp, %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xe11ac(%rip), %rsi     # 0x107743
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
testq %rbp, %rbp
movq 0x10(%rsp), %r12
je 0x2643c
movq %rbp, %rdi
callq 0xeaf3c
xorl %r13d, %r13d
jmp 0x2643c
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq 0x8(%r13), %r8
movl 0x14(%r14), %eax
movl %eax, (%rsp)
xorl %r13d, %r13d
movl $0x200, %ecx            # imm = 0x200
movq 0x18(%rsp), %rdx
xorl %r9d, %r9d
callq 0xe4ced
jmp 0x26441
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x26977
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rdx
movq 0x40(%r14), %rcx
subq %rcx, %rdx
jle 0x26635
leaq 0xe1040(%rip), %rsi     # 0x10766b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq