// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/id3.c
// Function: do_id3v1
static void do_id3v1(deark *c, i64 pos1)
{
	i64 pos = pos1;
	de_ucstring *s = NULL;
	u8 genre;

	s = ucstring_create(c);
	pos += 3;

	dbuf_read_to_ucstring(c->infile, pos, 30, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "song title: \"%s\"", ucstring_getpsz(s));
	pos += 30;

	ucstring_empty(s);
	dbuf_read_to_ucstring(c->infile, pos, 30, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "artist: \"%s\"", ucstring_getpsz(s));
	pos += 30;

	ucstring_empty(s);
	dbuf_read_to_ucstring(c->infile, pos, 30, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "album: \"%s\"", ucstring_getpsz(s));
	pos += 30;

	ucstring_empty(s);
	dbuf_read_to_ucstring(c->infile, pos, 4, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	de_dbg(c, "year: \"%s\"", ucstring_getpsz(s));
	pos += 4;

	ucstring_empty(s);
	dbuf_read_to_ucstring(c->infile, pos, 30, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "comment: \"%s\"", ucstring_getpsz(s));
	pos += 28;
	if(de_getbyte(pos)==0) {
		u8 trknum;
		trknum = de_getbyte(pos+1);
		if(trknum!=0) {
			// Looks like ID3v1.1
			de_dbg(c, "track number: %d", (int)trknum);
		}
	}
	pos += 2;

	genre = de_getbyte(pos);
	de_dbg(c, "genre: %d (%s)", (int)genre, get_id3v1_genre_name(genre));

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x1e, %edx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1669f0
movq -0x20(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x10a598(%rip), %rsi    # 0x1b391c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x1e, %edx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1669f0
movq -0x20(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x10a542(%rip), %rsi    # 0x1b392d
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x1e, %edx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1669f0
movq -0x20(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x10a4e8(%rip), %rsi    # 0x1b393a
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x4, %edx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x10a496(%rip), %rsi    # 0x1b3946
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x1e, %edx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1669f0
movq -0x20(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0xf7135(%rip), %rsi     # 0x1a064c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa957c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x22(%rbp)
movzbl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0xa957a
movq -0x8(%rbp), %rdi
movzbl -0x22(%rbp), %edx
leaq 0x10a3de(%rip), %rsi    # 0x1b3951
movb $0x0, %al
callq 0x15b0d0
jmp 0xa957c
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, -0x54(%rbp)
movzbl -0x21(%rbp), %edi
callq 0xab8a0
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %edx
movq %rax, %rcx
leaq 0x10a39d(%rip), %rsi    # 0x1b3962
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171750
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)