// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/stuffit.c
// Function: do_v5_archivehdr
static int do_v5_archivehdr(deark *c, lctx *d, i64 pos1)
{
	i64 n;
	i64 pos = pos1;
	int retval = 0;

	de_dbg(c, "archive header at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);
	pos += 80; // text
	pos += 2; // ?
	n = de_getbyte_p(&pos);
	de_dbg(c, "archive version: %u", (UI)n);
	d->v5_archive_flags = de_getbyte_p(&pos);
	de_dbg(c, "archive flags: 0x%02x", (UI)d->v5_archive_flags);

	d->archive_size = de_getu32be_p(&pos);
	de_dbg(c, "reported archive file size: %"I64_FMT, d->archive_size);

	pos += 4; // ?

	d->nmembers = (int)de_getu16be_p(&pos);
	de_dbg(c, "number of root members: %d", d->nmembers);

	d->v5_first_entry_pos = de_getu32be_p(&pos);
	de_dbg(c, "pos of first root member: %"I64_FMT, d->v5_first_entry_pos);

	n = de_getu16be_p(&pos);
	de_dbg(c, "archive crc (reported): 0x%04x", (UI)n);

	//if(d->v5_archive_flags & 0x10) pos += 14; // reserved
	// TODO: Archive comment
	retval = 1;

	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x6d580(%rip), %rsi     # 0x1aea62
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x8cb22(%rip), %rsi     # 0x1ce05a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x40(%rax), %edx
leaq 0x8cb02(%rip), %rsi     # 0x1ce06e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1654b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x8c771(%rip), %rsi     # 0x1cdd13
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165210
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x8caa3(%rip), %rsi     # 0x1ce084
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1654b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x8ca88(%rip), %rsi     # 0x1ce09f
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165210
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x8ca79(%rip), %rsi     # 0x1ce0bd
movb $0x0, %al
callq 0x15b0d0
movl $0x1, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x2c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)