// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/installshld.c
// Function: de_run_is_instarch
static void de_run_is_instarch(deark *c, de_module_params *mparams)
{
	de_arch_lctx *da = NULL;
	i64 pos;
	i64 i;
	struct de_arch_member_data *md = NULL;

	da = de_arch_create_lctx(c);
	da->is_le = 1;
	da->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	pos = 78;
	da->num_members = de_getu16le_p(&pos); // This might actually be a 32-bit field
	de_dbg(c, "number of members: %"I64_FMT, da->num_members);
	pos += 2;

	for(i=0; i<da->num_members; i++) {
		if(pos >= c->infile->len) goto done;

		if(md) {
			de_arch_destroy_md(c, md);
			md = NULL;
		}
		md = de_arch_create_md(c, da);
		md->member_hdr_pos = pos;
		if(!do_instarch_member(c, da, md)) goto done;
		if(md->member_hdr_size<=0) goto done;
		pos += md->member_hdr_size;
	}

done:
	if(md) {
		de_arch_destroy_md(c, md);
	}
	if(da) {
		de_arch_destroy_lctx(c, da);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xfd4b2
movq %rax, %r14
movl $0x1, 0x10(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb220
movl %eax, 0x18(%r14)
leaq 0x10(%rsp), %r15
movq $0x4e, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, 0x20(%r14)
leaq 0x72724(%rip), %rsi     # 0x114737
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%r15), %rax
addq $0x2, %rax
movq %rax, (%r15)
cmpq $0x0, 0x20(%r14)
jle 0xa220d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jge 0xa21e7
testq %r15, %r15
je 0xa2058
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfd460
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfd414
movq %rax, %r15
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r15)
movq %rax, (%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xe8a1c
movq 0x18(%r15), %rdx
movq %rbx, %rdi
leaq 0x99acf(%rip), %rsi     # 0x13bb5d
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0xeed83
movq %rax, 0x40(%r15)
movq %rbx, %rdi
leaq 0x83f70(%rip), %rsi     # 0x12602f
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
movq %r13, %rsi
callq 0xfd57d
movq %r15, %rdi
movq %r13, %rsi
callq 0xfd538
addq $0x8, (%rsp)
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeebeb
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movq 0x58(%r15), %rcx
movl 0x18(%r14), %r9d
movq %rax, %rdx
xorl %r8d, %r8d
callq 0xefbd7
movq 0x58(%r15), %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0x90888(%rip), %rsi     # 0x1329a9
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %r12, (%rsp)
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeebeb
movq %rax, %r12
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movl 0x18(%r14), %r9d
movq %r12, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xefbd7
movq %r13, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0x90841(%rip), %rsi     # 0x1329b6
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %r12, (%rsp)
movq %r15, %rdi
callq 0xfd7af
testl %eax, %eax
je 0xa21ee
leaq 0x737(%rip), %rax       # 0xa28cd
movq %rax, 0xa8(%r15)
movq %r15, %rdi
callq 0xfd85e
movq (%rsp), %rax
subq 0x18(%r15), %rax
movq %rax, 0x20(%r15)
movq %r13, %rdi
callq 0xf6753
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq 0x20(%r15), %rax
testq %rax, %rax
jle 0xa2202
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
incq %rbp
cmpq 0x20(%r14), %rbp
jl 0xa203a
jmp 0xa2202
testq %r15, %r15
jne 0xa2202
jmp 0xa220d
movq %r13, %rdi
callq 0xf6753
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfd460
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfd4cd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq