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

	pos = md->startpos;

	pos += 6; // c_magic
	pos += 6; // c_dev

	ret = dbuf_read_ascii_number(c->infile, pos, 6, 8, &n);
	if(!ret) goto done;
	de_dbg(c, "c_ino: %d", (int)n);
	pos += 6;

	ret = dbuf_read_ascii_number(c->infile, pos, 6, 8, &md->mode);
	if(!ret) goto done;
	de_dbg(c, "c_mode: octal(%06o)", (unsigned int)md->mode);
	pos += 6;

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

	ret = dbuf_read_ascii_number(c->infile, pos, 11, 8, &modtime_unix);
	if(!ret) goto done;
	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 += 11;

	ret = dbuf_read_ascii_number(c->infile, pos, 6, 8, &md->namesize);
	if(!ret) goto done;
	de_dbg(c, "c_namesize: %d", (int)md->namesize);
	pos += 6;

	ret = dbuf_read_ascii_number(c->infile, pos, 11, 8, &md->filesize);
	if(!ret) goto done;
	de_dbg(c, "c_filesize: %d", (int)md->filesize);
	pos += 11;

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

	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl $0x6, %edx
movl $0x8, %ecx
leaq -0x30(%rbp), %r8
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x5641f
jmp 0x56641
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x14fcb0(%rip), %rsi    # 0x1a60e0
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x38, %r8
movl $0x6, %edx
movl $0x8, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x56474
jmp 0x56641
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %edx
leaq 0x14fc61(%rip), %rsi    # 0x1a60ea
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl $0xb, %edx
movl $0x8, %ecx
leaq -0x38(%rbp), %r8
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x564f9
jmp 0x56641
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0x15d530
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x18, %rdi
leaq -0x80(%rbp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq -0x80(%rbp), %rcx
leaq 0x14fbba(%rip), %rsi    # 0x1a60fe
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0xb, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x18, %r8
movl $0x6, %edx
movl $0x8, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x56588
jmp 0x56641
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
leaq 0x14fb72(%rip), %rsi    # 0x1a610f
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x28, %r8
movl $0xb, %edx
movl $0x8, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x565de
jmp 0x56641
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0x14fb2b(%rip), %rsi    # 0x1a611e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0xb, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)