// File: /workspace/github_c_makefile_star2_O3/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
movl $0x34, %esi
callq 0xe8b2b
movq %rax, %r14
movq 0x18(%rbx), %rsi
leaq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xf90e4
movl 0x4(%r15), %eax
movl %eax, (%r14)
movq 0x8(%r15), %r12
movq 0x10(%r15), %r13
testl %eax, %eax
jne 0x98751
movq 0x18(%rbx), %rdi
leaq -0xa(%r13), %r15
leaq 0x98506(%rip), %rdx     # 0x130c32
movl $0x3, %ecx
movq %r15, %rsi
callq 0xefc85
testl %eax, %eax
jne 0x98751
leaq 0x984f2(%rip), %rsi     # 0x130c36
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8faa
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
leaq -0x20(%r13), %rsi
movq 0x18(%rbx), %rdi
leaq 0x983df(%rip), %rdx     # 0x130b4c
movl $0x8, %ecx
callq 0xefc85
xorl %ebp, %ebp
movl $0x0, %r15d
testl %eax, %eax
jne 0x987ea
leaq 0x984fc(%rip), %rsi     # 0x130c86
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r15
movq 0x18(%rbx), %rcx
leaq 0x98310(%rip), %rsi     # 0x130ad1
movq %rbx, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
movq %r13, %r9
callq 0xe9aa3
testb $0x1, 0x40(%r15)
je 0x987ea
movq 0x58(%r15), %rbp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe8be2
movl 0x10(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq %r12, %rbp
subq %rbp, %r13
leaq 0x98495(%rip), %rsi     # 0x130ca3
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r15
cmpl $0xffdfffff, %r15d      # imm = 0xFFDFFFFF
jbe 0x9896e
leaq 0x9854a(%rip), %rsi     # 0x130da5
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x98536(%rip), %rsi     # 0x130db2
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl %r15d, %edx
shrl $0x13, %edx
andl $0x3, %edx
movl %edx, 0x4(%r14)
leaq 0x987b6(%rip), %rax     # 0x131060
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x9850f(%rip), %rsi     # 0x130dc7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl %r15d, %edx
shrl $0x11, %edx
andl $0x3, %edx
movl %edx, 0x8(%r14)
leaq 0x987b6(%rip), %rax     # 0x13108c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x984fd(%rip), %rsi     # 0x130de1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
cmpl $0x0, 0x30(%r14)
jne 0x98918
movl 0x8(%r14), %eax
decl %eax
cmpl $0x2, %eax
ja 0x98918
movl %eax, %eax
leaq 0x98767(%rip), %rcx     # 0x131070
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0xeb125
movl %r15d, %edx
shrl $0x10, %edx
andl $0x1, %edx
movl %edx, 0xc(%r14)
leaq 0x984e8(%rip), %rsi     # 0x130e14
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
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 0x98a1c
decl %eax
cmpl $0x3, %eax
jae 0x98a6c
movl %eax, %eax
movl $0x2, %ecx
subq %rax, %rcx
jmp 0x98a3a
leaq 0x9834b(%rip), %rsi     # 0x130cc0
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9393
cmpl $0x0, 0x30(%r14)
jne 0x989a6
cmpl $0x1, 0x24(%rbx)
jne 0x989a6
cmpl $0x0, (%r14)
je 0x989a6
leaq 0x9836c(%rip), %rsi     # 0x130d08
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
movl $0x10000, %r15d         # imm = 0x10000
cmpq %r15, %r13
cmovlq %r13, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe8b2b
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movq %rax, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xee8d4
cmpq $0x2, %r13
jl 0x989fb
decq %r15
xorl %r13d, %r13d
cmpb $-0x1, (%rbp,%r13)
jne 0x989f3
cmpb $-0x21, 0x1(%rbp,%r13)
ja 0x98c39
incq %r13
cmpq %r13, %r15
jne 0x989df
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe8be2
leaq 0x9834b(%rip), %rsi     # 0x130d58
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x98c06
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jne 0x98a6c
movl $0x3, %ecx
cmpl $0x3, %eax
je 0x98a3a
decl %eax
movl $0x4, %ecx
cmpl $0x2, %eax
jae 0x98a6c
shlq $0x5, %rcx
leaq 0x9853b(%rip), %rax     # 0x130f80
addq %rcx, %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %ecx
testl %ecx, %ecx
je 0x98a6c
leaq 0x984a5(%rip), %rdx     # 0x130efe
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
xorl %eax, %eax
callq 0xe8193
jmp 0x98a82
leaq 0x936de(%rip), %rsi     # 0x12c151
leaq 0x10(%rsp), %rdi
movl $0x20, %edx
callq 0xe8219
leaq 0x98397(%rip), %rsi     # 0x130e20
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movl %r15d, %ebp
shrl $0xa, %ebp
andl $0x3, %ebp
movl %ebp, 0x14(%r14)
movl 0x8(%r14), %eax
addl $-0x4, %eax
cmpl $-0x3, %eax
jb 0x98b05
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x98ad0
cmpl $0x3, %eax
je 0x98acc
cmpl $0x2, %eax
jne 0x98b05
movl $0x1, %eax
jmp 0x98ad5
xorl %eax, %eax
jmp 0x98ad5
movl $0x2, %eax
shll $0x4, %eax
leaq 0x98541(%rip), %rcx     # 0x131020
addq %rax, %rcx
movl %ebp, %eax
movl (%rcx,%rax,4), %ecx
testl %ecx, %ecx
je 0x98b05
leaq 0x98414(%rip), %rdx     # 0x130f06
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
xorl %eax, %eax
callq 0xe8193
jmp 0x98b1b
leaq 0x93645(%rip), %rsi     # 0x12c151
leaq 0x10(%rsp), %rdi
movl $0x20, %edx
callq 0xe8219
leaq 0x98312(%rip), %rsi     # 0x130e34
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movl %r15d, %edx
shrl $0x9, %edx
andl $0x1, %edx
movl %edx, 0x18(%r14)
leaq 0x98311(%rip), %rsi     # 0x130e58
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl %r15d, %edx
shrl $0x6, %edx
andl $0x3, %edx
movl %edx, 0x1c(%r14)
leaq 0x98517(%rip), %rax     # 0x13107c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
leaq 0x982f5(%rip), %rsi     # 0x130e68
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
cmpl $0x1, 0x1c(%r14)
jne 0x98ba2
movl %r15d, %edx
shrl $0x4, %edx
andl $0x3, %edx
movl %edx, 0x20(%r14)
leaq 0x982e6(%rip), %rsi     # 0x130e7e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl %r15d, %eax
shrl $0x3, %eax
andl $0x1, %eax
movl %eax, 0x24(%r14)
movl 0x18(%r14), %edx
leaq 0x982d7(%rip), %rsi     # 0x130e91
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl %r15d, %eax
shrl $0x2, %eax
andl $0x1, %eax
movl %eax, 0x28(%r14)
movl 0x18(%r14), %edx
leaq 0x982c8(%rip), %rsi     # 0x130ea4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
andl $0x3, %r15d
movl %r15d, 0x2c(%r14)
leaq 0x982c7(%rip), %rsi     # 0x130ebc
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
incl 0x30(%r14)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe8be2
addq %r13, %r12
leaq 0x98129(%rip), %rsi     # 0x130d77
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9393
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r15
jmp 0x98854