// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/cpio.c
// Function: read_header_binary
static int read_header_binary(deark *c, lctx *d, struct member_data *md)
{
	i64 pos;
	i64 n;
	i64 modtime_msw, modtime_lsw;
	i64 modtime_unix;
	i64 filesize_msw, filesize_lsw;
	int retval = 0;
	char timestamp_buf[64];

	pos = md->startpos;

	pos += 2; // c_magic
	pos += 2; // c_dev

	n = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_ino: %d", (int)n);
	pos += 2;

	md->mode = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_mode: octal(%06o)", (unsigned int)md->mode);
	pos += 2;

	pos += 2; // c_uid
	pos += 2; // c_gid
	pos += 2; // c_nlink
	pos += 2; // c_rdev

	modtime_msw = dbuf_getu16x(c->infile, pos, md->is_le);
	modtime_lsw = dbuf_getu16x(c->infile, pos+2, md->is_le);
	modtime_unix = (modtime_msw<<16) | modtime_lsw;
	de_unix_time_to_timestamp(modtime_unix, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], 0x1);
	de_timestamp_to_string(&md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], timestamp_buf, sizeof(timestamp_buf), 0);
	de_dbg(c, "c_mtime: %d (%s)", (int)modtime_unix, timestamp_buf);
	pos += 4;

	md->namesize = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_namesize: %d", (int)md->namesize);
	pos += 2;

	filesize_msw = dbuf_getu16x(c->infile, pos, md->is_le);
	filesize_lsw = dbuf_getu16x(c->infile, pos+2, md->is_le);
	md->filesize = (filesize_msw<<16) | filesize_lsw;
	de_dbg(c, "c_filesize: %d", (int)md->filesize);
	pos += 4;

	md->fixed_header_size = pos - md->startpos;
	md->namesize_padded = de_pad_to_2(md->namesize);
	md->filesize_padded = de_pad_to_2(md->filesize);

	retval = 1;
	return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r13
leaq 0x4(%r13), %rsi
movq 0x18(%rdi), %rdi
movl 0x4(%rbx), %edx
callq 0xeef43
leaq 0xda9cb(%rip), %rsi     # 0x11a480
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x6(%r13), %rsi
movq 0x18(%r14), %rdi
movl 0x4(%rbx), %edx
callq 0xeef43
movq %rax, 0x38(%rbx)
leaq 0xda9ae(%rip), %rsi     # 0x11a48a
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x10(%r13), %rsi
movq 0x18(%r14), %rdi
movl 0x4(%rbx), %edx
callq 0xeef43
movq %rax, %r15
movq 0x18(%r14), %rdi
leaq 0x12(%r13), %rsi
movl 0x4(%rbx), %edx
callq 0xeef43
shlq $0x10, %r15
orq %rax, %r15
movq 0x50(%rbx), %rsi
addq $0x18, %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0xea7f5
movq 0x50(%rbx), %rdi
addq $0x18, %rdi
movq %rsp, %r12
movl $0x40, %edx
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xeaf46
leaq 0xda956(%rip), %rsi     # 0x11a49e
movq %r14, %rdi
movl %r15d, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
leaq 0x14(%r13), %rsi
movq 0x18(%r14), %rdi
movl 0x4(%rbx), %edx
callq 0xeef43
movq %rax, 0x18(%rbx)
leaq 0xda93c(%rip), %rsi     # 0x11a4af
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x16(%r13), %rsi
movq 0x18(%r14), %rdi
movl 0x4(%rbx), %edx
callq 0xeef43
movq %rax, %r15
movq 0x18(%r14), %rdi
leaq 0x18(%r13), %rsi
movl 0x4(%rbx), %edx
callq 0xeef43
shlq $0x10, %r15
orq %rax, %r15
movq %r15, 0x28(%rbx)
leaq 0xda90a(%rip), %rsi     # 0x11a4be
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
subq 0x8(%rbx), %r13
addq $0x1a, %r13
movq %r13, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0xe9c7e
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
callq 0xe9c7e
movq %rax, 0x30(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)