// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %rbx
leaq -0x20(%rbx), %r12
leaq 0x97eb1(%rip), %rdx     # 0x130811
movl $0x8, %ecx
movq %r12, %rsi
callq 0xf025e
testl %eax, %eax
je 0x98997
leaq 0x97e70(%rip), %rsi     # 0x1307e8
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9b27
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x98f39
movl $0x40, %esi
movq %r14, %rdi
callq 0xe969b
movq %rax, %r13
leaq 0x2c(%rsp), %rsi
movq %r14, %rdi
callq 0xe958c
leaq 0x97e5f(%rip), %rsi     # 0x13081a
leaq 0x97e6a(%rip), %rdx     # 0x13082c
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r14), %rdi
leaq -0x18(%rbx), %rsi
callq 0xef37e
movl %eax, (%r13)
leaq 0x9dfc6(%rip), %rsi     # 0x1369ba
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
leaq -0x14(%rbx), %rsi
callq 0xef37e
movq %rax, 0x8(%r13)
leaq 0x97e1b(%rip), %rsi     # 0x130833
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rax
subq 0x8(%r13), %rax
movq %rax, 0x28(%r13)
subq %rax, %r12
movq %r12, 0x30(%r13)
movq 0x18(%r14), %rdi
leaq -0x10(%rbx), %rsi
callq 0xef37e
movq %rax, 0x10(%r13)
leaq 0x7d117(%rip), %rsi     # 0x115b65
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
leaq -0xc(%rbx), %rsi
callq 0xef37e
movl %eax, 0x4(%r13)
leaq 0x8db8c(%rip), %rsi     # 0x1265fe
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl (%r13), %edx
cmpl $0x7d0, %edx            # imm = 0x7D0
jb 0x98a95
movl 0x4(%r13), %eax
shrl $0x1f, %eax
movl %eax, 0x38(%r13)
movq 0x8(%r13), %rax
movq %rax, 0x20(%r13)
cmpl $0x0, 0x38(%r13)
je 0x98aac
addq $0x20, %rax
movq %rax, 0x20(%r13)
movq %r13, 0x10(%rsp)
leal -0xbb8(%rdx), %ebp
cmpl $0xfffff82f, %ebp       # imm = 0xFFFFF82F
ja 0x98ad2
leaq 0x97d7a(%rip), %rsi     # 0x130840
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0x98af3
movq 0x10(%rsp), %rax
subq 0x20(%rax), %rbx
movq %rbx, 0x18(%rax)
leaq 0x97d7b(%rip), %rsi     # 0x130861
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xe9226
movl 0x2c(%rsp), %esi
movq %r14, %rdi
callq 0xe9595
cmpl $0xfffff830, %ebp       # imm = 0xFFFFF830
jae 0x98b1c
movq $0x0, 0x20(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %rbp
jmp 0x98f39
movq %r15, 0x60(%rsp)
movq 0x10(%rsp), %rbp
movq 0x8(%rbp), %rbx
movq 0x20(%rbp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rbp), %r12
leaq -0x20(%rbx), %rcx
leaq 0x97d40(%rip), %rsi     # 0x130882
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
leaq (%rbx,%r12), %rax
addq $-0x20, %rax
movq %rax, 0x48(%rsp)
xorl %r15d, %r15d
cmpq %rax, %r12
jge 0x98de4
movq %r14, %rdi
leaq 0x97d1d(%rip), %rsi     # 0x13089c
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xef37e
movq %rax, %r13
leaq 0x4(%r12), %rsi
movq 0x18(%r14), %rdi
callq 0xef37e
movq %rax, %rbx
movq %r14, %rdi
leaq 0x8da3e(%rip), %rsi     # 0x1265fe
movl %ebx, %edx
xorl %eax, %eax
callq 0xe9226
cmpl $0x7d0, (%rbp)          # imm = 0x7D0
jb 0x98c15
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
shrl %ebx
andl $0x3, %ebx
leaq 0x98125(%rip), %rax     # 0x130d10
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %r14, %rdi
leaq 0x79b26(%rip), %rsi     # 0x112722
movl %ebx, %edx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movl %ebx, %r15d
leaq 0x8(%r12), %rbx
movq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
movq %rbx, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xefe67
movl 0x34(%rax), %ecx
movl %ecx, 0x28(%rsp)
testl %ecx, %ecx
movq %rax, 0x58(%rsp)
je 0x98d11
movq %r12, 0x50(%rsp)
movq %rbp, %r12
movq 0x18(%rax), %rdi
movq %rax, %rbp
callq 0xf74bd
movq %r14, %rdi
leaq 0x97c3e(%rip), %rsi     # 0x1308ac
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq (%rbp), %rbx
movq %r14, %rdi
leaq 0x97c30(%rip), %rsi     # 0x1308b6
movq %rbx, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
testb $0x1, %r15b
jne 0x98d19
cmpl $0x7d0, (%r12)          # imm = 0x7D0
movl $0x1, %ebp
sbbl $-0x1, %ebp
movq %r14, %rdi
callq 0xf6870
movq %rax, %r15
movq 0x18(%r14), %rdi
movl %ebp, (%rsp)
movq 0x10(%rsp), %rbp
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rsi
movq %r13, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf74bd
movq %r14, %rdi
leaq 0x79a66(%rip), %rsi     # 0x11275b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
callq 0xf6bb0
movq 0x50(%rsp), %r12
jmp 0x98d93
xorl %r13d, %r13d
jmp 0x98da6
cmpl $0x1, %r15d
movq %r12, %rbp
movq 0x50(%rsp), %r12
jne 0x98d6b
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x9, %edx
leaq 0x97ba7(%rip), %rsi     # 0x1308e3
callq 0xe8ec6
testl %eax, %eax
je 0x98df2
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0xea9b3
movq %r14, %rdi
movq %r15, %rsi
callq 0xf00aa
movq %r14, %rdi
xorl %esi, %esi
callq 0xe9752
cmpl $0x2, (%r14)
jl 0x98d93
movq 0x18(%r14), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %r14, %rdi
movq %rbx, %rdx
movq %r13, %rcx
xorl %r9d, %r9d
callq 0xe975a
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
subq %r12, %r13
addq %rbx, %r13
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %r14, %rdi
movq 0x58(%rsp), %rsi
callq 0xf00aa
cmpl $0x0, 0x28(%rsp)
je 0x98ddc
testq %r13, %r13
setg %r15b
movl $0x0, %eax
cmovleq %rax, %r13
addq %r13, %r12
jmp 0x98ddf
xorl %r15d, %r15d
movq 0x48(%rsp), %rax
testb %r15b, %r15b
jne 0x98b69
jmp 0x98f25
movl $0x100, %eax            # imm = 0x100
cmpq %rax, %r13
movl $0x100, %ecx            # imm = 0x100
cmovlq %r13, %rcx
movq 0x18(%r14), %rdi
movq %rbx, %rsi
movq %rcx, %rdx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xefe67
movq %rax, %r15
cmpl $0x0, 0x34(%rax)
je 0x98d4c
cmpq $0x10, %r13
jl 0x98d4c
movq (%r15), %rax
movq %r13, %rcx
subq %rax, %rcx
movq %rcx, 0x30(%rsp)
addq %rbx, %rax
movq %rax, 0x38(%rsp)
movq %r14, %rdi
callq 0xea9a9
cmpb $0x0, 0xd0(%r14)
movq %rax, 0x40(%rsp)
je 0x98e80
movq 0x18(%r15), %rdx
movq %r14, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0xea9e4
movq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
jmp 0x98edd
movq %r14, %rdi
movq %rax, %rsi
leaq 0x97a60(%rip), %rdx     # 0x1308ed
xorl %ecx, %ecx
movl $0x5, %r8d
callq 0xeac7c
movl $0x78, %esi
movq %r14, %rdi
callq 0xe969b
movq %rax, %rsi
movq %rax, 0x18(%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rsi)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsi)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsi)
movb $0x1, (%rsi)
movq %r14, %rdi
callq 0xfa395
movq 0x18(%rsp), %rcx
addq $0x6c, %rcx
movq 0x18(%r14), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x40(%rsp), %r8
movl $0x1, %r9d
callq 0xf0321
movq %r14, %rdi
movq 0x40(%rsp), %rsi
callq 0xea9b3
movq %r14, %rdi
movq %r15, %rsi
callq 0xf00aa
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0xe9752
jmp 0x98d93
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movb $0x1, %bl
movq 0x60(%rsp), %r15
movq %r14, %rdi
movq %rbp, %rsi
callq 0xe9752
testq %r15, %r15
sete %al
xorb $0x1, %bl
orb %al, %bl
jne 0x98f62
movl $0x1, 0x40(%r15)
movq 0x20(%rsp), %rax
movq %rax, 0x58(%r15)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq