// File: /workspace/github_c_makefile_star2_O3/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, %rbp
movq %rdi, %rbx
movl (%rsi), %eax
orl $0x2, %eax
cmpl $0x3, %eax
jne 0x2693b
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rsi
addq $-0x1f, %rsi
leaq 0xedec7(%rip), %rdx     # 0x114722
movl $0xc, %ecx
callq 0xefc85
testl %eax, %eax
jne 0x2687a
leaq 0xede35(%rip), %rsi     # 0x1146a5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
movl (%rbp), %eax
cmpl $0x3, %eax
sete %cl
orb $0x1a, %cl
movb %cl, 0x24(%rbp)
cmpl $0x3, %eax
jne 0x2693f
xorl %r15d, %r15d
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
callq 0xeb125
movl $0x22, %esi
movq %rbx, %rdi
callq 0xf7205
movq %rax, 0x50(%rbp)
movq %rbx, %rdi
movl $0x21, %esi
callq 0xeb499
movq %rax, 0x48(%rbp)
leaq 0xede65(%rip), %rsi     # 0x11472f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe87e4
movq $0x0, 0x38(%rbp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
subq %r15, %rcx
leaq 0xb76(%rip), %r9        # 0x27471
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x2714c
movq 0x38(%rbp), %rdx
leaq 0xede20(%rip), %rsi     # 0x114737
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe87e4
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movb 0x25(%rbp), %al
testb %al, %al
je 0x26986
leaq 0x30(%rbp), %rcx
jmp 0x2698e
movb $0x1a, 0x24(%rbp)
movq 0x18(%rbx), %rdi
xorl %r15d, %r15d
leaq 0x30(%rsp), %rsi
movl $0x21, %ecx
xorl %edx, %edx
callq 0xee8d4
cmpb $0x1a, 0x30(%rsp,%r15)
je 0x26895
incq %r15
cmpq $0x21, %r15
jne 0x26957
movq 0x8(%rbp), %rdx
leaq 0xedd6e(%rip), %rsi     # 0x1146e5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x270a5
movq 0x18(%rbx), %rcx
addq $0x18, %rcx
movq (%rcx), %r14
cmpq %r14, 0x40(%rbp)
jge 0x2699b
movq %r14, 0x40(%rbp)
cmpl $0x1, (%rbp)
jne 0x2706f
movq %r14, 0x28(%rsp)
testb %al, %al
movq %rbp, 0x10(%rsp)
je 0x26cc5
movq 0x18(%rbx), %rax
movq 0x18(%rax), %r13
addq $-0x8, %r13
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x274c9
testl %eax, %eax
je 0x26aaa
leaq 0xedd8c(%rip), %rsi     # 0x11476c
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x8(%r13), %rax
cmpq %rax, 0x40(%rbp)
jge 0x26a08
movq %rax, 0x40(%rbp)
movb $0x1, 0x26(%rbp)
cmpq $0x0, 0x58(%rbp)
jne 0x26a28
movq 0x38(%rbp), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xe96f7
movq %rax, 0x58(%rbp)
movq 0x18(%rbx), %rdi
leaq 0x4(%r13), %rsi
callq 0xeed61
movq %rax, %r14
leaq 0xedd58(%rip), %rsi     # 0x114797
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r12
movl $0x4, %ecx
movq %r12, %rsi
movq %r14, %rdx
callq 0xee8d4
movd (%r12), %xmm0
movd %xmm0, %eax
cmpl $0x202020, %eax         # imm = 0x202020
je 0x26b12
movl %eax, %ecx
xorb $0x1, %cl
movl %eax, %edx
shrl $0x18, %edx
xorb $0x20, %dl
orb %cl, %dl
jne 0x26b1c
addq $0x20, %r14
subq %r14, %r13
cmpq $0x20, %r13
jge 0x26be4
xorl %r12d, %r12d
jmp 0x26cab
movq 0x30(%rbp), %r13
addq $0x20, %r13
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
cmpq %rax, %r13
jge 0x26cc5
movq $-0x1, %r14
movq 0x38(%rbp), %rax
addq $0xa, %rax
incq %r14
cmpq %rax, %r14
jg 0x26cc5
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x274c9
testl %eax, %eax
jne 0x269d9
addq $0x20, %r13
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
cmpq %rax, %r13
jl 0x26ace
jmp 0x26cc5
movq %r14, 0x8(%rsp)
movb $0x1, %r14b
jmp 0x26b52
cmpb $0x1, %al
sete %al
psllq $0x18, %xmm0
pxor %xmm1, %xmm1
pcmpeqb %xmm0, %xmm1
pextrw $0x3, %xmm1, %ecx
testb %cl, %al
je 0x26c97
movq %r14, 0x8(%rsp)
leaq 0x20(%r14), %rbp
movq %r13, %rax
subq %rbp, %rax
cmpq $0x20, %rax
setl %r14b
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r12
movq 0x8(%rsp), %rsi
addq $-0x20, %rsi
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rax
movl 0x14(%rax), %r9d
movl $0x20, %edx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0xefbd7
movq %r12, %rdi
callq 0xf64a0
movq %r12, %rdi
callq 0xf70f6
leaq 0xedc34(%rip), %rsi     # 0x1147ce
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
testb %r14b, %r14b
jne 0x26cab
subq %rbp, %r13
leaq 0x1f(%r13), %r14
testq %r13, %r13
cmovnsq %r13, %r14
sarq $0x5, %r14
leaq 0xedc1b(%rip), %rsi     # 0x1147e4
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x20, %r13
movq %r14, %r13
jge 0x26c02
jmp 0x26cab
shrq $0x5, %r13
leaq 0xedbf5(%rip), %rsi     # 0x1147e4
xorl %r12d, %r12d
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rbp
movq %r12, 0x18(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r13, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x38(%rax), %r14
jge 0x26c90
movq 0x58(%rax), %rax
movq (%rax,%r12), %rdi
testq %rdi, %rdi
jne 0x26c42
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rdi
movq 0x10(%rsp), %rax
movq 0x58(%rax), %rax
movq %rdi, (%rax,%r12)
callq 0xf67a3
testl %eax, %eax
jne 0x26c80
movq 0x10(%rsp), %rcx
movq 0x58(%rcx), %rax
movq (%rax,%r12), %r13
movq 0x18(%rbx), %rdi
movl 0x14(%rcx), %r9d
movl $0x20, %edx
movq %rbp, %rsi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xefbd7
movq %r13, %rdi
movq 0x8(%rsp), %r13
callq 0xf64a0
incq %r14
addq $0x20, %rbp
addq $0x10, %r12
cmpq %r14, %r13
jne 0x26c12
movq 0x18(%rsp), %r12
jmp 0x26cab
leaq 0xedb0d(%rip), %rsi     # 0x1147ab
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xf6753
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%rsp), %rbp
cmpb $0x0, 0x25(%rbp)
movq 0x28(%rsp), %r14
je 0x2706f
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
movq 0x30(%rbp), %rsi
subq %rsi, %rax
cmpq $0x2, %rax
jl 0x2706f
callq 0xeead3
cmpb $-0x2, %al
jne 0x2706f
movq 0x18(%rbx), %rdi
movq 0x30(%rbp), %rsi
incq %rsi
callq 0xeead3
cmpb $0x4, %al
ja 0x2706f
movq 0x30(%rbp), %r12
leaq 0xedaec(%rip), %rsi     # 0x114809
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movw $0x101, 0x26(%rbp)      # imm = 0x101
cmpq $0x0, 0x58(%rbp)
jne 0x26d59
movq 0x38(%rbp), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xe96f7
movq %rax, 0x58(%rbp)
leaq 0x30(%rsp), %r13
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x2, %rax
cmpq %rax, %r12
jg 0x2705d
movq %r12, 0x30(%rsp)
movq %rbx, %rdi
leaq 0x24(%rsp), %rsi
callq 0xe8a1c
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeeb4b
movb $0x1, %r14b
cmpb $-0x2, %al
jne 0x26e11
movq %rbx, %rdi
leaq 0xed6f5(%rip), %rsi     # 0x114497
movq %r12, 0x8(%rsp)
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeeb4b
movzbl %al, %r12d
leaq 0x10537c(%rip), %rcx    # 0x12c151
cmpb $0x3, %r12b
ja 0x26e32
leaq 0xed812(%rip), %rcx     # 0x1145f4
movslq (%rcx,%r12,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0xeda37(%rip), %rsi     # 0x11482c
movl %r12d, %edx
leaq 0x12661f(%rip), %rcx    # 0x14d41e
xorl %eax, %eax
callq 0xe8617
movl $0x2, %r13d
jmp 0x26eaa
xorl %r13d, %r13d
jmp 0x26eaf
leaq 0x10c43f(%rip), %rcx    # 0x13325f
jmp 0x26e32
leaq 0xf1202(%rip), %rcx     # 0x11802b
jmp 0x26e32
leaq 0xed9f3(%rip), %rcx     # 0x114825
movq %rbx, %rdi
leaq 0xed9f0(%rip), %rsi     # 0x11482c
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0xeebeb
movq %rax, %rbp
movq %rbx, %rdi
leaq 0xed9d9(%rip), %rsi     # 0x11483d
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeed83
movq %rax, %r13
movq %rbx, %rdi
leaq 0x11ea46(%rip), %rsi    # 0x1458cc
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x30(%rsp), %rax
addq %r13, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x26ee6
xorl %r13d, %r13d
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r12
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq %r13, %r12
cmpq %r12, 0x40(%rbp)
jge 0x26ec8
movq %r12, 0x40(%rbp)
cmpq $0x8, %r13
setl %al
orb %al, %r14b
cmpb $0x1, %r14b
leaq 0x30(%rsp), %r13
jne 0x26d5e
jmp 0x2705d
testq %rbp, %rbp
jle 0x26ef6
movq 0x10(%rsp), %rax
cmpq 0x38(%rax), %rbp
jle 0x26efa
xorl %eax, %eax
jmp 0x26f0c
movq 0x58(%rax), %rax
movq %rbp, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $-0x10, %rax
movq %r13, 0x18(%rsp)
addq $0x8, %r13
cmpl $0x1, %r12d
jne 0x26f78
testq %rbp, %rbp
je 0x26fc4
testq %rax, %rax
movq 0x10(%rsp), %rbp
je 0x27028
movq %rax, %r14
movq (%rax), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r12
jne 0x26f50
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rdi
movq %rax, (%r14)
callq 0xf67a3
testl %eax, %eax
jne 0x26fbc
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq (%r14), %r8
movl 0x14(%rbp), %eax
movl %eax, (%rsp)
xorl %r14d, %r14d
movl $0x800, %ecx            # imm = 0x800
jmp 0x2704b
xorl %r14d, %r14d
cmpl $0x2, %r12d
jne 0x26ea5
testq %rax, %rax
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r12
je 0x26eaf
movq %rax, %r14
movq 0x8(%rax), %rdi
testq %rdi, %rdi
jne 0x26fb3
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rdi
movq %rax, 0x8(%r14)
callq 0xf67a3
testl %eax, %eax
je 0x27030
xorl %r14d, %r14d
jmp 0x26eaf
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq 0x10(%rsp), %rbp
movl 0x14(%rbp), %eax
movl %eax, (%rsp)
xorl %r14d, %r14d
movl $0x4000, %ecx           # imm = 0x4000
movq 0x18(%rsp), %rdx
movq %r12, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r12, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xed7c1(%rip), %rsi     # 0x1147ce
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
testq %r12, %r12
je 0x26eaa
movq %r12, %rdi
callq 0xf6753
xorl %r14d, %r14d
jmp 0x26eaa
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq 0x8(%r14), %r8
movl 0x14(%rbp), %eax
movl %eax, (%rsp)
xorl %r14d, %r14d
movl $0x200, %ecx            # imm = 0x200
movq 0x18(%rsp), %rdx
xorl %r9d, %r9d
callq 0xefc2a
jmp 0x26eaf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x273ed
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rdx
movq 0x40(%rbp), %rcx
subq %rcx, %rdx
jle 0x270a5
leaq 0xed65b(%rip), %rsi     # 0x1146f6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq