LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: get_colormode_name
static const char *get_colormode_name(i64 n)
{
	const char *name = "?";
	switch(n) {
	case PSD_CM_BITMAP: name="bitmap"; break;
	case PSD_CM_GRAY: name="grayscale"; break;
	case PSD_CM_PALETTE: name="indexed"; break;
	case PSD_CM_RGB: name="RGB"; break;
	case 4: name="CMYK"; break;
	case 7: name="multichannel"; break;
	case 8: name="duotone"; break;
	case 9: name="Lab"; break;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
leaq 0xbd28e(%rip), %rax     # 0x1b7c2d
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
subq $0x9, %rax
ja 0xfaa2b
movq -0x18(%rbp), %rax
leaq 0xc3e40(%rip), %rcx     # 0x1be7fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa8cd8(%rip), %rax     # 0x1a36a4
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xa74ef(%rip), %rax     # 0x1a1ec8
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xc5412(%rip), %rax     # 0x1bfdf8
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xd0c22(%rip), %rax     # 0x1cb615
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xbc1b8(%rip), %rax     # 0x1b6bb8
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xc53f3(%rip), %rax     # 0x1bfe00
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xc53f3(%rip), %rax     # 0x1bfe0d
movq %rax, -0x10(%rbp)
jmp 0xfaa2b
leaq 0xd01fd(%rip), %rax     # 0x1cac24
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_vm_array
static void do_vm_array(deark *c, lctx *d, zztype *zz)
{
	i64 n;
	i64 dlen, idata_len;
	i64 saved_pos;

	zz->pos += 4; // Skip array-is-written flag (already processed)

	dlen = psd_getu32zz(zz);
	de_dbg(c, "length: %d", (int)dlen);
	if(dlen==0) goto done;

	saved_pos = zz->pos;

	n = psd_getu32zz(zz);
	de_dbg(c, "depth: %d", (int)n);

	read_rectangle_tlbr(c, d, zz, "rectangle");

	n = psd_getu16zz(zz);
	de_dbg(c, "depth: %d", (int)n);

	n = (i64)psd_getbytezz(zz);
	dbg_print_compression_method(c, d, n);

	idata_len = saved_pos + dlen - zz->pos;
	de_dbg(c, "[%d bytes of data at %d]", (int)idata_len, (int)zz->pos);

	zz->pos = saved_pos + dlen;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xbc20b(%rip), %rsi     # 0x1b6eaa
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x28(%rbp)
jne 0xfacb2
jmp 0xfada9
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xb3005(%rip), %rsi     # 0x1adcef
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0xb0422(%rip), %rcx     # 0x1ab126
callq 0xf5820
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xb2fb9(%rip), %rsi     # 0x1adcef
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xf4120
movzbl %al, %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xfadb0
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc50d5(%rip), %rsi     # 0x1bfe68
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rcx
addq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: dbg_print_compression_method
static void dbg_print_compression_method(deark *c, lctx *d, i64 cmpr)
{
	const char *name = "?";

	switch(cmpr) {
	case 0: name="uncompressed"; break;
		// (At one point the PSD spec says that "1 is zip", but I think that's a
		// clerical error. My best guess is that all the compression fields use
		// the same compression codes.)
	case 1: name="PackBits"; break;
	case 2: name="ZIP without prediction"; break;
	case 3: name="ZIP with prediction"; break;
	}
	de_dbg(c, "compression method: %d (%s)", (int)cmpr, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xbce62(%rip), %rax     # 0x1b7c2d
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
subq $0x3, %rax
ja 0xfae23
movq -0x28(%rbp), %rax
leaq 0xc3a3c(%rip), %rcx     # 0x1be824
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xdb040(%rip), %rax     # 0x1d5e38
movq %rax, -0x20(%rbp)
jmp 0xfae23
leaq 0xb97d2(%rip), %rax     # 0x1b45d7
movq %rax, -0x20(%rbp)
jmp 0xfae23
leaq 0xc506f(%rip), %rax     # 0x1bfe81
movq %rax, -0x20(%rbp)
jmp 0xfae23
leaq 0xc5079(%rip), %rax     # 0x1bfe98
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rcx
leaq 0xd4f9a(%rip), %rsi     # 0x1cfdd2
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_filter_effect_channel
static void do_filter_effect_channel(deark *c, lctx *d, zztype *zz)
{
	i64 dlen;
	i64 saved_pos;
	i64 cmpr_mode;

	zz->pos += 4; // Skip array-is-written flag (already processed)

	dlen = psd_geti64zz(zz);
	de_dbg(c, "length: %"I64_FMT"", dlen);
	de_sanitize_length(&dlen);
	saved_pos = zz->pos;
	if(dlen<=0) goto done;

	cmpr_mode = psd_getu16zz(zz);
	dbg_print_compression_method(c, d, cmpr_mode);

	de_dbg(c, "[%d bytes at %d]", (int)(saved_pos + dlen - zz->pos), (int)zz->pos);
	zz->pos = saved_pos + dlen;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf8890
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xa785a(%rip), %rsi     # 0x1a2a97
movb $0x0, %al
callq 0x15b0d0
leaq -0x20(%rbp), %rdi
callq 0x15f830
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x20(%rbp)
jg 0xfb261
jmp 0xfb2c9
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xfadb0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc4e99(%rip), %rsi     # 0x1c014c
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rcx
addq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_samp_block_v61stuff
static void do_samp_block_v61stuff(deark *c, lctx *d, zztype *zz)
{
	i64 n;
	i64 idata_len;

	// This code is based on guesswork, and may not be correct.

	zz->pos += 8; // 8 unknown bytes

	// Note the similarity to vm_array.

	n = psd_getu16zz(zz);
	de_dbg(c, "depth: %d", (int)n);

	read_rectangle_tlbr(c, d, zz, "rectangle");

	n = psd_getu16zz(zz);
	de_dbg(c, "depth: %d", (int)n);

	n = (i64)psd_getbytezz(zz);
	dbg_print_compression_method(c, d, n);

	idata_len = zz_avail(zz);
	de_dbg(c, "[%d bytes of data at %d]", (int)idata_len, (int)zz->pos);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x8, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xb29d0(%rip), %rsi     # 0x1adcef
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0xafded(%rip), %rcx     # 0x1ab126
callq 0xf5820
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xb2984(%rip), %rsi     # 0x1adcef
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xf4120
movzbl %al, %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xfadb0
movq -0x18(%rbp), %rdi
callq 0xf40b0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc4aa6(%rip), %rsi     # 0x1bfe68
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_samp_block_v62stuff
static void do_samp_block_v62stuff(deark *c, lctx *d, zztype *zz)
{
	i64 x;
	zztype czz;

	// This code is based on guesswork, and may not be correct.

	// I don't know what the first 4 bytes are for. Observed to be 00 01 00 00.
	x = psd_getu32zz(zz);
	if(x != 0x00010000) {
		return;
	}

	zz_init(&czz, zz);
	do_vm_array_list(c, d, &czz);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
cmpq $0x10000, -0x20(%rbp)   # imm = 0x10000
je 0xfb40c
jmp 0xfb42a
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xfaa40
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: read_prefixed_string_to_ucstring
static void read_prefixed_string_to_ucstring(deark *c, lctx *d, de_ucstring *s, zztype *zz)
{
	i64 dlen;

	if(zz_avail(zz)<4) {
		zz->pos = zz->endpos;
		return;
	}

	dlen = psd_getu32zz(zz);

	if(zz->pos + dlen > zz->endpos) { // error
		zz->pos = zz->endpos;
		return;
	}

	dbuf_read_to_ucstring(c->infile, zz->pos, dlen, s, 0, d->input_encoding);
	zz->pos += dlen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xfc128
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0xfc19f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0xfc16a
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0xfc19f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_asl_patterns
static void do_asl_patterns(deark *c, lctx *d, zztype *zz)
{
	i64 pat_ver;
	i64 patseq_len;
	zztype czz_patseq;

	de_dbg(c, "patterns at %d", (int)zz->pos);
	de_dbg_indent(c, 1);
	pat_ver = psd_getu16zz(zz);
	de_dbg(c, "patterns version: %d", (int)pat_ver);
	patseq_len = psd_getu32zz(zz);
	de_dbg(c, "patterns total length: %d", (int)patseq_len);

	// Sequence of patterns
	zz_init_with_len(&czz_patseq, zz, patseq_len);

	do_pattern_sequence(c, d, &czz_patseq);

	zz->pos += patseq_len;

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0xc4297(%rip), %rsi     # 0x1c063f
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc4264(%rip), %rsi     # 0x1c064e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xc4245(%rip), %rsi     # 0x1c0663
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0xf3380
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0xfa610
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_abr_v6
static void do_abr_v6(deark *c, lctx *d, zztype *zz)
{
	u32 sig;
	zztype czz;

	zz->pos += 4; // Version numbers(?), already read
	sig = (u32)psd_getu32(zz->pos);
	if(sig!=CODE_8BIM) {
		de_err(c, "Bad signature or unsupported Brush format");
		goto done;
	}

	zz_init(&czz, zz);
	do_tagged_blocks(c, d, &czz, 2);

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x1658c0
movl %eax, -0x1c(%rbp)
cmpl $0x3842494d, -0x1c(%rbp) # imm = 0x3842494D
je 0xfc4cd
movq -0x8(%rbp), %rdi
leaq 0xc422c(%rip), %rsi     # 0x1c06f0
movb $0x0, %al
callq 0x15bfb0
jmp 0xfc4f0
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movl $0x2, %ecx
callq 0xf7ce0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_abr_v1
static void do_abr_v1(deark *c, lctx *d, zztype *zz)
{
	i64 num_brushes;
	i64 i;

	zz->pos += 2;
	num_brushes = psd_getu16zz(zz);
	de_dbg(c, "number of brushes: %d", (int)num_brushes);

	for(i=0; i<num_brushes; i++) {
		i64 brushtype;
		i64 bdeflen;

		if(zz->pos >= zz->endpos) break;

		de_dbg(c, "brush definition[%d] at %d", (int)i, (int)zz->pos);
		de_dbg_indent(c, 1);

		brushtype = psd_getu16zz(zz);
		de_dbg(c, "brush type: %d", (int)brushtype);
		bdeflen = psd_getu32zz(zz);
		de_dbg(c, "brush definition data dpos=%d, dlen=%d", (int)zz->pos, (int)bdeflen);

		zz->pos += bdeflen;

		de_dbg_indent(c, -1);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc41cb(%rip), %rsi     # 0x1c071a
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xfc64f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0xfc582
jmp 0xfc64f
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc4194(%rip), %rsi     # 0x1c0730
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc416d(%rip), %rsi     # 0x1c074b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0xc413f(%rip), %rsi     # 0x1c075a
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xfc55e
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: de_module_palmbitmap
void de_module_palmbitmap(deark *c, struct deark_module_info *mi)
{
	mi->id = "palmbitmap";
	mi->desc = "Palm BitmapType";
	mi->run_fn = de_run_palmbitmap;
	mi->identify_fn = de_identify_palmbitmap;
	mi->help_fn = de_help_palmbitmap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xc4085(%rip), %rcx     # 0x1c08bc
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xc4082(%rip), %rcx     # 0x1c08c7
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xfc880
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xbd(%rip), %rcx        # 0xfc920
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x11e(%rip), %rcx       # 0xfc990
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: de_run_palmbitmap
static void de_run_palmbitmap(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	if(de_get_ext_option(c, "palm:le")) {
		d->is_le = 1;
	}
	if(de_get_ext_option(c, "palm:nocolortable")) {
		// Enables a hack, for files that apparently set the hasColorTable flag
		// incorrectly
		d->ignore_color_table_flag = 1;
	}
	do_palm_BitmapType(c, d, 0, c->infile->len);
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xc4022(%rip), %rsi     # 0x1c08d7
callq 0x15cb30
cmpq $0x0, %rax
je 0xfc8ca
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rdi
leaq 0xc400a(%rip), %rsi     # 0x1c08df
callq 0x15cb30
cmpq $0x0, %rax
je 0xfc8eb
movq -0x18(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0xfc9d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: de_identify_palmbitmap
static int de_identify_palmbitmap(deark *c)
{
	if(de_input_file_has_ext(c, "palm")) {
		int x;
		x = de_identify_palmbitmap_internal(c, c->infile, 0, c->infile->len);
		if(x) return 90;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc4a75(%rip), %rsi     # 0x1c13ac
callq 0x15d180
cmpl $0x0, %eax
je 0xfc976
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0xfe550
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xfc974
movl $0x5a, -0x4(%rbp)
jmp 0xfc97d
jmp 0xfc976
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: do_palm_BitmapType
static void do_palm_BitmapType(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 nextbitmapoffs = 0;
	i64 pos = pos1;

	while(1) {
		if(de_getbyte(pos+8) == 0xff) {
			de_dbg(c, "[skipping dummy bitmap header at %d]", (int)pos);
			pos += 16;
		}

		if(pos > pos1+len-16) {
			de_err(c, "Bitmap exceeds its bounds");
			break;
		}
		do_palm_BitmapType_internal(c, d, pos, pos1+len-pos, &nextbitmapoffs);
		if(nextbitmapoffs<=0) break;
		pos += nextbitmapoffs;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
callq 0x165060
movzbl %al, %eax
cmpl $0xff, %eax
jne 0xfca3b
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc3ec9(%rip), %rsi     # 0x1c08f1
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq $0x10, %rcx
cmpq %rcx, %rax
jle 0xfca64
movq -0x8(%rbp), %rdi
leaq 0xc3ebb(%rip), %rsi     # 0x1c0916
movb $0x0, %al
callq 0x15bfb0
jmp 0xfca9f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x30(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0xfcab0
cmpq $0x0, -0x28(%rbp)
jg 0xfca8e
jmp 0xfca9f
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xfc9f8
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: get_cmpr_type_name
static const char *get_cmpr_type_name(enum palm_cmpr_type cmpr_type)
{
	const char *name;

	switch(cmpr_type) {
	case PCMPR_NONE: name = "none"; break;
	case PCMPR_SCANLINE: name = "ScanLine"; break;
	case PCMPR_RLE: name = "RLE"; break;
	case PCMPR_PACKBITS8: name = "PackBits"; break;
	case PCMPR_PACKBITS16: name = "PackBits16"; break;
	default: name = "?"; break;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x4, %eax
ja 0xfd6fc
movq -0x18(%rbp), %rax
leaq 0xc31ae(%rip), %rcx     # 0x1c0860
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9f04b(%rip), %rax     # 0x19c70d
movq %rax, -0x10(%rbp)
jmp 0xfd707
leaq 0xc35b4(%rip), %rax     # 0x1c0c83
movq %rax, -0x10(%rbp)
jmp 0xfd707
leaq 0xb3036(%rip), %rax     # 0x1b0712
movq %rax, -0x10(%rbp)
jmp 0xfd707
leaq 0xb6eee(%rip), %rax     # 0x1b45d7
movq %rax, -0x10(%rbp)
jmp 0xfd707
leaq 0xc3596(%rip), %rax     # 0x1c0c8c
movq %rax, -0x10(%rbp)
jmp 0xfd707
leaq 0xba52a(%rip), %rax     # 0x1b7c2d
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: do_BitmapDirectInfoType
static void do_BitmapDirectInfoType(deark *c, lctx *d, struct page_ctx *pg,
	i64 pos)
{
	u8 cbits[3];
	u8 t[4];

	de_dbg(c, "BitmapDirectInfoType structure at %d", (int)pos);
	de_dbg_indent(c, 1);
	cbits[0] = de_getbyte(pos);
	cbits[1] = de_getbyte(pos+1);
	cbits[2] = de_getbyte(pos+2);
	de_dbg(c, "bits/component: %d,%d,%d", (int)cbits[0], (int)cbits[1], (int)cbits[2]);

	t[0] = de_getbyte(pos+4);
	t[1] = de_getbyte(pos+5);
	t[2] = de_getbyte(pos+6);
	t[3] = de_getbyte(pos+7);
	de_dbg(c, "transparentColor: (%d,%d,%d,idx=%d)", (int)t[1], (int)t[2],
		(int)t[3], (int)t[0]);
	if(pg->has_trns) {
		// The format of this field (RGBColorType) is not the same as that of
		// the actual pixels, and I can't find documentation that says how the
		// mapping is done.
		// This appears to work (though it's quick & dirty, and only supports
		// RGB565).
		pg->trns_value =
			((((u32)t[1])&0xf8)<<8) |
			((((u32)t[2])&0xfc)<<3) |
			((((u32)t[3])&0xf8)>>3);
	}
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc33cd(%rip), %rsi     # 0x1c0d06
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movb %al, -0x23(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x22(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x23(%rbp), %edx
movzbl -0x22(%rbp), %ecx
movzbl -0x21(%rbp), %r8d
leaq 0xc3381(%rip), %rsi     # 0x1c0d2b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165060
movb %al, -0x27(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x5, %rsi
callq 0x165060
movb %al, -0x26(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x6, %rsi
callq 0x165060
movb %al, -0x25(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x7, %rsi
callq 0x165060
movb %al, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x26(%rbp), %edx
movzbl -0x25(%rbp), %ecx
movzbl -0x24(%rbp), %r8d
movzbl -0x27(%rbp), %r9d
leaq 0xc3316(%rip), %rsi     # 0x1c0d44
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0xfda6f
movzbl -0x26(%rbp), %ecx
andl $0xf8, %ecx
shll $0x8, %ecx
movzbl -0x25(%rbp), %eax
andl $0xfc, %eax
shll $0x3, %eax
orl %eax, %ecx
movzbl -0x24(%rbp), %eax
andl $0xf8, %eax
shrl $0x3, %eax
orl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: do_generate_image
static void do_generate_image(deark *c, lctx *d, struct page_ctx *pg,
	dbuf *inf, i64 pos, i64 len)
{
	dbuf *unc_pixels = NULL;

	pg->expected_num_uncmpr_image_bytes = pg->rowbytes*pg->h;

	if(pg->cmpr_type==PCMPR_NONE) {
		if(pg->expected_num_uncmpr_image_bytes > len) {
			de_err(c, "Not enough data for image");
			goto done;
		}
		unc_pixels = dbuf_open_input_subfile(inf, pos, len);
	}
	else {
		i64 cmpr_len;
		i64 hdr_len;

		if(pg->bitmapversion >= 3) {
			hdr_len = 4;
			cmpr_len = dbuf_getu32x(inf, pos, d->is_le);
		}
		else {
			hdr_len = 2;
			cmpr_len = dbuf_getu16x(inf, pos, d->is_le);
		}
		de_dbg(c, "cmpr len: %d", (int)cmpr_len); // Note - We don't trust this field

		// Account for the size of the cmpr_len field.
		pos += hdr_len;
		len -= hdr_len;
		if(len<0) goto done;

		unc_pixels = dbuf_create_membuf(c, pg->expected_num_uncmpr_image_bytes, 1);

		if(!de_decompress_image(c, d, pg, inf, pos, len, unc_pixels)) {
			goto done;
		}
	}

	do_generate_img_from_unc_pixels(c, d, pg, unc_pixels);

done:
	dbuf_close(unc_pixels);
}

// 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 %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
imulq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x38(%rax)
jne 0xfdb1a
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpq -0x30(%rbp), %rax
jle 0xfdb00
movq -0x8(%rbp), %rdi
leaq 0xc3274(%rip), %rsi     # 0x1c0d68
movb $0x0, %al
callq 0x15bfb0
jmp 0xfdc00
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x1691b0
movq %rax, -0x38(%rbp)
jmp 0xfdbeb
movq -0x18(%rbp), %rax
movzbl 0x2c(%rax), %eax
cmpl $0x3, %eax
jl 0xfdb48
movq $0x4, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
callq 0x1658c0
movq %rax, -0x40(%rbp)
jmp 0xfdb67
movq $0x2, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
callq 0x165820
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0xc320a(%rip), %rsi     # 0x1c0d82
movb $0x0, %al
callq 0x15b0d0
movq -0x48(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jge 0xfdba3
jmp 0xfdc00
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
movl $0x1, %edx
callq 0x168020
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x38(%rbp), %rax
movq %rax, (%rsp)
callq 0xfdc10
cmpl $0x0, %eax
jne 0xfdbe9
jmp 0xfdc00
jmp 0xfdbeb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0xfde40
movq -0x38(%rbp), %rdi
callq 0x1676a0
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: do_decompress_rle_compression
static void do_decompress_rle_compression(deark *c, struct de_dfilter_in_params *dcmpri,
	struct de_dfilter_out_params *dcmpro, struct de_dfilter_results *dres)
{
	i64 srcpos = dcmpri->pos;
	i64 nbytes_written = 0;

	while(srcpos <= (dcmpri->pos + dcmpri->len - 2)) {
		i64 count;
		u8 val;

		if(nbytes_written > dcmpro->expected_len) goto done;
		count = (i64)dbuf_getbyte_p(dcmpri->f, &srcpos);
		val = dbuf_getbyte_p(dcmpri->f, &srcpos);
		dbuf_write_run(dcmpro->f, val, count);
		nbytes_written += count;
	}
done:
	dres->bytes_consumed = srcpos - dcmpri->pos;
	dres->bytes_consumed_valid = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
addq 0x10(%rdx), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
jg 0xfe3d7
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0xfe389
jmp 0xfe3d9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movb -0x39(%rbp), %al
movq -0x38(%rbp), %rdx
movzbl %al, %esi
callq 0x168800
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xfe35c
jmp 0xfe3d9
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
subq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movb $0x1, 0x4(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: make_stdpal256
static void make_stdpal256(deark *c, lctx *d, u32 *stdpal)
{
	unsigned int k;
	static const u32 supplpal[15] = {0x111111,
		0x222222,0x444444,0x555555,0x777777,0x888888,0xaaaaaa,0xbbbbbb,0xdddddd,
		0xeeeeee,0xc0c0c0,0x800000,0x800080,0x008000,0x008080};
	static u8 vals[6] = {0xff, 0xcc, 0x99, 0x66, 0x33, 0x00};

	for(k=0; k<215; k++) {
		u8 r, g, b;
		r = vals[(k%108)/18];
		g = vals[k%6];
		b = vals[(k/108)*3 + (k%18)/6];
		stdpal[k] = DE_MAKE_RGB(r, g, b);
	}
	for(k=215; k<230; k++) {
		stdpal[k] = DE_MAKE_OPAQUE(supplpal[k-215]);
	}
	for(k=230; k<256; k++) {
		stdpal[k] = DE_STOCKCOLOR_BLACK;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xd7, -0x1c(%rbp)
jae 0xfe4de
movl -0x1c(%rbp), %eax
movl $0x6c, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, %eax
movl $0x12, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %eax
movl %eax, %ecx
leaq 0x127412(%rip), %rax    # 0x225858
movb (%rax,%rcx), %al
movb %al, -0x1d(%rbp)
movl -0x1c(%rbp), %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, %eax
movl %eax, %ecx
leaq 0x1273f5(%rip), %rax    # 0x225858
movb (%rax,%rcx), %al
movb %al, -0x1e(%rbp)
movl -0x1c(%rbp), %eax
movl $0x6c, %ecx
xorl %edx, %edx
divl %ecx
imull $0x3, %eax, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl $0x12, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movl -0x24(%rbp), %eax
addl %ecx, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1273b4(%rip), %rax    # 0x225858
movb (%rax,%rcx), %al
movb %al, -0x1f(%rbp)
movzbl -0x1d(%rbp), %edx
shll $0x10, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movzbl -0x1e(%rbp), %eax
shll $0x8, %eax
orl %eax, %edx
movzbl -0x1f(%rbp), %eax
orl %eax, %edx
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xfe417
movl $0xd7, -0x1c(%rbp)
cmpl $0xe6, -0x1c(%rbp)
jae 0xfe51f
movl -0x1c(%rbp), %eax
subl $0xd7, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0xc237f(%rip), %rax     # 0x1c0880
movl (%rax,%rcx,4), %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xfe4e5
movl $0xe6, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jae 0xfe548
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl $0xff000000, (%rax,%rcx,4) # imm = 0xFF000000
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xfe526
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmbitmap.c
// Function: de_identify_palmbitmap_internal
static int de_identify_palmbitmap_internal(deark *c, dbuf *f, i64 pos, i64 len)
{
	i64 w, h;
	i64 rowbytes;
	u8 ver;
	u8 pixelsize;

	pixelsize = de_getbyte(pos+8);
	if(pixelsize==0xff) {
		pos += 16;
	}

	ver = de_getbyte(pos+9);
	if(ver>3) return 0;
	w = dbuf_getu16be(f, pos+0);
	h = dbuf_getu16be(f, pos+2);
	if(w==0 || h==0) return 0;
	rowbytes = dbuf_getu16be(f, pos+4);
	pixelsize = de_getbyte(pos+8);
	if((pixelsize==0 && ver==0) || pixelsize==1 || pixelsize==2 ||
		pixelsize==4 || pixelsize==8 || pixelsize==16)
	{
		;
	}
	else {
		return 0;
	}
	if(rowbytes==0 || (rowbytes&0x1)) return 0;
	// TODO: Make sure rowbytes is sensible
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x165060
movb %al, -0x42(%rbp)
movzbl -0x42(%rbp), %eax
cmpl $0xff, %eax
jne 0xfe597
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x9, %rsi
callq 0x165060
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x3, %eax
jle 0xfe5c4
movl $0x0, -0x4(%rbp)
jmp 0xfe6a4
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x0, %rsi
callq 0x1651d0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x1651d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xfe5fc
cmpq $0x0, -0x38(%rbp)
jne 0xfe608
movl $0x0, -0x4(%rbp)
jmp 0xfe6a4
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x1651d0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x165060
movb %al, -0x42(%rbp)
movzbl -0x42(%rbp), %eax
cmpl $0x0, %eax
jne 0xfe647
movzbl -0x41(%rbp), %eax
cmpl $0x0, %eax
je 0xfe674
movzbl -0x42(%rbp), %eax
cmpl $0x1, %eax
je 0xfe674
movzbl -0x42(%rbp), %eax
cmpl $0x2, %eax
je 0xfe674
movzbl -0x42(%rbp), %eax
cmpl $0x4, %eax
je 0xfe674
movzbl -0x42(%rbp), %eax
cmpl $0x8, %eax
je 0xfe674
movzbl -0x42(%rbp), %eax
cmpl $0x10, %eax
jne 0xfe676
jmp 0xfe67f
movl $0x0, -0x4(%rbp)
jmp 0xfe6a4
cmpq $0x0, -0x40(%rbp)
je 0xfe694
movq -0x40(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xfe69d
movl $0x0, -0x4(%rbp)
jmp 0xfe6a4
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: de_module_palmdb
void de_module_palmdb(deark *c, struct deark_module_info *mi)
{
	mi->id = "palmdb";
	mi->id_alias[0] = "palmrc";
	mi->desc = "Palm OS PDB or PRC";
	mi->run_fn = de_run_pdb_or_prc;
	mi->identify_fn = de_identify_pdb_prc;
	mi->help_fn = de_help_pdb_prc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xc2736(%rip), %rcx     # 0x1c0dfd
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xc272f(%rip), %rcx     # 0x1c0e04
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
leaq 0xc2727(%rip), %rcx     # 0x1c0e0b
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2d(%rip), %rcx        # 0xfe720
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x12e(%rip), %rcx       # 0xfe830
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x4ef(%rip), %rcx       # 0xfec00
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: de_run_pdb_or_prc
static void de_run_pdb_or_prc(deark *c, de_module_params *mparams)
{
	const char *s;
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	s = de_get_ext_option(c, "palm:timestampfmt");
	if(s) {
		if(!de_strcmp(s, "macbe"))
			d->timestampfmt = TIMESTAMPFMT_MACBE;
		else if(!de_strcmp(s, "unixbe"))
			d->timestampfmt = TIMESTAMPFMT_UNIXBE;
		else if(!de_strcmp(s, "macle"))
			d->timestampfmt = TIMESTAMPFMT_MACLE;
	}

	if(!do_read_pdb_prc_header(c, d)) goto done;
	if(!do_read_pdb_prc_records(c, d, 72)) goto done;
	do_app_info_block(c, d);
	do_sort_info_block(c, d);
done:
	free_lctx(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0xc8, %esi
callq 0x15b780
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xc26c9(%rip), %rsi     # 0x1c0e1e
callq 0x15cb30
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xfe7cf
movq -0x18(%rbp), %rdi
leaq 0xc26c0(%rip), %rsi     # 0x1c0e30
callq 0x191a0
cmpl $0x0, %eax
jne 0xfe787
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0xfe7cd
movq -0x18(%rbp), %rdi
leaq 0xc26a4(%rip), %rsi     # 0x1c0e36
callq 0x191a0
cmpl $0x0, %eax
jne 0xfe7a9
movq -0x20(%rbp), %rax
movl $0x2, 0x8(%rax)
jmp 0xfe7cb
movq -0x18(%rbp), %rdi
leaq 0xc2689(%rip), %rsi     # 0x1c0e3d
callq 0x191a0
cmpl $0x0, %eax
jne 0xfe7c9
movq -0x20(%rbp), %rax
movl $0x3, 0x8(%rax)
jmp 0xfe7cb
jmp 0xfe7cd
jmp 0xfe7cf
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xfec30
cmpl $0x0, %eax
jne 0xfe7e3
jmp 0xfe816
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x48, %edx
callq 0xff060
cmpl $0x0, %eax
jne 0xfe7fc
jmp 0xfe816
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xff270
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xff3d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xff4e0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_app_info_block
static void do_app_info_block(deark *c, lctx *d)
{
	i64 len;

	if(d->appinfo_offs==0) return;
	de_dbg(c, "app info block at %d", (int)d->appinfo_offs);

	de_dbg_indent(c, 1);
	if(d->sortinfo_offs) {
		len = d->sortinfo_offs - d->appinfo_offs;
	}
	else if(d->rec_list.num_recs>0) {
		len = (i64)d->rec_list.rec_data[0].offset - d->appinfo_offs;
	}
	else {
		len = c->infile->len - d->appinfo_offs;
	}
	de_dbg(c, "calculated len: %d", (int)len);

	if(len>0) {
		// TODO: In many cases, this can be parsed as a format called "standard
		// category data". But I don't know how to tell whether it is in that
		// format.
		extract_item(c, d, d->appinfo_offs, len, "appinfo.bin", NULL, DE_CREATEFLAG_IS_AUX, 0);

		if(d->file_subfmt==SUBFMT_PQA) {
			do_pqa_app_info_block(c, d, d->appinfo_offs, len);
		}
	}

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0xff293
jmp 0xff3c1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rax
movl %eax, %edx
leaq 0xc2080(%rip), %rsi     # 0x1c132b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
je 0xff2ea
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x90(%rcx), %rax
movq %rax, -0x18(%rbp)
jmp 0xff333
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
jle 0xff316
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
subq 0x90(%rcx), %rax
movq %rax, -0x18(%rbp)
jmp 0xff331
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x90(%rcx), %rax
movq %rax, -0x18(%rbp)
jmp 0xff333
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0xc1e0e(%rip), %rsi     # 0x1c1152
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x18(%rbp)
jle 0xff3b3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdx
movq -0x18(%rbp), %rcx
leaq 0xc1fd0(%rip), %r8      # 0x1c1340
xorl %eax, %eax
movl %eax, %r9d
xorl %eax, %eax
movl $0x1, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x100500
movq -0x10(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0xff3b1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdx
movq -0x18(%rbp), %rcx
callq 0x100fa0
jmp 0xff3b3
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_sort_info_block
static void do_sort_info_block(deark *c, lctx *d)
{
	i64 len;

	if(d->sortinfo_offs==0) return;
	de_dbg(c, "sort info block at %d", (int)d->sortinfo_offs);

	de_dbg_indent(c, 1);
	if(d->rec_list.num_recs>0) {
		len = (i64)d->rec_list.rec_data[0].offset - d->sortinfo_offs;
	}
	else {
		len = c->infile->len - d->sortinfo_offs;
	}
	de_dbg(c, "calculated len: %d", (int)len);

	if(len>0) {
		extract_item(c, d, d->sortinfo_offs, len, "sortinfo.bin", NULL, DE_CREATEFLAG_IS_AUX, 0);
	}

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jne 0xff3f3
jmp 0xff4cd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movl %eax, %edx
leaq 0xc1fa6(%rip), %rsi     # 0x1c13b1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
jle 0xff44c
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
subq 0x98(%rcx), %rax
movq %rax, -0x18(%rbp)
jmp 0xff467
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x98(%rcx), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0xc1cda(%rip), %rsi     # 0x1c1152
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x18(%rbp)
jle 0xff4bf
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdx
movq -0x18(%rbp), %rcx
leaq 0xc1f23(%rip), %r8      # 0x1c13c7
xorl %eax, %eax
movl %eax, %r9d
xorl %eax, %eax
movl $0x1, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x100500
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: free_lctx
static void free_lctx(deark *c, lctx *d)
{
	if(d) {
		de_free(c, d->rec_list.rec_data);
		de_free(c, d->rec_list.order_to_read);
		ucstring_destroy(d->icon_name);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xff53c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
callq 0x171750
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: get_db_attr_descr
static void get_db_attr_descr(de_ucstring *s, u32 attribs)
{
	size_t i;
	struct { u32 a; const char *n; } flags_arr[] = {
		{0x0001, "dmHdrAttrResDB"},
		{0x0002, "dmHdrAttrReadOnly"},
		{0x0004, "dmHdrAttrAppInfoDirty"},
		{0x0008, "dmHdrAttrBackup"},
		{0x0010, "dmHdrAttrOKToInstallNewer"},
		{0x0020, "dmHdrAttrResetAfterInstall"},
		{0x0040, "dmHdrAttrCopyPrevention"},
		{0x0080, "dmHdrAttrStream"},
		{0x0100, "dmHdrAttrHidden"},
		{0x0200, "dmHdrAttrLaunchableData"},
		{0x0400, "dmHdrAttrRecyclable"},
		{0x0800, "dmHdrAttrBundle"},
		{0x8000, "dmHdrAttrOpen"}
	};
	for(i=0; i<DE_ARRAYCOUNT(flags_arr); i++) {
		if(attribs & flags_arr[i].a)
			ucstring_append_flags_item(s, flags_arr[i].n);

	}
	if(attribs==0) ucstring_append_flags_item(s, "none");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0xf0(%rbp), %rdi
leaq 0x11cb40(%rip), %rsi    # 0x21c0b0
movl $0xd0, %edx
callq 0x191e0
movq $0x0, -0x18(%rbp)
cmpq $0xd, -0x18(%rbp)
jae 0xff5d4
movl -0xc(%rbp), %eax
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
shlq $0x4, %rdx
addq %rdx, %rcx
andl (%rcx), %eax
cmpl $0x0, %eax
je 0xff5c4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
leaq -0xf0(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x172680
jmp 0xff5c6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xff582
cmpl $0x0, -0xc(%rbp)
jne 0xff5ea
movq -0x8(%rbp), %rdi
leaq 0x9d128(%rip), %rsi     # 0x19c70d
callq 0x172680
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: timestamp_is_plausible
static int timestamp_is_plausible(struct de_timestamp *ts)
{
	i64 ts_unix;

	if(!ts->is_valid) return 0;
	ts_unix = de_timestamp_to_unix_time(ts);
	// I assume PDB/PRC format wasn't in use until 1996 or a little before, when
	// Palm OS was released.
	// But it's not necessarily safe to assume all timestamps older than that
	// are wrong -- an older file could have been converted to this format.
	// For now at least, I'll arbitrarily draw the line at 1985.
	if(ts_unix < 473385600) return 0; // = 01 Jan 1985
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xff86e
movl $0x0, -0x4(%rbp)
jmp 0xff895
movq -0x10(%rbp), %rdi
callq 0x15dd00
movq %rax, -0x18(%rbp)
cmpq $0x1c374a80, -0x18(%rbp) # imm = 0x1C374A80
jge 0xff88e
movl $0x0, -0x4(%rbp)
jmp 0xff895
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: rec_list_insert_at_start
static void rec_list_insert_at_start(struct rec_list_struct *rl, i64 idx)
{
	i64 i;
	// Move [idx-1] to [idx],
	//      [idx-2] to [idx-1], ...
	for(i=idx; i>0; i--) {
		rl->order_to_read[i] = rl->order_to_read[i-1];
	}
	// Put idx at [0]
	rl->order_to_read[0] = (size_t)idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jle 0x1002dd
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1002a4
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
popq %rbp
retq
nop