// File: /workspace/github_c_makefile_star2_O2/halcy[P]quasi_crystals_bot/Engine/Main.c
// Function: main
int main(int argc,const char **argv)
{
	Aspect=1.0/1.0;
	Duration=1.0;
	Size=256;
	FPS=19;
	Oversampling=1;

	const char *start=strrchr(argv[0],'/');
	if(!start) start=strrchr(argv[0],'\\');
	if(!start) start=argv[0]-1;
	start++;

	const char *end=strrchr(start,'.');
	if(!end) end=start+strlen(start);

	size_t length=end-start;
	char filename[length+5];
	memcpy(filename,start,length);
	strcpy(filename+length,".gif");

	Filename=filename;


	int firstArg = 1;

	float paramsIn[16];
    for(int i = 0; i < 16; i++) {
		paramsIn[i] = atof(argv[firstArg + i]);
	}
	
	int paletteIn[768];
	for(int i = 0; i < 768; i++) {
		paletteIn[i] = atoi(argv[firstArg + i + 16]);
	}

	Configure(paramsIn, paletteIn);
    
	ParseArguments(argc - (256 * 3 + 16), argv + (256 * 3 + 16));
    
	int width,height;
	if(Aspect>1)
	{
		width=Size;
		height=(Size/Aspect+0.5);
	}
	else
	{
		width=(Size*Aspect+0.5);
		height=Size;
	}


	RenderGIFAnimation(width,height);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq -0x1098(%rsp), %rsp
movl $0x3f800000, %eax       # imm = 0x3F800000
movl $0x100, 0xf0a0(%rip)    # imm = 0x100
movl $0x41980000, 0xf09a(%rip) # imm = 0x41980000
movl $0x1, 0xf094(%rip)      # 0x11598
movq %rsi, %rbx
movl %edi, %r14d
movl %eax, 0xf078(%rip)      # 0x11588
movl %eax, 0xf076(%rip)      # 0x1158c
movq (%rsi), %r12
pushq $0x2f
popq %rsi
movq %r12, %rdi
callq 0x10c0
movq %rax, %r15
testq %rax, %rax
jne 0x2544
pushq $0x5c
popq %rsi
movq %r12, %rdi
callq 0x10c0
decq %r12
testq %rax, %rax
cmovneq %rax, %r12
movq %r12, %r15
incq %r15
pushq $0x2e
popq %rsi
movq %r15, %rdi
callq 0x10c0
movq %rax, %r12
testq %rax, %rax
jne 0x2568
movq %r15, %rdi
callq 0x10a0
movq %rax, %r12
addq %r15, %r12
subq %r15, %r12
movq %rsp, %r13
leaq 0x14(%r12), %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1140
movl $0x6669672e, (%r12,%r13) # imm = 0x6669672E
movb $0x0, 0x4(%r12,%r13)
movq %r13, 0xf000(%rip)      # 0x115a0
pushq $-0x40
popq %r15
testq %r15, %r15
je 0x25c7
movq 0x88(%rbx,%r15,2), %rdi
callq 0x1070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x80(%rbp,%r15)
addq $0x4, %r15
jmp 0x25a4
movq $-0xc00, %r15           # imm = 0xF400
testq %r15, %r15
je 0x25ee
movq 0x1888(%rbx,%r15,2), %rdi
callq 0x11c0
movl %eax, -0x4c0(%rbp,%r15)
addq $0x4, %r15
jmp 0x25ce
leaq -0xc0(%rbp), %rdi
leaq -0x10c0(%rbp), %rsi
callq 0x12ec
addl $0xfffffcf0, %r14d      # imm = 0xFFFFFCF0
addq $0x1880, %rbx           # imm = 0x1880
pushq $0x1
popq %rax
xorl %r12d, %r12d
leaq -0x4c0(%rbp), %r15
cmpl %r14d, %eax
movl %eax, -0x4c0(%rbp)
jge 0x26c8
movslq %eax, %rcx
movq (%rbx,%rcx,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x2664
movzbl 0x1(%rdi), %ecx
cmpl $0x66, %ecx
je 0x2687
cmpl $0x6f, %ecx
je 0x2671
cmpl $0x73, %ecx
jne 0x29fe
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2a79
movl %eax, 0xef2e(%rip)      # 0x11590
jmp 0x26bb
testq %r12, %r12
movq %rdi, %r12
je 0x26bb
jmp 0x29fe
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2a79
movl %eax, 0xef13(%rip)      # 0x11598
jmp 0x26bb
cmpb $0x0, 0x2(%rdi)
je 0x2693
addq $0x2, %rdi
jmp 0x26aa
incl %eax
cmpl %r14d, %eax
movl %eax, -0x4c0(%rbp)
jge 0x29fe
cltq
movq (%rbx,%rax,8), %rdi
callq 0x1070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xeed9(%rip)     # 0x11594
movl -0x4c0(%rbp), %eax
incl %eax
jmp 0x261c
testq %r12, %r12
je 0x26d4
movq %r12, 0xeecc(%rip)      # 0x115a0
movss 0x992c(%rip), %xmm1     # 0xc008
movss 0xeea4(%rip), %xmm0     # 0x11588
movl 0xeea6(%rip), %ebx      # 0x11590
ucomiss %xmm0, %xmm1
movss %xmm1, -0x2c(%rbp)
cvtsi2ss %ebx, %xmm1
jae 0x2713
divss %xmm0, %xmm1
movl %ebx, %r14d
cvtss2sd %xmm1, %xmm0
addsd 0x99fd(%rip), %xmm0     # 0xc108
cvttsd2si %xmm0, %eax
movl %eax, %ebx
jmp 0x2728
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x99e5(%rip), %xmm0     # 0xc108
cvttsd2si %xmm0, %r14d
movq 0xe8c9(%rip), %r12      # 0x10ff8
leaq 0x99df(%rip), %rdi      # 0xc115
movq (%r12), %rcx
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x11e0
movl 0xee4d(%rip), %esi      # 0x11598
movl %esi, %edi
imull %ebx, %esi
imull %r14d, %edi
callq 0x142f
movl 0xee39(%rip), %esi      # 0x11598
movl %esi, %edi
imull %ebx, %esi
imull %r14d, %edi
callq 0x2a2f
cmpl $0x2, 0xee24(%rip)      # 0x11598
movq %rax, -0x80(%rbp)
jl 0x278a
movl %r14d, %edi
movl %ebx, %esi
callq 0x2a2f
movq %rax, -0x38(%rbp)
jmp 0x2792
movq $0x0, -0x38(%rbp)
movl %ebx, %eax
imull %r14d, %eax
movslq %eax, %rdi
callq 0x1150
movq 0xedf9(%rip), %rdi      # 0x115a0
leaq 0x9981(%rip), %rsi      # 0xc12f
movq %rax, -0x68(%rbp)
callq 0x11b0
movq %rax, %r13
movq (%r12), %rdi
movq 0xeddb(%rip), %rdx      # 0x115a0
leaq 0x9966(%rip), %rsi      # 0xc132
xorl %eax, %eax
callq 0x1120
movq %r13, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
movl %r14d, -0x44(%rbp)
movl %ebx, -0x48(%rbp)
callq 0x1d70
movq %r13, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x2024
movss 0xed88(%rip), %xmm0     # 0x1158c
movss 0x98f4(%rip), %xmm1     # 0xc100
movsd 0x98f4(%rip), %xmm2     # 0xc108
mulss %xmm0, %xmm1
mulss 0xed74(%rip), %xmm0     # 0x11594
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
addsd %xmm2, %xmm0
addsd %xmm2, %xmm1
cvttsd2si %xmm0, %ecx
cvttsd2si %xmm1, %esi
cvttpd2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
leal -0x1(%rcx), %eax
imull %esi, %eax
cltd
idivl %ecx
movss -0x2c(%rbp), %xmm1
movl %esi, -0x40(%rbp)
movq %rcx, -0x70(%rbp)
divss %xmm0, %xmm1
movl $0x0, %edx
movss %xmm1, -0x2c(%rbp)
movl %eax, %ebx
subl %esi, %ebx
testl %ecx, %ecx
cmovgl %ecx, %edx
pushq $0x1
popq %r15
xorl %eax, %eax
xorl %r8d, %r8d
movq %r13, -0x78(%rbp)
movl %edx, -0x3c(%rbp)
cmpl %r8d, %edx
movq -0x80(%rbp), %r14
je 0x29c3
movl %eax, -0x5c(%rbp)
cltd
movq -0x70(%rbp), %rcx
movl %ebx, -0x54(%rbp)
cvtsi2ss %r8d, %xmm0
incl %r8d
leaq 0x98a0(%rip), %rsi      # 0xc142
idivl %ecx
mulss -0x2c(%rbp), %xmm0
movq (%r12), %rdi
movl %r8d, -0x58(%rbp)
movl %r8d, %edx
movss %xmm0, -0x4c(%rbp)
movl %eax, -0x50(%rbp)
xorl %eax, %eax
callq 0x1120
movq (%r12), %rdi
callq 0x1160
movq %r14, %rdi
movss -0x4c(%rbp), %xmm0
callq 0x19f3
cmpl $0x2, 0xecb8(%rip)      # 0x11598
movq %r14, %r13
jl 0x2919
movq (%r12), %rcx
leaq 0x986b(%rip), %rdi      # 0xc15b
pushq $0xe
popq %rsi
movq %r15, %rdx
callq 0x11e0
movq (%r12), %rdi
callq 0x1160
movq -0x38(%rbp), %r14
movl 0xec8a(%rip), %edx      # 0x11598
movq %r13, %rsi
movq %r14, %rdi
callq 0x1a9c
movq (%r12), %rcx
leaq 0x9846(%rip), %rdi      # 0xc16a
pushq $0xc
popq %rsi
movq %r15, %rdx
callq 0x11e0
movq (%r12), %rdi
callq 0x1160
movq -0x68(%rbp), %r15
movq %r14, %rdi
leaq -0x4c0(%rbp), %rdx
movq %r13, %rcx
movq %r15, %rsi
callq 0x44bd
movl -0x50(%rbp), %ebx
movq -0x78(%rbp), %r13
movl %eax, %r14d
movl %ebx, %edx
movq %r13, %rdi
subl -0x54(%rbp), %edx
pushq $0x1
popq %rsi
pushq $-0x1
popq %rcx
callq 0x1f26
xorl %edx, %edx
movl -0x48(%rbp), %r8d
movq %r13, %rdi
xorl %esi, %esi
movl -0x44(%rbp), %ecx
leaq -0x4c0(%rbp), %r9
pushq %r15
pushq $0x1
popq %r15
pushq %r14
callq 0x204f
popq %rax
popq %rcx
movq (%r12), %rcx
leaq 0x97da(%rip), %rdi      # 0xc177
pushq $0x6
popq %rsi
movq %r15, %rdx
callq 0x11e0
movq (%r12), %rdi
callq 0x1160
movl -0x5c(%rbp), %eax
movl -0x3c(%rbp), %edx
movl -0x58(%rbp), %r8d
addl -0x40(%rbp), %eax
jmp 0x287b
movq %r13, %rdi
callq 0x1f13
movq %r13, %rdi
callq 0x1090
movq %r14, %rdi
callq 0x1040
movq -0x38(%rbp), %rdi
callq 0x1040
movq -0x68(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x2aae