// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame
static void decode_id3v2_frame(deark *c, id3v2ctx *d, dbuf *f,
	i64 pos1, i64 len,
	struct de_fourcc *tag4cc, unsigned int flags1, unsigned int flags2)
{
	u8 frame_level_unsynch = d->global_frame_level_unsync;
	dbuf *unescaped_frame = NULL;

	if(d->version_code==3) {
		if(flags2&0x80) { // 'i'
			de_dbg(c, "[compressed frame not supported]");
			goto done;
		}
		if(flags2&0x40) { // 'j'
			de_dbg(c, "[encrypted frame not supported]");
			goto done;
		}
		if(flags2&0x20) { // 'k'
			de_dbg(c, "[grouped frame not supported]");
			goto done;
		}
	}
	if(d->version_code==4) {
		if(flags2&0x40) { // 'h'
			de_dbg(c, "[grouped frame not supported]");
			goto done;
		}
		if(flags2&0x08) { // 'k'
			de_dbg(c, "[compressed frame not supported]");
			goto done;
		}
		if(flags2&0x04) { // 'm'
			de_dbg(c, "[encrypted frame not supported]");
			goto done;
		}
		if(flags2&0x02) { // 'n'
			// If the global 'unsynch' flag is set, but a frame's local flag
			// is not, evidence suggests the global flag has priority.
			// So if this flag makes a change, it will only be 0->1, never 1->0.
			frame_level_unsynch = 1;
		}
		if(flags2&0x01) { // 'p';
			de_dbg(c, "[frame with data-length-indicator not supported]");
			goto done;
		}
	}

	if(frame_level_unsynch) {
		unescaped_frame = dbuf_create_membuf(c, 0, 0);
		unescape_id3v2_data(c, f, pos1, len, unescaped_frame);
		decode_id3v2_frame_internal(c, d, unescaped_frame, 0, unescaped_frame->len, tag4cc);
	}
	else {
		decode_id3v2_frame_internal(c, d, f, pos1, len, tag4cc);
	}

done:
	dbuf_close(unescaped_frame);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
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 -0x10(%rbp), %rax
movb 0x33(%rax), %al
movb %al, -0x31(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x30(%rax), %eax
cmpl $0x3, %eax
jne 0xaa0ff
movl 0x18(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xaa0b9
movq -0x8(%rbp), %rdi
leaq 0x109574(%rip), %rsi    # 0x1b3621
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
movl 0x18(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xaa0db
movq -0x8(%rbp), %rdi
leaq 0x109573(%rip), %rsi    # 0x1b3642
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
movl 0x18(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xaa0fd
movq -0x8(%rbp), %rdi
leaq 0x109571(%rip), %rsi    # 0x1b3662
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
jmp 0xaa0ff
movq -0x10(%rbp), %rax
movzbl 0x30(%rax), %eax
cmpl $0x4, %eax
jne 0xaa1a6
movl 0x18(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xaa132
movq -0x8(%rbp), %rdi
leaq 0x10953c(%rip), %rsi    # 0x1b3662
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
movl 0x18(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xaa154
movq -0x8(%rbp), %rdi
leaq 0x1094d9(%rip), %rsi    # 0x1b3621
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
movl 0x18(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xaa176
movq -0x8(%rbp), %rdi
leaq 0x1094d8(%rip), %rsi    # 0x1b3642
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
movl 0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xaa185
movb $0x1, -0x31(%rbp)
movl 0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xaa1a4
movq -0x8(%rbp), %rdi
leaq 0x1094e5(%rip), %rsi    # 0x1b3680
movb $0x0, %al
callq 0x15b0d0
jmp 0xaa21a
jmp 0xaa1a6
cmpb $0x0, -0x31(%rbp)
je 0xaa1fb
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %r8
callq 0xa9ae0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0x18(%rax), %r8
movq -0x30(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
callq 0xaa230
jmp 0xaa218
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0xaa230
jmp 0xaa21a
movq -0x40(%rbp), %rdi
callq 0x1676a0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)