// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: de_run_ar001
static void de_run_ar001(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;
	struct member_data *md = NULL;

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

	d->crco = de_crcobj_create(c, DE_CRCOBJ_CRC16_IBMSDLC);

	pos = 0;
	while(1) {
		if(pos >= c->infile->len) break;

		md = create_member_data(c);
		md->encoding = d->input_encoding;
		md->member_pos = pos;
		if(!do_read_ar001_member(c, d, md)) goto done;
		if(md->total_size<1) goto done;

		d->member_count++;
		pos += md->total_size;

		destroy_member_data(c, md);
		md = NULL;
	}

done:
	destroy_member_data(c, md);
	lha_destroy_lctx(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x80948
movq %rax, %r14
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe08d2
movl %eax, (%r14)
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xe0ae9
movq %rax, 0x28(%r14)
xorl %r13d, %r13d
movq %r14, 0x18(%rsp)
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r13
jge 0x80655
movq %rbx, %rdi
callq 0x819da
movq %rax, %r15
movl (%r14), %eax
movl %eax, 0x4(%r15)
movq %r13, 0x8(%r15)
movq %r13, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
leaq 0xae4e0(%rip), %rsi     # 0x12e86d
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movb $0x0, (%r15)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3fc4
testq %rax, %rax
je 0x8065a
movq %rax, %rbp
movq %rbx, %rdi
leaq 0x9effb(%rip), %rsi     # 0x11f3c5
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0x12, %rbp
jl 0x8067e
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3fc4
andl $0x0, (%rsp)
movq %rax, %r14
movb $0x0, 0x4(%rsp)
cmpl $0x1, %r14d
je 0x80410
testl %r14d, %r14d
jne 0x8041c
movb $0x2d, 0x4(%rsp)
movl $0x30686c2d, (%rsp)     # imm = 0x30686C2D
jmp 0x8041c
movb $0x2d, 0x4(%rsp)
movl $0x34686c2d, (%rsp)     # imm = 0x34686C2D
movq %rbp, %r12
addq $-0x12, %r12
movq %rbx, %rdi
pushq $0x70
popq %rsi
callq 0xdecaf
movq %rax, 0x18(%r15)
movq %rsp, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x81a78
movq 0x18(%r15), %rcx
addq $0x1b, %rcx
movq %rbx, %rdi
leaq 0x9b353(%rip), %rsi     # 0x11b7a4
movq %r14, 0x20(%rsp)
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
addq $0x6, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xe40bf
movq %rax, 0x60(%r15)
movq %rbx, %rdi
leaq 0x90e42(%rip), %rsi     # 0x1112c7
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe40bf
movq %rax, 0x28(%r15)
movq %rbx, %rdi
leaq 0x8ac53(%rip), %rsi     # 0x10b0fc
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3fc4
movl %eax, 0x4c(%r15)
movq %rbx, %rdi
leaq 0x931f7(%rip), %rsi     # 0x1136c4
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x81c00
addq %r12, 0x8(%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %r12
movq %r12, %rsi
movq %r15, %rdx
callq 0x8207f
movq 0x18(%rbx), %rdi
movq %r14, %rsi
movq %r12, %r14
callq 0xe3fc4
movl %eax, 0x38(%r15)
movq %rbx, %rdi
leaq 0x9eec9(%rip), %rsi     # 0x11f3e7
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x28(%r12), %rdi
callq 0xe0e44
movq 0x28(%r12), %rdi
movq 0x18(%rbx), %rsi
movq 0x8(%r15), %rdx
addq $0x2, %rdx
movq %rbp, %rcx
callq 0xe0f33
movq 0x28(%r12), %rdi
callq 0xe0e95
movl %eax, 0x3c(%r15)
movq %rbx, %rdi
leaq 0xa1d8b(%rip), %rsi     # 0x1222ed
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movl 0x38(%r15), %edx
movl 0x3c(%r15), %ecx
cmpl %edx, %ecx
je 0x80588
movq %rbx, %rdi
leaq 0x9ec58(%rip), %rsi     # 0x11f1d9
xorl %eax, %eax
callq 0xdf2a5
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3fc4
movq %rax, %r12
movq %rbx, %rdi
leaq 0x9ee68(%rip), %rsi     # 0x11f40b
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
jne 0x8066d
movq 0x8(%rsp), %rdx
movq 0x60(%r15), %rcx
movq %rdx, %rax
subq %r13, %rax
addq %rcx, %rax
movq %rax, 0x10(%r15)
movq %rdx, 0x58(%r15)
movq %rbx, %rdi
leaq 0x8cd09(%rip), %rsi     # 0x10d2e3
xorl %eax, %eax
callq 0xde896
movq 0x18(%r15), %rax
cmpq $0x0, 0x8(%rax)
je 0x80607
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x82130
jmp 0x80629
movq 0x78(%r15), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0x9ee39(%rip), %rsi     # 0x11f453
movq %rax, %rdx
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0xdf2a5
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq 0x10(%r15), %rax
testq %rax, %rax
jle 0x8068a
incl 0x1c(%r14)
addq %rax, %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x819eb
jmp 0x8034d
xorl %r15d, %r15d
jmp 0x8068a
leaq 0x8acaa(%rip), %rsi     # 0x10b30b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
jmp 0x8067e
leaq 0x9edb2(%rip), %rsi     # 0x11f426
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x819eb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x819a6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq