// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_after_pass_1
static void do_after_pass_1(deark *c, lctx *d)
{
	// Read the SYSTEM file first -- lots of other things depend on it.
	if(d->found_system_file) {
		do_file(c, d, d->offset_of_system_file, FILETYPE_SYSTEM, 0, NULL);
	}

	if(d->found_Phrases_file) {
		d->uses_old_phrase_compression = 1;
	}
	else if(d->found_PhrIndex_file && d->found_PhrImage_file) {
		d->uses_hall_compression = 1;
	}

	if(d->input_encoding==DE_ENCODING_UNKNOWN || d->input_encoding==DE_ENCODING_ASCII) {
		d->output_is_utf8 = 0;
	}
	else {
		d->output_is_utf8 = 1;
	}

	// Read other special files, in a suitable order.

	if(d->found_Phrases_file && d->uses_old_phrase_compression) {
		do_file(c, d, d->offset_of_Phrases, FILETYPE_PHRASES, 0, NULL);
	}

	if(d->found_PhrIndex_file && d->uses_hall_compression) {
		do_file(c, d, d->offset_of_PhrIndex, FILETYPE_PHRINDEX, 0, NULL);
	}
	if(d->found_PhrImage_file && d->uses_hall_compression) {
		do_file(c, d, d->offset_of_PhrImage, FILETYPE_PHRIMAGE, 0, NULL);
	}
	sanitize_phrase_info(c, d);

	if(d->found_TOPIC_file) {
		do_file(c, d, d->offset_of_TOPIC, FILETYPE_TOPIC, 0, NULL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x58(%rax)
je 0x7d18c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x7b630
movq -0x10(%rbp), %rax
cmpb $0x0, 0x59(%rax)
je 0x7d1a6
movq -0x10(%rbp), %rax
movl $0x1, 0x9c(%rax)
jmp 0x7d1d0
movq -0x10(%rbp), %rax
movzbl 0x5a(%rax), %eax
cmpl $0x0, %eax
je 0x7d1ce
movq -0x10(%rbp), %rax
movzbl 0x5b(%rax), %eax
cmpl $0x0, %eax
je 0x7d1ce
movq -0x10(%rbp), %rax
movl $0x1, 0xa0(%rax)
jmp 0x7d1d0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7d1e2
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x7d1ef
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x7d1fa
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x10(%rbp), %rax
movzbl 0x59(%rax), %eax
cmpl $0x0, %eax
je 0x7d236
movq -0x10(%rbp), %rax
cmpl $0x0, 0x9c(%rax)
je 0x7d236
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movl $0x7, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x7b630
movq -0x10(%rbp), %rax
movzbl 0x5a(%rax), %eax
cmpl $0x0, %eax
je 0x7d272
movq -0x10(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
je 0x7d272
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdx
movl $0x8, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x7b630
movq -0x10(%rbp), %rax
movzbl 0x5b(%rax), %eax
cmpl $0x0, %eax
je 0x7d2ae
movq -0x10(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
je 0x7d2ae
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdx
movl $0x9, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x7b630
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7d4f0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5c(%rax)
je 0x7d2ea
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdx
movl $0x5, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x7b630
addq $0x10, %rsp
popq %rbp
retq