// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/sis.c
// Function: do_requisite_records
static void do_requisite_records(deark *c, lctx *d)
{
	i64 pos1 = d->requisites_ptr;
	i64 pos = pos1;
	i64 k, i;
	de_ucstring *s = NULL;

	if(d->nrequisites<1) return;
	if(pos1<1 || pos1>=c->infile->len) return;
	de_dbg(c, "requisite records at %"I64_FMT, pos1);
	s = ucstring_create(c);
	de_dbg_indent(c, 1);
	for(k=0; k<d->nrequisites; k++) {
		i64 n, n2;

		de_dbg(c, "requisite record[%d] at %"I64_FMT, (int)k, pos);
		de_dbg_indent(c, 1);
		n = de_getu32le_p(&pos);
		de_dbg(c, "UID: 0x%08x", (unsigned int)n);
		n = de_getu16le_p(&pos);
		n2 = de_getu16le_p(&pos);
		de_dbg(c, "version required: %d,%d", (int)n, (int)n2);
		n = de_getu32le_p(&pos);
		de_dbg(c, "variant: 0x%08x", (unsigned int)n);

		for(i=0; i<d->nlangs; i++) {
			i64 npos, nlen;
			nlen = de_getu32le(pos+4*i);
			npos = de_getu32le(pos+4*d->nlangs+4*i);
			ucstring_empty(s);
			read_sis_string(c, d, s, npos, nlen);
			de_dbg(c, "name[%d]: \"%s\"", (int)i, ucstring_getpsz_d(s));
		}
		pos += 4*d->nlangs; // name lengths
		pos += 4*d->nlangs; // name pointers

		de_dbg_indent(c, -1);
	}
	de_dbg_indent(c, -1);
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x20(%rax)
jge 0x14313c
jmp 0x14339b
cmpq $0x1, -0x18(%rbp)
jl 0x143155
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0x14315a
jmp 0x14339b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x8b4fb(%rip), %rsi     # 0x1ce664
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jge 0x143384
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rcx
leaq 0x8b4c3(%rip), %rsi     # 0x1ce67d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0x8b4a4(%rip), %rsi     # 0x1ce699
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movl %eax, %ecx
leaq 0x8b468(%rip), %rsi     # 0x1ce6a5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0x8b453(%rip), %rsi     # 0x1ce6bd
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x14333d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x165540
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x165540
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
callq 0x143600
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movl %eax, -0x5c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172650
movq -0x68(%rbp), %rdi
movl -0x5c(%rbp), %edx
movq %rax, %rcx
leaq 0x8b330(%rip), %rsi     # 0x1ce655
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x143279
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x2, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x2, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x143193
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x38(%rbp), %rdi
callq 0x171750
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)