// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/t64.c
// Function: de_run_t64
static void de_run_t64(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;
	i64 i;

	d = de_malloc(c, sizeof(lctx));

	pos = 32;
	d->version = de_getu16le(pos);
	de_dbg(c, "version: 0x%04x", (int)d->version);
	if(d->version!=0x100 && d->version!=0x101) {
		de_warn(c, "Unexpected version number. This might not be a T64 file.");
	}

	d->max_dir_entries = de_getu16le(pos+2);
	d->used_dir_entries = de_getu16le(pos+4);
	de_dbg(c, "max dir entries = %d, files = %d", (int)d->max_dir_entries, (int)d->used_dir_entries);

	pos += 32;
	for(i=0; i<d->max_dir_entries; i++) {
		do_dir_entry(c, d, i, pos+32*i);
	}

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe8b2b
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x20, %esi
callq 0xeebc8
movq %rax, (%r14)
leaq 0x6d74b(%rip), %rsi     # 0x1353f9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, (%rsp)
movq (%r14), %rax
andq $-0x2, %rax
cmpq $0x100, %rax            # imm = 0x100
je 0xc7cde
leaq 0x73d40(%rip), %rsi     # 0x13ba14
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
movq 0x18(%rbx), %rdi
movl $0x22, %esi
callq 0xeebc8
movq (%rsp), %r14
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rdi
movl $0x24, %esi
callq 0xeebc8
movq %rax, 0x10(%r14)
movl 0x8(%r14), %edx
leaq 0x73d3c(%rip), %rsi     # 0x13ba4d
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
cmpq $0x0, 0x8(%r14)
jle 0xc7f85
movl $0x5f, %r13d
xorl %r12d, %r12d
movq %r12, %rbp
shlq $0x5, %rbp
leaq 0x40(%rbp), %r14
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeead3
testb %al, %al
je 0xc7f06
movzbl %al, %r15d
movq %rbx, %rdi
leaq 0x73d17(%rip), %rsi     # 0x13ba75
movl %r12d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq 0x41(%rbp), %rsi
callq 0xeead3
movzbl %al, %r14d
movq %rbx, %rdi
leaq 0x73cf2(%rip), %rsi     # 0x13ba85
movl %r15d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe8617
testb %r14b, %r14b
je 0xc7f1f
movq 0x18(%rbx), %rdi
leaq 0x42(%rbp), %rsi
movq %rsi, 0x18(%rsp)
callq 0xeebc8
movq %rax, %r15
movq 0x18(%rbx), %rdi
leaq 0x44(%rbp), %rsi
callq 0xeebc8
movq %rax, %r14
movq 0x18(%rbx), %rdi
leaq 0x48(%rbp), %rsi
callq 0xeed61
movq %rbx, %rdi
leaq 0x73ce1(%rip), %rsi     # 0x13bac6
movq %r15, 0x20(%rsp)
movl %r15d, %edx
movq %r14, 0x8(%rsp)
movl %r14d, %ecx
movq %rax, 0x10(%rsp)
movl %eax, %r8d
xorl %eax, %eax
callq 0xe8617
addq $0x50, %rbp
movl $0x10, %r15d
movq %r13, %r14
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeead3
cmpb $0x20, %al
jne 0xc7e2c
decq %r14
decq %r15
jne 0xc7e11
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x5280c(%rip), %rsi     # 0x11a642
movl %r15d, %edx
xorl %eax, %eax
callq 0xe87e4
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x15, %r9d
callq 0xefbd7
movq %r14, %rdi
callq 0xf705c
movq %rbx, %rdi
leaq 0x73ed6(%rip), %rsi     # 0x13bd4e
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
leaq 0x73c5d(%rip), %rsi     # 0x13bae9
movl $0x5, %edx
callq 0xf65e3
movq %rbx, %rdi
callq 0xea504
movq %rax, %rbp
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xea53f
movb $0x1, 0x8(%rbp)
movq 0x8(%rsp), %rax
subq 0x20(%rsp), %rax
js 0xc7f34
movq %rbx, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movq %rax, 0x8(%rsp)
callq 0xefda1
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x2, %edx
movq 0x18(%rsp), %rsi
movq %rax, %rcx
callq 0xef481
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
callq 0xef481
jmp 0xc7f48
movq %rbx, %rdi
leaq 0x73b5e(%rip), %rsi     # 0x13ba6e
movl %r12d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe87e4
jmp 0xc7f70
movq %rbx, %rdi
leaq 0x73b7e(%rip), %rsi     # 0x13baa7
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9295
jmp 0xc7f63
movq %rbx, %rdi
leaq 0x73bb0(%rip), %rsi     # 0x13baee
xorl %eax, %eax
callq 0xe9295
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf052b
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xea50e
movq %r14, %rdi
callq 0xf6753
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
incq %r12
addq $0x20, %r13
movq (%rsp), %rax
cmpq 0x8(%rax), %r12
jl 0xc7d31
movq %rbx, %rdi
movq (%rsp), %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe8be2