// File: /workspace/github_c_makefile_star2_O2/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, 0x50(%rsp)
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %rbx
leaq -0x20(%rbx), %r12
movq %r12, %rsi
callq 0x93689
testl %eax, %eax
je 0x9299a
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0xdecaf
movq %rax, %r15
leaq 0x24(%rsp), %rsi
movq %r14, %rdi
callq 0xdebae
leaq 0x90fb4(%rip), %rsi     # 0x123872
leaq 0x90fbf(%rip), %rdx     # 0x123884
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %r13
movq %r14, %rdi
movl %r13d, %esi
callq 0xdeba7
movq 0x18(%r14), %rdi
leaq -0x18(%rbx), %rsi
callq 0xe409f
movl %eax, (%r15)
leaq 0x9718c(%rip), %rsi     # 0x129a84
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%r14), %rdi
leaq -0x14(%rbx), %rsi
callq 0xe409f
movq %rax, 0x8(%r15)
leaq 0x90f6f(%rip), %rsi     # 0x12388b
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rax
subq 0x8(%r15), %rax
movq %rax, 0x28(%r15)
subq %rax, %r12
movq %r12, 0x30(%r15)
movq 0x18(%r14), %rdi
leaq -0x10(%rbx), %rsi
callq 0xe409f
movq %rax, 0x10(%r15)
leaq 0x76233(%rip), %rsi     # 0x108b85
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%r14), %rdi
leaq -0xc(%rbx), %rsi
callq 0xe409f
movl %eax, 0x4(%r15)
leaq 0x86cb8(%rip), %rsi     # 0x11962e
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movl (%r15), %edx
cmpl $0x7cf, %edx            # imm = 0x7CF
jbe 0x929b6
movl 0x4(%r15), %ecx
shrl $0x1f, %ecx
movl %ecx, 0x38(%r15)
jmp 0x929ba
leaq 0x90e9f(%rip), %rsi     # 0x123840
xorl %r13d, %r13d
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdf05a
xorl %r15d, %r15d
jmp 0x92a1f
movl 0x38(%r15), %ecx
movq 0x8(%r15), %rsi
leaq 0x20(%rsi), %rax
testl %ecx, %ecx
cmoveq %rsi, %rax
movq %rax, 0x20(%r15)
leal -0xbb8(%rdx), %ebp
cmpl $0xfffff82f, %ebp       # imm = 0xFFFFF82F
ja 0x929ed
leaq 0x90eb7(%rip), %rsi     # 0x123898
movq %r14, %rdi
xorl %eax, %eax
callq 0xdf05a
jmp 0x92a08
subq %rax, %rbx
movq %rbx, 0x18(%r15)
leaq 0x90ebe(%rip), %rsi     # 0x1238b9
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xde896
movl 0x24(%rsp), %esi
movq %r14, %rdi
callq 0xdebb7
cmpl $0xfffff830, %ebp       # imm = 0xFFFFF830
jae 0x92a26
xorl %r13d, %r13d
xorl %ebx, %ebx
jmp 0x92e2c
movq 0x8(%r15), %rbx
movq 0x20(%r15), %rax
movq %rax, 0x48(%rsp)
movq %r15, 0x18(%rsp)
movq 0x28(%r15), %r12
leaq -0x20(%rbx), %rcx
leaq 0x90e93(%rip), %rsi     # 0x1238da
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
movl %r13d, %esi
callq 0xdeba7
leaq (%rbx,%r12), %rax
addq $-0x20, %rax
movq %rax, 0x58(%rsp)
cmpq 0x58(%rsp), %r12
jge 0x92e15
movl $0x0, 0x8(%rsp)
movq %r14, %rdi
leaq 0x90e6b(%rip), %rsi     # 0x1238f4
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
movl %r13d, %esi
callq 0xdeba7
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xe409f
movq %rax, 0x60(%rsp)
leaq 0x4(%r12), %rsi
movq 0x18(%r14), %rdi
callq 0xe409f
movl %r13d, %ebp
movq %rax, %r13
movq %r14, %rdi
leaq 0x86b61(%rip), %rsi     # 0x11962e
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rsp), %rax
cmpl $0x7d0, (%rax)          # imm = 0x7D0
jb 0x92b27
movq %r14, %rdi
movl %ebp, %esi
callq 0xdeba7
shrl %r13d
andl $0x3, %r13d
leaq 0x91264(%rip), %rax     # 0x123d60
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
movq %r14, %rdi
leaq 0x72c05(%rip), %rsi     # 0x105712
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movl %r13d, 0x8(%rsp)
leaq 0x8(%r12), %r15
movq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
movl $0x100, %ecx            # imm = 0x100
movq %r15, %rsi
movl %ebp, %r8d
movl %ebp, %r9d
callq 0xe495c
movl 0x34(%rax), %ecx
movl %ecx, 0x20(%rsp)
testl %ecx, %ecx
movl %ebp, %r13d
movq %rax, 0x40(%rsp)
je 0x92c1c
movq 0x18(%rax), %rdi
movq %rax, %rbp
callq 0xeb7e4
movq %r14, %rdi
leaq 0x90d8f(%rip), %rsi     # 0x123904
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq (%rbp), %r15
movq %r14, %rdi
leaq 0x90d81(%rip), %rsi     # 0x12390e
movq %r15, %rdx
movq 0x60(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
movl %r13d, %esi
callq 0xdeba7
movl 0x8(%rsp), %eax
testb $0x1, %al
jne 0x92c26
movq 0x18(%rsp), %rax
cmpl $0x7d0, (%rax)          # imm = 0x7D0
movl %r13d, %ebp
sbbl $-0x1, %r13d
movq %r14, %rdi
callq 0xeac74
movq 0x18(%r14), %rdi
movl %r13d, (%rsp)
movl %ebp, %r13d
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rbp
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %rbp, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0x72b49(%rip), %rsi     # 0x10574b
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbp, %rdi
callq 0xeaf3c
pushq $-0x1
popq %rbp
jmp 0x92ca0
xorl %ebx, %ebx
pushq $-0x1
popq %rbp
jmp 0x92cb0
cmpl $0x1, %eax
pushq $-0x1
popq %rbp
jne 0x92c78
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x90cfd(%rip), %rsi     # 0x12393b
pushq $0x9
popq %rdx
callq 0xde550
testl %eax, %eax
je 0x92ce3
movq $0x0, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0xdfd24
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0xe4b94
movq %r14, %rdi
xorl %esi, %esi
callq 0xded32
cmpl $0x2, (%r14)
jl 0x92ca0
movq 0x18(%r14), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
xorl %r9d, %r9d
callq 0xded3a
movq %r14, %rdi
movl %ebp, %esi
callq 0xdeba7
subq %r12, %rbx
addq %r15, %rbx
movq %r14, %rdi
movl %ebp, %esi
callq 0xdeba7
movq %r14, %rdi
movq 0x40(%rsp), %rsi
callq 0xe4b94
cmpl $0x0, 0x20(%rsp)
je 0x92e15
addq %rbx, %r12
testq %rbx, %rbx
jg 0x92a6c
jmp 0x92e15
movl $0x100, %eax            # imm = 0x100
cmpq %rax, %rbx
movl $0x100, %ecx            # imm = 0x100
cmovlq %rbx, %rcx
movq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rcx, %rdx
movl %r13d, %r8d
movl %r13d, %r9d
callq 0xe495c
cmpl $0x0, 0x34(%rax)
movq %rax, 0x8(%rsp)
je 0x92c57
cmpq $0x10, %rbx
jl 0x92c57
movq (%rax), %rcx
movq %rbx, %rdx
subq %rcx, %rdx
movq %rdx, 0x28(%rsp)
addq %r15, %rcx
movq %rcx, 0x30(%rsp)
movq %r14, %rdi
callq 0xdfd1a
movq %rax, %rcx
cmpb $0x0, 0xd0(%r14)
movq %rax, 0x38(%rsp)
je 0x92d75
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdx
movq %r14, %rdi
movq %rcx, %rsi
xorl %ecx, %ecx
callq 0xdfd55
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
jmp 0x92dce
movq %r14, %rdi
movq %rcx, %rsi
leaq 0x90bc3(%rip), %rdx     # 0x123945
xorl %ecx, %ecx
pushq $0x5
popq %r8
callq 0xdffbd
movq %r14, %rdi
pushq $0x78
popq %rsi
callq 0xdecaf
movq %rax, %rsi
movq %rax, 0x10(%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rsi)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsi)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsi)
movb $0x1, (%rsi)
movq %r14, %rdi
callq 0xee4da
movq 0x10(%rsp), %rcx
addq $0x6c, %rcx
movq 0x18(%r14), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x38(%rsp), %r8
movl %r13d, %r9d
callq 0xe4e0b
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0xdfd24
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0xe4b94
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0xded32
jmp 0x92ca0
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0xdeba7
movb $0x1, %bl
movq 0x18(%rsp), %r15
movq 0x48(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0xded32
movq 0x50(%rsp), %rcx
testq %rcx, %rcx
sete %al
xorb $0x1, %bl
orb %al, %bl
jne 0x92e54
movl $0x1, 0x40(%rcx)
movq %r13, 0x58(%rcx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq