// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iso9660.c
// Function: do_dir_rec_SUSP_set
static void do_dir_rec_SUSP_set(deark *c, lctx *d, struct dir_record *dr,
	i64 pos1, i64 len,
	i64 *ca_blk, i64 *ca_offs, i64 *ca_len)
{
	i64 pos = pos1;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "SUSP data at %"I64_FMT", len=%d", pos1, (int)len);
	de_dbg_indent(c, 1);

	while(1) {
		struct de_fourcc sig4cc;
		i64 itempos;
		i64 itemlen, dlen;
		u8 itemver;

		itempos = pos;
		if(itempos+4 > pos1+len) break;
		dbuf_read_fourcc(c->infile, pos, &sig4cc, 2, 0x0);
		pos += 2;
		itemlen = (i64)de_getbyte_p(&pos);
		if(itemlen<4) break;
		dlen = itemlen-4;
		if(itempos+itemlen > pos1+len) break;
		itemver = de_getbyte_p(&pos);
		de_dbg(c, "entry '%s' at %"I64_FMT", len=%d, ver=%u, dlen=%d",
			sig4cc.id_dbgstr, itempos, (int)itemlen, (unsigned int)itemver, (int)dlen);

		de_dbg_indent(c, 1);
		switch(sig4cc.id) {
		case CODE_SP:
			do_SUSP_SP(c, d, dr, itempos, itemlen);
			break;
		case CODE_CE:
			do_SUSP_CE(c, d, dr, itempos, itemlen, ca_blk, ca_offs, ca_len);
			break;
		case CODE_ER:
			do_SUSP_ER(c, d, dr, itempos, itemlen);
			break;
		case CODE_ST:
			goto done;
		case CODE_NM:
			do_SUSP_rockridge_NM(c, d, dr, itempos, itemlen);
			break;
		case CODE_PX:
			do_SUSP_rockridge_PX(c, d, dr, itempos, itemlen);
			break;
		case CODE_TF:
			do_SUSP_rockridge_TF(c, d, dr, itempos, itemlen);
			break;
		case CODE_SF:
			dr->is_specialfileformat = 1; // Sparse file
			break;
		case CODE_ZF: // zisofs
			do_SUSP_ZF(c, d, dr, itempos, itemlen);
			break;
		default:
			if(sig4cc.id==CODE_AA && itemlen==14 && itemver==2) {
				// Apple AA extensions are not SUSP, but I've seen them used
				// as SUSP anyway. They're sufficiently compatible.
				do_Apple_AA_HFS(c, d, dr, itempos, itemlen);
			}
			else if(c->debug_level>=2) {
				de_dbg_hexdump(c, c->infile, pos, itemlen-4, 256, NULL, 0x1);
			}
		}
		pos = itempos+itemlen;
		de_dbg_indent(c, -1);
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
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 -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rax
movl %eax, %ecx
leaq 0xea565(%rip), %rsi     # 0x1b9f1a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jle 0xcf9ec
jmp 0xcfced
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x80(%rbp)
cmpq $0x4, -0x80(%rbp)
jge 0xcfa39
jmp 0xcfced
movq -0x80(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
addq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jle 0xcfa62
jmp 0xcfced
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x89(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x5c(%rbp), %rdx
movq -0x78(%rbp), %rcx
movl -0x80(%rbp), %r8d
movzbl -0x89(%rbp), %r9d
movl -0x88(%rbp), %esi
movq %rsp, %rax
movl %esi, (%rax)
leaq 0xea490(%rip), %rsi     # 0x1b9f33
xorl %eax, %eax
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movl -0x68(%rbp), %eax
movl %eax, -0x90(%rbp)
subl $0x4345, %eax           # imm = 0x4345
je 0xcfb83
jmp 0xcface
movl -0x90(%rbp), %eax
subl $0x4552, %eax           # imm = 0x4552
je 0xcfbb6
jmp 0xcfae1
movl -0x90(%rbp), %eax
subl $0x4e4d, %eax           # imm = 0x4E4D
je 0xcfbd9
jmp 0xcfaf4
movl -0x90(%rbp), %eax
subl $0x5058, %eax           # imm = 0x5058
je 0xcfbf7
jmp 0xcfb07
movl -0x90(%rbp), %eax
subl $0x5346, %eax           # imm = 0x5346
je 0xcfc33
jmp 0xcfb1a
movl -0x90(%rbp), %eax
subl $0x5350, %eax           # imm = 0x5350
je 0xcfb65
jmp 0xcfb29
movl -0x90(%rbp), %eax
subl $0x5354, %eax           # imm = 0x5354
je 0xcfbd4
jmp 0xcfb3c
movl -0x90(%rbp), %eax
subl $0x5446, %eax           # imm = 0x5446
je 0xcfc15
jmp 0xcfb4f
movl -0x90(%rbp), %eax
subl $0x5a46, %eax           # imm = 0x5A46
je 0xcfc40
jmp 0xcfc5b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xcfd10
jmp 0xcfcce
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xcfd90
jmp 0xcfcce
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xcfe80
jmp 0xcfcce
jmp 0xcfcef
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xcfff0
jmp 0xcfcce
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xd00d0
jmp 0xcfcce
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xd01a0
jmp 0xcfcce
movq -0x18(%rbp), %rax
movb $0x1, 0x9(%rax)
jmp 0xcfcce
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xd02f0
jmp 0xcfcce
cmpl $0x4141, -0x68(%rbp)    # imm = 0x4141
jne 0xcfc92
cmpq $0xe, -0x80(%rbp)
jne 0xcfc92
movzbl -0x89(%rbp), %eax
cmpl $0x2, %eax
jne 0xcfc92
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0xcf650
jmp 0xcfccc
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jl 0xcfcca
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x38(%rbp), %rdx
movq -0x80(%rbp), %rcx
subq $0x4, %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, (%rsp)
callq 0x15b840
jmp 0xcfccc
jmp 0xcfcce
movq -0x78(%rbp), %rax
addq -0x80(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
jmp 0xcf9ca
jmp 0xcfcef
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x15b5a0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)