// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_file_PhrIndex
static void do_file_PhrIndex(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;
	i64 cmprsize;
	i64 n;
	UI bits;
	UI bitcount;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	if(len<30) goto done;
	n = de_getu32le_p(&pos);
	if(n!=1) goto done;
	d->num_phrases = (UI)de_getu32le_p(&pos);
	de_dbg(c, "num phrases: %u", d->num_phrases);
	d->phrase_info = de_mallocarray(c, (i64)d->num_phrases, sizeof(struct phrase_item));

	cmprsize = de_getu32le_p(&pos);
	de_dbg(c, "index cmpr size: %"I64_FMT, cmprsize);
	d->PhrImageUncSize = de_getu32le_p(&pos);
	de_dbg(c, "PhrImage uncmpr size: %"I64_FMT, d->PhrImageUncSize);
	d->PhrImageCmprSize = de_getu32le_p(&pos);
	de_dbg(c, "PhrImage cmpr size: %"I64_FMT, d->PhrImageCmprSize);
	pos += 4;
	bits = (UI)de_getu16le_p(&pos);
	de_dbg(c, "bits: 0x%04x", bits);
	de_dbg_indent(c, 1);
	bitcount = bits & 0xf;
	de_dbg(c, "bit count: %u", bitcount);
	de_dbg_indent(c, -1);
	pos += 2;

	de_dbg(c, "avail size: %"I64_FMT, (i64)(pos1+len-pos));
	phrdecompress(c, d, pos, pos1+len-pos, bitcount);
done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x15b580
cmpq $0x1e, -0x20(%rbp)
jge 0x7c289
jmp 0x7c468
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
je 0x7c2aa
jmp 0x7c468
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %edx
leaq 0x13117e(%rip), %rsi    # 0x1ad45a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
movl %eax, %esi
movl $0x8, %edx
callq 0x15c450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x100(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x1311f6(%rip), %rsi    # 0x1ad525
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %rdx
leaq 0x1311cf(%rip), %rsi    # 0x1ad53a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdx
leaq 0x1311ad(%rip), %rsi    # 0x1ad554
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %edx
leaq 0x130f68(%rip), %rsi    # 0x1ad344
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movl -0x3c(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl -0x40(%rbp), %edx
leaq 0x131164(%rip), %rsi    # 0x1ad56c
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq -0x20(%rbp), %rdx
subq -0x28(%rbp), %rdx
leaq 0x13113a(%rip), %rsi    # 0x1ad57a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x28(%rbp), %rcx
movl -0x40(%rbp), %r8d
callq 0x7ec90
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x15b5a0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)