// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %rbx
movl %eax, 0xfd79(%rip)      # 0x12588
movl %eax, 0xfd77(%rip)      # 0x1258c
movl $0x100, 0xfd71(%rip)    # imm = 0x100
movl $0x41980000, 0xfd6b(%rip) # imm = 0x41980000
movl $0x1, 0xfd65(%rip)      # 0x12598
movl %edi, %r14d
movq (%rsi), %r15
movq %r15, %rdi
movl $0x2f, %esi
callq 0x10c0
testq %rax, %rax
jne 0x2858
movq %r15, %rdi
movl $0x5c, %esi
callq 0x10c0
decq %r15
testq %rax, %rax
cmovneq %rax, %r15
incq %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0x10c0
movq %rax, %r12
testq %rax, %rax
jne 0x2888
movq %r15, %rdi
callq 0x10a0
movq %rax, %r12
addq %r15, %r12
subq %r15, %r12
leaq 0x14(%r12), %rax
andq $-0x10, %rax
movq %rsp, %r13
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, 0xfce0(%rip)      # 0x125a0
movq $-0x40, %r15
movq 0x88(%rbx,%r15,2), %rdi
callq 0x1070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x80(%rbp,%r15)
addq $0x4, %r15
jne 0x28c7
movq $-0xc00, %r15           # imm = 0xF400
movq 0x1888(%rbx,%r15,2), %rdi
callq 0x11c0
movl %eax, -0x4c0(%rbp,%r15)
addq $0x4, %r15
jne 0x28ec
leaq -0xc0(%rbp), %rdi
leaq -0x10c0(%rbp), %rsi
callq 0x143c
cmpl $0x312, %r14d           # imm = 0x312
movl $0x1, -0x4c0(%rbp)
jl 0x29f7
addl $0xfffffcf0, %r14d      # imm = 0xFFFFFCF0
addq $0x1880, %rbx           # imm = 0x1880
movl $0x1, %eax
xorl %r12d, %r12d
leaq -0x4c0(%rbp), %r15
movslq %eax, %rcx
movq (%rbx,%rcx,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x2987
movzbl 0x1(%rdi), %ecx
cmpl $0x66, %ecx
je 0x29aa
cmpl $0x6f, %ecx
je 0x2994
cmpl $0x73, %ecx
jne 0x2d88
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2db9
movl %eax, 0xfc0b(%rip)      # 0x12590
jmp 0x29de
testq %r12, %r12
movq %rdi, %r12
je 0x29de
jmp 0x2d88
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2db9
movl %eax, 0xfbf0(%rip)      # 0x12598
jmp 0x29de
cmpb $0x0, 0x2(%rdi)
je 0x29b6
addq $0x2, %rdi
jmp 0x29cd
incl %eax
cmpl %r14d, %eax
movl %eax, -0x4c0(%rbp)
jge 0x2d88
cltq
movq (%rbx,%rax,8), %rdi
callq 0x1070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xfbb6(%rip)     # 0x12594
movl -0x4c0(%rbp), %eax
incl %eax
cmpl %r14d, %eax
movl %eax, -0x4c0(%rbp)
jl 0x294e
jmp 0x29fa
xorl %r12d, %r12d
testq %r12, %r12
je 0x2a06
movq %r12, 0xfb9a(%rip)      # 0x125a0
movss 0xfb7a(%rip), %xmm0     # 0x12588
movss 0xb5f2(%rip), %xmm1     # 0xe008
movss %xmm1, -0x2c(%rbp)
ucomiss %xmm0, %xmm1
movl 0xfb6b(%rip), %r12d     # 0x12590
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
jae 0x2a4e
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
addsd 0xb6c6(%rip), %xmm0     # 0xe108
cvttsd2si %xmm0, %eax
movl %r12d, %r13d
movl %eax, %r12d
jmp 0x2a63
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0xb6aa(%rip), %xmm0     # 0xe108
cvttsd2si %xmm0, %r13d
movq 0xf58e(%rip), %rax      # 0x11ff8
movq (%rax), %rcx
leaq 0xb6a1(%rip), %rdi      # 0xe115
movl $0x19, %esi
movl $0x1, %edx
callq 0x11e0
movl 0xfb0f(%rip), %esi      # 0x12598
movl %esi, %edi
imull %r13d, %edi
imull %r12d, %esi
callq 0x158b
movl 0xfafa(%rip), %ebx      # 0x12598
movl %ebx, %r14d
imull %r13d, %r14d
imull %r12d, %ebx
leal (,%r14,4), %r15d
movl %r15d, %eax
imull %ebx, %eax
movslq %eax, %rdi
addq $0x10, %rdi
callq 0x1150
leaq 0x10(%rax), %r8
movq %rax, -0x68(%rbp)
movq %rax, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r15d, %ecx
callq 0x53dc
cmpl $0x2, 0xfab6(%rip)      # 0x12598
jl 0x2b18
leal (,%r13,4), %ebx
movl %ebx, %eax
imull %r12d, %eax
movslq %eax, %rdi
addq $0x10, %rdi
callq 0x1150
leaq 0x10(%rax), %r8
movq %rax, -0x38(%rbp)
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x53dc
jmp 0x2b20
movq $0x0, -0x38(%rbp)
movl %r12d, %eax
imull %r13d, %eax
movslq %eax, %rdi
callq 0x1150
movq %rax, -0x60(%rbp)
movq 0xfa66(%rip), %rdi      # 0x125a0
leaq 0xb5ee(%rip), %rsi      # 0xe12f
callq 0x11b0
movq %rax, %r14
movq 0xf4a8(%rip), %rbx      # 0x11ff8
movq (%rbx), %rdi
movq 0xfa46(%rip), %rdx      # 0x125a0
leaq 0xb5d1(%rip), %rsi      # 0xe132
xorl %eax, %eax
callq 0x1120
movq %r14, %rdi
movq %r13, -0x78(%rbp)
movl %r13d, %esi
movl %r12d, -0x40(%rbp)
movl %r12d, %edx
movq %rbx, %r12
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1fd8
movq %r14, -0x58(%rbp)
movq %r14, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x22c6
movss 0xf9ea(%rip), %xmm0     # 0x1258c
movss 0xf9ea(%rip), %xmm1     # 0x12594
mulss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0xb54e(%rip), %xmm1     # 0xe108
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
testl %ecx, %ecx
movq -0x68(%rbp), %rbx
jle 0x2d49
mulss 0xb52a(%rip), %xmm0     # 0xe100
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
leal -0x1(%rcx), %eax
imull %esi, %eax
cltd
idivl %ecx
movl %eax, %r15d
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss -0x2c(%rbp), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x2c(%rbp)
movl %esi, -0x3c(%rbp)
subl %esi, %r15d
xorl %r14d, %r14d
xorl %r8d, %r8d
movq %rcx, -0x70(%rbp)
movl %r14d, %eax
cltd
idivl %ecx
movl %eax, -0x48(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %r8d, %xmm0
mulss -0x2c(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movq (%r12), %rdi
incl %r8d
leaq 0xb506(%rip), %rsi      # 0xe142
movl %r8d, -0x4c(%rbp)
movl %r8d, %edx
xorl %eax, %eax
callq 0x1120
movq (%r12), %rdi
callq 0x1160
movq %rbx, %rdi
movss -0x44(%rbp), %xmm0
callq 0x1bdc
cmpl $0x2, 0xf931(%rip)      # 0x12598
movq %rbx, %r12
jl 0x2c7b
movq -0x38(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1225
movq 0xf376(%rip), %r13      # 0x11ff8
movq (%r13), %rcx
movl $0xc, %esi
movl $0x1, %edx
leaq 0xb4d3(%rip), %rdi      # 0xe16a
callq 0x11e0
movq (%r13), %rdi
callq 0x1160
movq %r12, %rdi
movq -0x60(%rbp), %r13
movq %r13, %rsi
leaq -0x4c0(%rbp), %rdx
movq %rbx, %rcx
callq 0x4acb
movl -0x48(%rbp), %ebx
movl %ebx, %edx
movl %eax, %r12d
subl %r15d, %edx
movq -0x58(%rbp), %r15
movq %r15, %rdi
movl $0x1, %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2190
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq -0x78(%rbp), %rcx
movl -0x40(%rbp), %r8d
leaq -0x4c0(%rbp), %r9
pushq %r13
pushq %r12
movq 0xf2f8(%rip), %r12      # 0x11ff8
callq 0x22f3
leaq 0x10(%rsp), %rsp
movq (%r12), %rcx
movl $0x6, %esi
movl $0x1, %edx
leaq 0xb458(%rip), %rdi      # 0xe177
callq 0x11e0
movq (%r12), %rdi
callq 0x1160
addl -0x3c(%rbp), %r14d
movq -0x70(%rbp), %rcx
movl -0x4c(%rbp), %r8d
cmpl %r8d, %ecx
movl %ebx, %r15d
movq -0x68(%rbp), %rbx
jne 0x2c13
movq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x217b
movq %r14, %rdi
callq 0x1090
movq %rbx, %rdi
callq 0x1040
movq -0x38(%rbp), %rdi
callq 0x1040
movq -0x60(%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 0x2def