// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/mp3.c
// Function: de_run_apetag
static void de_run_apetag(deark *c, de_module_params *mparams)
{
	i64 endpos;
	i64 bytes_consumed = 0;

	// The calling module should provide a slice that starts at the beginning
	// of the file, and ends at the end of the APE tag (which is often, but
	// not always, the end of the file).
	// This does not very flexible, but it can be improved if need be.

	// If we successfully process an APE tag, we set the
	// 0x1 bit of mparams->out_params.flags, and set
	// mparams->out_params.int64_1 to the total size of the APE tag.

	endpos = c->infile->len;

	if(!do_ape_tag_internal(c, endpos, &bytes_consumed)) goto done;
	if(mparams) {
		mparams->out_params.flags = 0x1;
		mparams->out_params.int64_1 = bytes_consumed;
	}
done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %r14
leaq -0x20(%r14), %r12
leaq 0x98a7c(%rip), %rdx     # 0x130b4c
movl $0x8, %ecx
movq %r12, %rsi
callq 0xefc85
testl %eax, %eax
je 0x980fc
leaq 0x98a3b(%rip), %rsi     # 0x130b23
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8faa
jmp 0x9823c
movq %r15, 0x48(%rsp)
movl $0x40, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %rbp
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
leaq 0x98a30(%rip), %rsi     # 0x130b55
leaq 0x98a3b(%rip), %rdx     # 0x130b67
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq -0x18(%r14), %rsi
callq 0xeed61
movl %eax, (%rbp)
leaq 0x9ec27(%rip), %rsi     # 0x136d84
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq -0x14(%r14), %rsi
callq 0xeed61
movq %rax, 0x8(%rbp)
leaq 0x989ed(%rip), %rsi     # 0x130b6e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rax
subq 0x8(%rbp), %rax
movq %rax, 0x28(%rbp)
subq %rax, %r12
movq %r12, 0x30(%rbp)
movq 0x18(%rbx), %rdi
leaq -0x10(%r14), %rsi
callq 0xeed61
movq %rax, 0x10(%rbp)
leaq 0x7da5e(%rip), %rsi     # 0x115c15
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq -0xc(%r14), %rsi
callq 0xeed61
movl %eax, 0x4(%rbp)
leaq 0x8e654(%rip), %rsi     # 0x12682e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movl (%rbp), %edx
cmpl $0x7cf, %edx            # imm = 0x7CF
jbe 0x981fc
movl 0x4(%rbp), %ecx
shrl $0x1f, %ecx
movl %ecx, 0x38(%rbp)
jmp 0x981ff
movl 0x38(%rbp), %ecx
movq 0x8(%rbp), %rsi
leaq 0x20(%rsi), %rax
testl %ecx, %ecx
cmoveq %rsi, %rax
movq %rax, 0x20(%rbp)
leal -0xbb8(%rdx), %ecx
cmpl $0xfffff82f, %ecx       # imm = 0xFFFFF82F
ja 0x98256
leaq 0x98955(%rip), %rsi     # 0x130b7b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe8be2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rax, %r14
movq %r14, 0x18(%rbp)
leaq 0x98938(%rip), %rsi     # 0x130b9c
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq 0x8(%rbp), %r14
movq 0x20(%rbp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rbp), %r12
leaq -0x20(%r14), %rcx
leaq 0x98924(%rip), %rsi     # 0x130bbd
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq (%r14,%r12), %rax
addq $-0x20, %rax
movq %rax, 0x50(%rsp)
movq %rbp, 0x28(%rsp)
cmpq 0x50(%rsp), %r12
jge 0x98664
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x988fa(%rip), %rsi     # 0x130bd7
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeed61
movq %rax, %r14
leaq 0x4(%r12), %rsi
movq 0x18(%rbx), %rdi
callq 0xeed61
movq %rax, %r13
movq %rbx, %rdi
leaq 0x8e510(%rip), %rsi     # 0x12682e
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
cmpl $0x7d0, (%rbp)          # imm = 0x7D0
jb 0x98377
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
shrl %r13d
andl $0x3, %r13d
leaq 0x98d04(%rip), %rax     # 0x131050
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
movq %rbx, %rdi
leaq 0x7a3d5(%rip), %rsi     # 0x112732
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movl %r13d, %r15d
leaq 0x8(%r12), %rbp
movq 0x18(%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
movq %rbp, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xef87c
movl 0x34(%rax), %ecx
movl %ecx, 0xc(%rsp)
testl %ecx, %ecx
movq %rax, 0x30(%rsp)
je 0x98464
movq 0x18(%rax), %rdi
movq %rax, %r13
callq 0xf705c
movq %rbx, %rdi
leaq 0x9881f(%rip), %rsi     # 0x130be7
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq (%r13), %rbp
movq %rbx, %rdi
leaq 0x98811(%rip), %rsi     # 0x130bf1
movq %rbp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
testb $0x1, %r15b
jne 0x9846c
movq 0x28(%rsp), %rax
cmpl $0x7d0, (%rax)          # imm = 0x7D0
movl $0x1, %r13d
sbbl $-0x1, %r13d
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl %r13d, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbp, %rsi
movq %r14, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r15, %rdi
callq 0xf705c
movq %rbx, %rdi
leaq 0x7a31b(%rip), %rsi     # 0x11276b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
callq 0xf6753
jmp 0x984dd
xorl %r14d, %r14d
jmp 0x984f0
cmpl $0x1, %r15d
jne 0x984b6
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x9, %edx
leaq 0x98797(%rip), %rsi     # 0x130c1e
callq 0xe82e1
testl %eax, %eax
je 0x9852b
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xea50e
movq %rbx, %rdi
movq %r15, %rsi
callq 0xefaca
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe8be2
cmpl $0x2, (%rbx)
jl 0x984dd
movq 0x18(%rbx), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %rbp, %rdx
movq %r14, %rcx
xorl %r9d, %r9d
callq 0xe8bea
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
subq %r12, %r14
addq %rbp, %r14
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
callq 0xefaca
cmpl $0x0, 0xc(%rsp)
movq 0x28(%rsp), %rbp
je 0x98664
addq %r14, %r12
testq %r14, %r14
jg 0x982c5
jmp 0x98664
movl $0x100, %eax            # imm = 0x100
cmpq %rax, %r14
movl $0x100, %ecx            # imm = 0x100
cmovlq %r14, %rcx
movq 0x18(%rbx), %rdi
movq %rbp, %rsi
movq %rcx, %rdx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xef87c
movq %rax, %r15
cmpl $0x0, 0x34(%rax)
je 0x98497
cmpq $0x10, %r14
jl 0x98497
movq (%r15), %r13
movq %r14, %rax
subq %r13, %rax
movq %rax, 0x20(%rsp)
addq %rbp, %r13
movq %rbx, %rdi
callq 0xea504
cmpb $0x0, 0xd0(%rbx)
movq %rax, 0x38(%rsp)
je 0x985b3
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0xea53f
movq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
jmp 0x9861d
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x98668(%rip), %rdx     # 0x130c28
xorl %ecx, %ecx
movl $0x5, %r8d
callq 0xea78f
movl $0x78, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %r13, 0x10(%rsp)
movq %rax, %r13
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r13)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r13)
movq 0x20(%rsp), %rax
movq %rax, 0x20(%r13)
movb $0x1, (%r13)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf9e98
movq %r13, 0x18(%rsp)
movq %r13, %rcx
movq 0x10(%rsp), %r13
addq $0x6c, %rcx
movq 0x18(%rbx), %rdi
movq %r13, %rsi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %r13
movq %r13, %r8
movl $0x1, %r9d
callq 0xefd48
movq %rbx, %rdi
movq %r13, %rsi
callq 0xea50e
movq %rbx, %rdi
movq %r15, %rsi
callq 0xefaca
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xe8be2
jmp 0x984dd
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe8be2
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x98247
movl $0x1, 0x40(%rax)
movq 0x40(%rsp), %rcx
movq %rcx, 0x58(%rax)
jmp 0x98247