// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/cpio.c
// Function: de_run_cpio
static void de_run_cpio(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *subfmt_name;
	i64 bytes_consumed;
	i64 pos;
	int ret;

	d = de_malloc(c, sizeof(lctx));

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_UTF8);

	pos = 0;

	if(identify_cpio_internal(c, pos, &d->first_subfmt)==0) {
		de_err(c, "Not a cpio file, or unknown cpio format");
		goto done;
	}

	subfmt_name = get_subfmt_name(d->first_subfmt);
	de_declare_fmtf(c, "cpio %s", subfmt_name);

	d->crco_cksum = de_crcobj_create(c, DE_CRCOBJ_SUM_BYTES);

	while(1) {
		if(d->trailer_found) break;
		if(pos >= c->infile->len) break;
		bytes_consumed = 0;
		ret = read_member(c, d, pos, &bytes_consumed);
		if(!ret) break;
		if(bytes_consumed<1) break;
		pos += bytes_consumed;
	}

done:
	if(d) {
		de_crcobj_destroy(d->crco_cksum);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xeb220
movl %eax, 0x8(%r14)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3f9c3
testl %eax, %eax
je 0x3f27b
movl (%r14), %eax
decl %eax
cmpl $0x4, %eax
ja 0x3f28e
movl %eax, %eax
leaq 0xdb066(%rip), %rcx     # 0x11a2d8
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmp 0x3f295
leaq 0xdb07c(%rip), %rsi     # 0x11a2fe
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x3f2be
leaq 0xecebc(%rip), %rdx     # 0x12c151
leaq 0xdb08a(%rip), %rsi     # 0x11a326
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb152
movq %rbx, %rdi
movl $0x30, %esi
callq 0xeb499
movq %rax, 0x10(%r14)
cmpl $0x0, 0x4(%r14)
je 0x3f2e1
movq 0x10(%r14), %rdi
callq 0xeb858
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rbp
jge 0x3f2be
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xe8a1c
movq %rbx, %rdi
leaq 0xfc859(%rip), %rsi     # 0x13bb5d
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbx, %rdi
leaq 0xdb06c(%rip), %rsi     # 0x11a391
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r15
movq %rbp, 0x8(%rax)
movq %rbx, %rdi
callq 0xea504
movq %rax, 0x50(%r15)
movb $0x1, 0xc(%rax)
movq 0x8(%r15), %rsi
movq 0x18(%rbx), %rdi
movq %r15, %rdx
callq 0x3f9c3
movl (%r15), %eax
decl %eax
cmpl $0x4, %eax
ja 0x3f7f0
leaq 0xdaf3f(%rip), %rcx     # 0x11a2c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r15), %r12
leaq 0x6(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x10(%rsp), %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x10(%rsp), %edx
movq %rbx, %rdi
leaq 0xdb0bb(%rip), %rsi     # 0x11a480
xorl %eax, %eax
callq 0xe8617
leaq 0xe(%r12), %rsi
movq 0x18(%rbx), %rdi
leaq 0x38(%r15), %r13
movl $0x8, %edx
movl $0x10, %ecx
movq %r13, %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl (%r13), %edx
movq %rbx, %rdi
leaq 0xdb089(%rip), %rsi     # 0x11a48a
xorl %eax, %eax
callq 0xe8617
leaq 0x2e(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x8(%rsp), %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movq 0x8(%rsp), %rdi
movq 0x50(%r15), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0xea7f5
movq 0x50(%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x20(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movl 0x8(%rsp), %edx
movq %rbx, %rdi
leaq 0xdb030(%rip), %rsi     # 0x11a49e
movq %r13, %rcx
xorl %eax, %eax
callq 0xe8617
leaq 0x36(%r12), %rsi
movq 0x18(%rbx), %rdi
leaq 0x28(%r15), %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x28(%r15), %edx
movq %rbx, %rdi
leaq 0xdb014(%rip), %rsi     # 0x11a4be
xorl %eax, %eax
callq 0xe8617
leaq 0x5e(%r12), %rsi
movq 0x18(%rbx), %rdi
movq %r15, %r8
addq $0x18, %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x18(%r15), %edx
movq %rbx, %rdi
leaq 0xdafc9(%rip), %rsi     # 0x11a4af
xorl %eax, %eax
callq 0xe8617
cmpl $0x5, (%r15)
jne 0x3f531
leaq 0x66(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x10(%rsp), %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x10(%rsp), %edx
movl %edx, 0x40(%r15)
movq %rbx, %rdi
leaq 0xdafa3(%rip), %rsi     # 0x11a4cd
xorl %eax, %eax
callq 0xe8617
subq 0x8(%r15), %r12
addq $0x6e, %r12
movq %r12, 0x10(%r15)
addq 0x18(%r15), %r12
movq %r12, %rdi
callq 0xe9c87
subq 0x10(%r15), %rax
movq %rax, 0x20(%r15)
movq 0x28(%r15), %rdi
callq 0xe9c87
movq %rax, 0x30(%r15)
jmp 0x3f6e6
movq 0x8(%r15), %r13
leaq 0xc(%r13), %rsi
movq 0x18(%rbx), %rdi
movl $0x6, %edx
movl $0x8, %ecx
leaq 0x10(%rsp), %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x10(%rsp), %edx
movq %rbx, %rdi
leaq 0xdaee7(%rip), %rsi     # 0x11a480
xorl %eax, %eax
callq 0xe8617
leaq 0x12(%r13), %rsi
movq 0x18(%rbx), %rdi
leaq 0x38(%r15), %r12
movl $0x6, %edx
movl $0x8, %ecx
movq %r12, %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl (%r12), %edx
movq %rbx, %rdi
leaq 0xdaeb6(%rip), %rsi     # 0x11a48a
xorl %eax, %eax
callq 0xe8617
leaq 0x30(%r13), %rsi
movq 0x18(%rbx), %rdi
movl $0xb, %edx
movl $0x8, %ecx
leaq 0x8(%rsp), %r8
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movq 0x8(%rsp), %rdi
movq 0x50(%r15), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0xea7f5
movq 0x50(%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x20(%rsp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movl 0x8(%rsp), %edx
movq %rbx, %rdi
leaq 0xdae5e(%rip), %rsi     # 0x11a49e
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
leaq 0x3b(%r13), %rsi
movq 0x18(%rbx), %rdi
leaq 0x18(%r15), %r8
movl $0x6, %edx
movl $0x8, %ecx
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x18(%r15), %edx
movq %rbx, %rdi
leaq 0xdae38(%rip), %rsi     # 0x11a4af
xorl %eax, %eax
callq 0xe8617
leaq 0x41(%r13), %rsi
movq 0x18(%rbx), %rdi
movq %r15, %r8
addq $0x28, %r8
movl $0xb, %edx
movl $0x8, %ecx
callq 0xef3d9
testl %eax, %eax
je 0x3f6e6
movl 0x28(%r15), %edx
movq %rbx, %rdi
leaq 0xdae10(%rip), %rsi     # 0x11a4be
xorl %eax, %eax
callq 0xe8617
subq 0x8(%r15), %r13
addq $0x4c, %r13
movq %r13, 0x10(%r15)
movq 0x18(%r15), %rax
movq 0x28(%r15), %rcx
movq %rax, 0x20(%r15)
movq %rcx, 0x30(%r15)
jmp 0x3f6e6
movl $0x1, 0x4(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3fa87
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%r15), %rdx
addq 0x8(%r15), %rdx
movq %rbx, %rdi
leaq 0xdacbb(%rip), %rsi     # 0x11a3c0
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl 0x8(%r14), %r9d
movq 0x18(%r15), %rcx
cmpq $0x2, %rcx
movl $0x1, %eax
cmovlq %rax, %rcx
movq 0x10(%r15), %rsi
movl $0x1f5, %eax            # imm = 0x1F5
cmpq %rax, %rcx
cmovgeq %rax, %rcx
decq %rcx
movq 0x18(%rbx), %rdi
addq 0x8(%r15), %rsi
movq %rcx, %rdx
xorl %r8d, %r8d
callq 0xef87c
movq %rax, 0x48(%r15)
movq 0x18(%rax), %rdi
callq 0xf705c
movq %rbx, %rdi
leaq 0xe3010(%rip), %rsi     # 0x12277b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r15), %r12
addq 0x8(%r15), %r12
addq 0x20(%r15), %r12
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x28(%r15), %rcx
movq %rbx, %rdi
leaq 0xdac37(%rip), %rsi     # 0x11a3d3
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x28(%r15), %rax
addq %r12, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x3f805
movq 0x38(%r15), %rax
movl %eax, %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x3f817
cmpl $0x8000, %ecx           # imm = 0x8000
jne 0x3f826
movq 0x50(%r15), %rsi
movl 0x14(%rsi), %ecx
testb $0x49, %al
je 0x3f867
orl $0x2, %ecx
jmp 0x3f86a
movq 0x8(%r15), %rdx
movq %rbx, %rdi
leaq 0xdaba7(%rip), %rsi     # 0x11a3a5
xorl %eax, %eax
callq 0xe9295
xorl %edi, %edi
callq 0xf052b
movb $0x1, %r13b
xorl %r12d, %r12d
jmp 0x3f93e
movq 0x50(%r15), %rsi
movb $0x1, 0x9(%rsi)
movl $0x3, %ecx
jmp 0x3f872
testq %rax, %rax
jne 0x3f84e
cmpq $0xb, 0x18(%r15)
jne 0x3f84e
movq 0x48(%r15), %rax
movq 0x8(%rax), %rdi
leaq 0xdabae(%rip), %rsi     # 0x11a3ef
callq 0x181a0
testl %eax, %eax
je 0x3f992
movq %rbx, %rdi
leaq 0xdabbd(%rip), %rsi     # 0x11a415
xorl %eax, %eax
callq 0xe8617
xorl %r13d, %r13d
jmp 0x3f927
orl $0x1, %ecx
movl %ecx, 0x14(%rsi)
movl $0x1, %ecx
movq 0x48(%r15), %rax
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0xea53f
movq 0x50(%r15), %rdx
movb $0x1, 0x8(%rdx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r13
cmpl $0x5, (%r15)
jne 0x3f8bb
movq 0x10(%r14), %rdi
callq 0xeb7fe
movq 0x10(%r14), %rdx
movq %r13, %rdi
leaq 0xb1b9b(%rip), %rsi     # 0xf1451
callq 0xf1412
movq 0x18(%rbx), %rdi
movq 0x28(%r15), %rdx
movq %r12, %rsi
movq %r13, %rcx
callq 0xef481
cmpl $0x5, (%r15)
jne 0x3f927
movq 0x10(%r14), %rdi
callq 0xeb865
movl %eax, 0x58(%r15)
movq %rbx, %rdi
leaq 0xdab4a(%rip), %rsi     # 0x11a435
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movl 0x58(%r15), %eax
cmpl 0x40(%r15), %eax
je 0x3f927
movq 0x48(%r15), %rax
movq 0x18(%rax), %rdi
callq 0xf70f6
movl 0x40(%r15), %ecx
movl 0x58(%r15), %r8d
movq %rbx, %rdi
leaq 0xdab32(%rip), %rsi     # 0x11a44f
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8faa
movq %r13, %rdi
callq 0xf052b
movq 0x20(%r15), %r12
addq 0x10(%r15), %r12
addq 0x30(%r15), %r12
xorl %r13d, %r13d
movq 0x48(%r15), %rsi
movq %rbx, %rdi
callq 0xefaca
movq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0xea50e
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe8be2
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
testb %r13b, %r13b
jne 0x3f2be
testq %r12, %r12
jle 0x3f2be
addq %r12, %rbp
cmpl $0x0, 0x4(%r14)
je 0x3f2e3
jmp 0x3f2be
movq %rbx, %rdi
leaq 0xdaa5e(%rip), %rsi     # 0x11a3fa
xorl %eax, %eax
callq 0xe8617
movl $0x1, 0x4(%r14)
jmp 0x3f85f