// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x303d0
cmpl $0x0, %eax
je 0x2fd5c
movq -0x8(%rbp), %rdi
leaq 0x17071c(%rip), %rsi    # 0x1a0471
movb $0x0, %al
callq 0x15bc10
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0x1a, %eax
movl $0x1b, %ecx
cmpl $0x3, %edx
cmovel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x24(%rax)
movq -0x10(%rbp), %rax
movzbl 0x24(%rax), %eax
cmpl $0x1a, %eax
jne 0x2fdde
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x21, %ecx
callq 0x164d10
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x21, %edx
leaq -0x28(%rbp), %rcx
callq 0x30450
cmpl $0x0, %eax
jne 0x2fddc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x1706e1(%rip), %rsi    # 0x1a04b1
movb $0x0, %al
callq 0x15bfb0
jmp 0x2fee1
jmp 0x2fdde
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x15e380
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x1727a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rdi
movl $0x21, %esi
callq 0x15eac0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x304c0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x25(%rax)
je 0x2fe4a
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2fe5a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x30560
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x2fe8a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x30590
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x30960
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
xorl %r8d, %r8d
callq 0x30ab0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x40(%rcx), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0x2fedf
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
leaq 0x1705ea(%rip), %rsi    # 0x1a04c2
movb $0x0, %al
callq 0x15b0d0
jmp 0x2fee1
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)