// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/mp3.c
// Function: de_run_mpegaudio
static void de_run_mpegaudio(deark *c, de_module_params *mparams)
{
	mp3ctx *d = NULL;
	i64 pos;
	i64 endpos;
	i64 ape_tag_len;
	struct de_id3info id3i;

	d = de_malloc(c, sizeof(mp3ctx));

	fmtutil_handle_id3(c, c->infile, &id3i, 0);
	d->has_id3v2 = id3i.has_id3v2;
	pos = id3i.main_start;
	endpos = id3i.main_end;

	if(!id3i.has_id3v2) {
		if(!dbuf_memcmp(c->infile, endpos-10, "3DI", 3)) {
			de_warn(c, "Possible ID3v2 tag found at end of file (footer at %"I64_FMT"). "
				"This is not supported.", endpos-10);
		}
	}

	do_ape_tag_if_exists(c, endpos, &ape_tag_len);
	endpos -= ape_tag_len;

	do_mp3_data(c, d, pos, endpos-pos);

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
pushq $0x34
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq 0x18(%rbx), %rsi
leaq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xed79a
movl 0x4(%r15), %eax
movl %eax, (%r14)
movq 0x8(%r15), %r12
movq 0x10(%r15), %r13
testl %eax, %eax
jne 0x92f11
movq 0x18(%rbx), %rdi
leaq -0xa(%r13), %r15
leaq 0x90a61(%rip), %rdx     # 0x12394f
pushq $0x3
popq %rcx
movq %r15, %rsi
callq 0xe4d48
testl %eax, %eax
jne 0x92f11
leaq 0x90a4f(%rip), %rsi     # 0x123953
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xdf05a
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
leaq -0x20(%r13), %rsi
movq 0x18(%rbx), %rdi
callq 0x93689
testl %eax, %eax
je 0x92f92
leaq 0x90a6d(%rip), %rsi     # 0x1239a3
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
pushq $0x70
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r15
movq 0x18(%rbx), %rcx
leaq 0x90885(%rip), %rsi     # 0x1237ee
movq %rbx, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
movq %r13, %r9
callq 0xdf9b8
testb $0x1, 0x40(%r15)
je 0x92f97
movq 0x58(%r15), %rbp
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
jmp 0x92f97
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xded32
movl 0x10(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq %r12, %rbp
subq %rbp, %r13
leaq 0x90a05(%rip), %rsi     # 0x1239c0
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe404f
movq %rax, %r15
pushq $0x1
popq %rbp
cmpl $0xffdfffff, %r15d      # imm = 0xFFDFFFFF
ja 0x930ec
leaq 0x909d4(%rip), %rsi     # 0x1239dd
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdf37f
cmpl $0x0, 0x30(%r14)
jne 0x9303a
cmpl $0x1, 0x24(%rbx)
jne 0x9303a
cmpl $0x0, (%r14)
je 0x9303a
leaq 0x909f5(%rip), %rsi     # 0x123a25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf05a
movl $0x10000, %r15d         # imm = 0x10000
cmpq %r15, %r13
cmovlq %r13, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdecaf
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq %rax, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xe3cb7
cmpq $0x2, %r15
cmovlq %rbp, %r15
decq %r15
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x9308e
cmpb $-0x1, (%r13,%rbp)
jne 0x93089
cmpb $-0x21, 0x1(%r13,%rbp)
ja 0x93099
incq %rbp
jmp 0x93074
movq $0x0, 0x8(%rsp)
jmp 0x9309e
movq %rbp, 0x8(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xded32
cmpq %rbp, %r15
jne 0x930c4
leaq 0x909c0(%rip), %rsi     # 0x123a75
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x933d0
addq 0x8(%rsp), %r12
leaq 0x909c4(%rip), %rsi     # 0x123a94
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdf37f
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe404f
movq %rax, %r15
leaq 0x909cf(%rip), %rsi     # 0x123ac2
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
leaq 0x909bb(%rip), %rsi     # 0x123acf
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
movl %r15d, %edx
shrl $0x13, %edx
andl $0x3, %edx
movl %edx, 0x4(%r14)
leaq 0x90c31(%rip), %rax     # 0x123d70
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x90997(%rip), %rsi     # 0x123ae4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r15d, %edx
shrl $0x11, %edx
andl $0x3, %edx
movl %edx, 0x8(%r14)
leaq 0x90c31(%rip), %rax     # 0x123d9c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x90985(%rip), %rsi     # 0x123afe
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
cmpl $0x0, 0x30(%r14)
jne 0x931ad
movl 0x8(%r14), %eax
decl %eax
cmpl $0x2, %eax
ja 0x931ad
movl %eax, %eax
leaq 0x90be2(%rip), %rcx     # 0x123d80
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0xe07f7
movl %r15d, %edx
shrl $0x10, %edx
andl $0x1, %edx
movl %edx, 0xc(%r14)
leaq 0x90970(%rip), %rsi     # 0x123b31
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r15d, %ebp
shrl $0xc, %ebp
andl $0xf, %ebp
movl %ebp, 0x10(%r14)
movl 0x4(%r14), %ecx
movl 0x8(%r14), %eax
cmpl $0x3, %ecx
jne 0x931f6
decl %eax
cmpl $0x3, %eax
jae 0x93241
movl %eax, %ecx
pushq $0x2
popq %rax
subq %rcx, %rax
jmp 0x93211
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jne 0x93241
cmpl $0x3, %eax
jne 0x93207
pushq $0x3
jmp 0x93210
decl %eax
cmpl $0x2, %eax
jae 0x93241
pushq $0x4
popq %rax
shlq $0x5, %rax
leaq 0x90a74(%rip), %rcx     # 0x123c90
addq %rax, %rcx
movl %ebp, %eax
movzwl (%rcx,%rax,2), %ecx
testl %ecx, %ecx
je 0x93241
leaq 0x909eb(%rip), %rdx     # 0x123c1b
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
xorl %eax, %eax
callq 0xde40c
jmp 0x93255
leaq 0x8bc99(%rip), %rsi     # 0x11eee1
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0xde492
leaq 0x908e1(%rip), %rsi     # 0x123b3d
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movl %r15d, %ebp
shrl $0xa, %ebp
andl $0x3, %ebp
movl %ebp, 0x14(%r14)
movl 0x8(%r14), %eax
addl $-0x4, %eax
cmpl $-0x3, %eax
jb 0x932d1
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x932a0
cmpl $0x3, %eax
je 0x9329c
cmpl $0x2, %eax
jne 0x932d1
pushq $0x1
jmp 0x932a2
xorl %ecx, %ecx
jmp 0x932a3
pushq $0x2
popq %rcx
shll $0x4, %ecx
leaq 0x90a83(%rip), %rax     # 0x123d30
addq %rcx, %rax
movl %ebp, %ecx
movl (%rax,%rcx,4), %ecx
testl %ecx, %ecx
je 0x932d1
leaq 0x90963(%rip), %rdx     # 0x123c23
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
xorl %eax, %eax
callq 0xde40c
jmp 0x932e5
leaq 0x8bc09(%rip), %rsi     # 0x11eee1
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0xde492
leaq 0x90865(%rip), %rsi     # 0x123b51
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movl %r15d, %edx
shrl $0x9, %edx
andl $0x1, %edx
movl %edx, 0x18(%r14)
leaq 0x90864(%rip), %rsi     # 0x123b75
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r15d, %edx
shrl $0x6, %edx
andl $0x3, %edx
movl %edx, 0x1c(%r14)
leaq 0x90a5d(%rip), %rax     # 0x123d8c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x90848(%rip), %rsi     # 0x123b85
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
cmpl $0x1, 0x1c(%r14)
jne 0x9336c
movl %r15d, %edx
shrl $0x4, %edx
andl $0x3, %edx
movl %edx, 0x20(%r14)
leaq 0x90839(%rip), %rsi     # 0x123b9b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r15d, %eax
shrl $0x3, %eax
andl $0x1, %eax
movl %eax, 0x24(%r14)
movl 0x18(%r14), %edx
leaq 0x9082a(%rip), %rsi     # 0x123bae
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r15d, %eax
shrl $0x2, %eax
andl $0x1, %eax
movl %eax, 0x28(%r14)
movl 0x18(%r14), %edx
leaq 0x9081b(%rip), %rsi     # 0x123bc1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
andl $0x3, %r15d
movl %r15d, 0x2c(%r14)
leaq 0x9081a(%rip), %rsi     # 0x123bd9
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
incl 0x30(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq