// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/flac.c
// Function: run_flac_internal
static void run_flac_internal(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;
	int saved_indent_level;

	de_dbg(c, "signature at %"I64_FMT, pos);
	pos += 4;

	de_dbg_indent_save(c, &saved_indent_level);
	while(1) {
		u8 b;
		i64 blklen;
		u8 blktype;
		const char *blkname;
		u8 is_last;

		if(pos >= pos1+len) goto done;
		de_dbg(c, "metadata block at %"I64_FMT, pos);
		de_dbg_indent(c, 1);
		b = de_getbyte_p(&pos);
		is_last = (b&0x80)!=0;
		de_dbg(c, "is-last: %u", (unsigned int)is_last);
		blktype = (b&0x7f);
		blkname = get_mdblk_name(blktype);
		de_dbg(c, "block type: %u (%s)", (unsigned int)blktype, blkname);
		blklen = dbuf_getint_ext(c->infile, pos, 3, 0, 0);
		pos += 3;
		de_dbg(c, "block len: %u", (unsigned int)blklen);
		do_metadata_block(c, d, blktype, pos, blklen);
		pos += blklen;
		de_dbg_indent(c, -1);
		if(is_last) break;
	}

	de_dbg(c, "frames start at %"I64_FMT, pos);

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
movq -0x28(%rbp), %rdx
leaq 0x150251(%rip), %rsi    # 0x1d5f80
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x15b580
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jl 0x85d65
jmp 0x85e97
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x128a0d(%rip), %rsi    # 0x1ae781
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movb %al, -0x2d(%rbp)
movzbl -0x2d(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x49(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x49(%rbp), %edx
leaq 0x1289d4(%rip), %rsi    # 0x1ae797
movb $0x0, %al
callq 0x15b0d0
movzbl -0x2d(%rbp), %eax
andl $0x7f, %eax
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %edi
callq 0x85eb0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x39(%rbp), %edx
movq -0x48(%rbp), %rcx
leaq 0x1289af(%rip), %rsi    # 0x1ae7a3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movl $0x3, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x165a80
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x12897f(%rip), %rsi    # 0x1ae7b7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x39(%rbp), %al
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %r8
movzbl %al, %edx
callq 0x85f70
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpb $0x0, -0x49(%rbp)
je 0x85e7c
jmp 0x85e81
jmp 0x85d4f
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x128935(%rip), %rsi    # 0x1ae7c5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x15b5a0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)