// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame_comm
static void decode_id3v2_frame_comm(deark *c, id3v2ctx *d,
	dbuf *f, i64 pos1, i64 len)
{
	u8 id3_encoding;
	i64 pos = pos1;
	de_ucstring *lang = NULL;
	de_ucstring *shortdesc = NULL;
	de_ucstring *comment_text = NULL;
	i64 bytes_consumed;
	int ret;

	id3_encoding = dbuf_getbyte(f, pos++);
	de_dbg(c, "text encoding: %d (%s)", (int)id3_encoding,
		get_id3v2_textenc_name(d, id3_encoding));

	lang = ucstring_create(c);
	dbuf_read_to_ucstring(f, pos, 3, lang, 0, DE_ENCODING_ASCII);
	de_dbg(c, "language: \"%s\"", ucstring_getpsz(lang));
	pos += 3;

	shortdesc = ucstring_create(c);
	bytes_consumed = 0;
	ret = read_id3v2_terminated_string(c, d, f, pos, pos1+len-pos, 256, id3_encoding,
		shortdesc, &bytes_consumed);
	if(!ret) goto done;
	de_dbg(c, "short description: \"%s\"", ucstring_getpsz(shortdesc));
	pos += bytes_consumed;

	comment_text = ucstring_create(c);
	id3v2_read_to_ucstring(c, f, pos, pos1+len-pos, comment_text, id3_encoding);
	de_dbg(c, "comment: \"%s\"", ucstring_getpsz(comment_text));

done:
	ucstring_destroy(lang);
	ucstring_destroy(shortdesc);
	ucstring_destroy(comment_text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1(%rcx), %r12
movq %rdx, %r13
movq %rdx, %rdi
movq %rcx, 0x18(%rsp)
movq %rcx, %rsi
callq 0xef0d5
movzbl %al, %r14d
cmpb $0x3, %r14b
ja 0x76175
leaq 0xb159a(%rip), %rax     # 0x1276c4
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xb1bba(%rip), %rcx     # 0x127cf4
jmp 0x7617c
leaq 0xb1bdb(%rip), %rcx     # 0x127d1e
jmp 0x7617c
leaq 0xadf8d(%rip), %rcx     # 0x1240d9
jmp 0x7617c
movb 0x30(%r15), %al
cmpb $0x3, %al
leaq 0xb1baa(%rip), %rcx     # 0x127d05
leaq 0xb1baf(%rip), %rsi     # 0x127d11
cmoveq %rcx, %rsi
cmpb $0x2, %al
leaq 0xb1b90(%rip), %rcx     # 0x127cff
cmovneq %rsi, %rcx
jmp 0x7617c
leaq 0xb5ced(%rip), %rcx     # 0x12be69
leaq 0xb1b56(%rip), %rsi     # 0x127cd9
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r15
movl $0x3, %edx
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf01b0
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0xf74bd
leaq 0xb1b64(%rip), %rsi     # 0x127d2f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rsp), %r12
leaq 0x4(%r12), %r15
movq %rbx, %rdi
callq 0xf6870
leaq 0x20(%rsp), %rdx
movq $0x0, (%rdx)
leaq -0x4(%rbp), %rcx
movq %rdx, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, 0x8(%rsp)
movl %r14d, %r8d
movq %rax, %r14
movq %rax, %r9
callq 0x769ce
testl %eax, %eax
je 0x76287
addq %r12, %rbp
movq %r14, %rdi
callq 0xf74bd
leaq 0xb1b0e(%rip), %rsi     # 0x127d3e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq 0x20(%rsp), %r15
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r12
subq %r15, %rbp
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %rax, %r8
movq 0x8(%rsp), %r9
callq 0x76a8c
movq %r12, %rdi
callq 0xf74bd
leaq 0x9e52d(%rip), %rsi     # 0x1147a5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
jmp 0x7628a
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
callq 0xf6bb0
movq %r14, %rdi
callq 0xf6bb0
movq %r12, %rdi
callq 0xf6bb0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq