// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl (%rsi), %eax
orl $0x2, %eax
cmpl $0x3, %eax
jne 0x268df
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rsi
addq $-0x1f, %rsi
leaq 0xedd87(%rip), %rdx     # 0x114647
movl $0xc, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x268df
leaq 0xedcf5(%rip), %rsi     # 0x1145ca
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
movl (%r14), %eax
cmpl $0x3, %eax
sete %cl
orb $0x1a, %cl
movb %cl, 0x24(%r14)
cmpl $0x3, %eax
jne 0x268f9
xorl %r15d, %r15d
jmp 0x2692e
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %rsi
movl $0x21, %ecx
xorl %edx, %edx
callq 0xeeee8
xorl %r15d, %r15d
movb 0x30(%rsp,%r15), %al
cmpb $0x1a, %al
je 0x26926
incq %r15
cmpq $0x21, %r15
jne 0x26911
xorl %r15d, %r15d
cmpb $0x1a, %al
jne 0x26a21
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xeb6d6
movl $0x22, %esi
movq %rbx, %rdi
callq 0xf7666
movq %rax, 0x50(%r14)
movq %rbx, %rdi
movl $0x21, %esi
callq 0xeba56
movq %rax, 0x48(%r14)
leaq 0xedcf1(%rip), %rsi     # 0x114654
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe93cf
movq $0x0, 0x38(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
subq %r15, %rcx
leaq 0xaca(%rip), %r9        # 0x2745e
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x27154
movq 0x38(%r14), %rdx
leaq 0xedcac(%rip), %rsi     # 0x11465c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe93cf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movb 0x25(%r14), %al
testb %al, %al
je 0x269d5
leaq 0x30(%r14), %rcx
jmp 0x269dd
movq 0x18(%rbx), %rcx
addq $0x18, %rcx
movq (%rcx), %r12
cmpq %r12, 0x40(%r14)
jge 0x269ea
movq %r12, 0x40(%r14)
cmpl $0x1, (%r14)
jne 0x27079
testb %al, %al
je 0x26cfc
movq 0x18(%rbx), %rax
movq 0x18(%rax), %r13
addq $-0x8, %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x274b6
testl %eax, %eax
je 0x26a3b
xorl %ebp, %ebp
jmp 0x26aa3
movq 0x8(%r14), %rdx
leaq 0xedbde(%rip), %rsi     # 0x11460a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x270af
movq 0x30(%r14), %r13
addq $0x20, %r13
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
movb $0x1, %bpl
cmpq %rax, %r13
jge 0x26aa3
movq %r12, 0x10(%rsp)
movq $-0x1, %r12
movq 0x38(%r14), %rax
addq $0xa, %rax
incq %r12
cmpq %rax, %r12
jg 0x26a9e
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x274b6
testl %eax, %eax
jne 0x26a9c
addq $0x20, %r13
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
cmpq %rax, %r13
jl 0x26a63
jmp 0x26a9e
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
testb %bpl, %bpl
jne 0x26cfc
leaq 0xedbde(%rip), %rsi     # 0x114691
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
leaq 0x8(%r13), %rax
cmpq %rax, 0x40(%r14)
jge 0x26adb
movq %rax, 0x40(%r14)
movb $0x1, 0x26(%r14)
cmpq $0x0, 0x58(%r14)
jne 0x26afc
movq 0x38(%r14), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xea259
movq %rax, 0x58(%r14)
movq 0x18(%rbx), %rdi
leaq 0x4(%r13), %rsi
callq 0xef37e
movq %rax, %rbp
leaq 0xedba9(%rip), %rsi     # 0x1146bc
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %rsi
movl $0x4, %ecx
movq %rbp, 0x18(%rsp)
movq %rbp, %rdx
callq 0xeeee8
xorl %edi, %edi
leaq 0x30(%rsp), %r8
movb (%r8), %al
movb 0x1(%r8), %cl
movl %eax, %edx
xorb $0x20, %dl
xorb $0x20, %cl
orb %dl, %cl
movb 0x2(%r8), %sil
xorb $0x20, %sil
orb %cl, %sil
movb 0x3(%r8), %dl
movb $0x1, %cl
orb %dl, %sil
je 0x26b9b
xorb $0x1, %al
movl %edx, %ecx
xorb $0x20, %cl
orb %al, %cl
jne 0x26b7b
movb $0x1, %dil
xorl %ecx, %ecx
jmp 0x26b9b
orb %dl, %al
jne 0x26b85
xorl %ecx, %ecx
xorl %edi, %edi
jmp 0x26b9b
leaq 0xedb44(%rip), %rsi     # 0x1146d0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movb $0x1, %cl
movb $0x1, %dil
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %rsi
leaq 0x20(%rsi), %rbp
movq %r13, %rax
subq %rbp, %rax
cmpq $0x20, %rax
setl %r8b
orb %cl, %r8b
xorl %edx, %edx
testb %cl, %cl
movl $0x0, %eax
movq %rax, 0x28(%rsp)
cmovneq %rdx, %rbp
testb %dil, %dil
jne 0x26c30
movq %rbx, %rdi
movb %r8b, 0x8(%rsp)
callq 0xf6870
movq %rax, %r12
movq 0x18(%rsp), %rsi
addq $-0x20, %rsi
movq 0x18(%rbx), %rdi
movl 0x14(%r14), %r9d
movl $0x20, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xf01b0
movq %r12, %rdi
callq 0xf6900
movq %r12, 0x28(%rsp)
movq %r12, %rdi
callq 0xf7557
leaq 0xedad5(%rip), %rsi     # 0x1146f3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movb 0x8(%rsp), %r8b
testb %r8b, %r8b
jne 0x26ce0
subq %rbp, %r13
leaq 0x1f(%r13), %rdx
testq %r13, %r13
cmovnsq %r13, %rdx
sarq $0x5, %rdx
leaq 0xedab7(%rip), %rsi     # 0x114709
movq %rbx, %rdi
movq %rdx, 0x18(%rsp)
xorl %eax, %eax
callq 0xe9226
cmpq $0x20, %r13
jl 0x26ce0
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq 0x38(%r14), %r13
jge 0x26ce0
movq 0x58(%r14), %rax
cmpq $0x0, (%rax,%r12)
jne 0x26c8e
movq %rbx, %rdi
callq 0xf6870
movq 0x58(%r14), %rcx
movq %rax, (%rcx,%r12)
movq 0x58(%r14), %rax
movq (%rax,%r12), %rdi
callq 0xf6c00
testl %eax, %eax
jne 0x26cce
movq 0x58(%r14), %rax
movq (%rax,%r12), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movl 0x14(%r14), %r9d
movl $0x20, %edx
movq %rbp, %rsi
xorl %r8d, %r8d
callq 0xf01b0
movq 0x8(%rsp), %rdi
callq 0xf6900
incq %r13
addq $0x20, %rbp
addq $0x10, %r12
cmpq %r13, 0x18(%rsp)
jne 0x26c6d
movq 0x28(%rsp), %rdi
callq 0xf6bb0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x10(%rsp), %r12
cmpb $0x0, 0x25(%r14)
je 0x27079
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
movq 0x30(%r14), %rsi
subq %rsi, %rax
cmpq $0x2, %rax
jl 0x27079
callq 0xef0d5
cmpb $-0x2, %al
jne 0x27079
movq 0x18(%rbx), %rdi
movq 0x30(%r14), %rsi
incq %rsi
callq 0xef0d5
cmpb $0x4, %al
ja 0x27079
movq 0x30(%r14), %rbp
leaq 0xed9de(%rip), %rsi     # 0x11472e
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movw $0x101, 0x26(%r14)      # imm = 0x101
cmpq $0x0, 0x58(%r14)
jne 0x26d8d
movq 0x38(%r14), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xea259
movq %rax, 0x58(%r14)
movq %r12, 0x10(%rsp)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
addq $-0x2, %rax
cmpq %rax, %rbp
jle 0x26dab
xorl %r13d, %r13d
jmp 0x26f1d
movq %rbp, 0x30(%rsp)
movq %rbx, %rdi
leaq 0x24(%rsp), %rsi
callq 0xe958c
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0xef14d
cmpb $-0x2, %al
movq %rbp, 0x18(%rsp)
jne 0x26ecf
movq %rbx, %rdi
leaq 0xed602(%rip), %rsi     # 0x1143e7
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef14d
movzbl %al, %r12d
leaq 0x105056(%rip), %rcx    # 0x12be69
cmpb $0x3, %r12b
ja 0x26e2a
movl %r12d, %eax
leaq 0xede25(%rip), %rdx     # 0x114c48
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xed91a(%rip), %rsi     # 0x114751
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
testl %r12d, %r12d
je 0x26ed6
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0xef1ed
movq %rbx, %rdi
leaq 0xed8fd(%rip), %rsi     # 0x114762
movq %rax, 0x8(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef3a0
movq %rax, %r13
movq %rbx, %rdi
leaq 0x11e560(%rip), %rsi    # 0x1453ec
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdx
movq 0x30(%rsp), %rax
addq %r13, %rax
movq 0x18(%rbx), %rcx
movl $0x0, %r13d
movl $0x0, %ebp
cmpq 0x18(%rcx), %rax
movl $0x0, %eax
jg 0x26edd
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
jle 0x26ecb
cmpq 0x38(%r14), %rsi
jle 0x26f2b
xorl %ebp, %ebp
jmp 0x26f3e
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x26edb
movl $0x2, %eax
xorl %ebp, %ebp
movq %rax, %r12
testq %rbp, %rbp
je 0x26eed
movq %rbp, %rdi
callq 0xf6bb0
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq 0x18(%rsp), %rbp
movq %r12, %rax
addq %r12, %rbp
cmpq %rbp, 0x40(%r14)
movq 0x10(%rsp), %r12
jge 0x26f13
movq %rbp, 0x40(%r14)
cmpq $0x8, %rax
setge %al
andb %al, %r13b
testb %r13b, %r13b
jne 0x26d92
jmp 0x2706c
movq 0x58(%r14), %rax
movq %rsi, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rbp
addq $-0x10, %rbp
movq %rdx, %rax
addq $0x8, %rax
cmpl $0x1, %r12d
jne 0x26fa3
testq %rsi, %rsi
je 0x27011
movb $0x1, %r13b
testq %rbp, %rbp
je 0x26edb
movq %rdx, 0x8(%rsp)
movq %rax, %r12
cmpq $0x0, (%rbp)
jne 0x26f7b
movq %rbx, %rdi
callq 0xf6870
movq %rax, (%rbp)
movq (%rbp), %rdi
callq 0xf6c00
testl %eax, %eax
jne 0x27007
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq (%rbp), %r8
movl 0x14(%r14), %eax
movl %eax, (%rsp)
movl $0x800, %ecx            # imm = 0x800
jmp 0x26ffa
movb $0x1, %r13b
cmpl $0x2, %r12d
jne 0x26edb
testq %rbp, %rbp
je 0x26edb
movq %rdx, 0x8(%rsp)
movq %rax, %r12
cmpq $0x0, 0x8(%rbp)
jne 0x26fd4
movq %rbx, %rdi
callq 0xf6870
movq %rax, 0x8(%rbp)
movq 0x8(%rbp), %rdi
callq 0xf6c00
testl %eax, %eax
jne 0x27007
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq 0x8(%rbp), %r8
movl 0x14(%r14), %eax
movl %eax, (%rsp)
movl $0x200, %ecx            # imm = 0x200
movq 0x8(%rsp), %rdx
xorl %r9d, %r9d
callq 0xf0203
xorl %ebp, %ebp
movq %r12, %rax
jmp 0x26edd
movq %rbx, %rdi
movq %rax, %r12
movq %rdx, %r13
callq 0xf6870
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movl 0x14(%r14), %eax
movl %eax, (%rsp)
movl $0x4000, %ecx           # imm = 0x4000
movq %r13, %rdx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %rbp, %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xed69c(%rip), %rsi     # 0x1146f3
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rax
movb $0x1, %r13b
jmp 0x26edd
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x273da
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rdx
movq 0x40(%r14), %rcx
subq %rcx, %rdx
jle 0x270af
leaq 0xed576(%rip), %rsi     # 0x11461b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq