// File: /workspace/github_c_makefile_star2_O0/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
leaq -0xcb0(%rsp), %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss 0x13c12(%rip), %xmm0    # 0x17004
movss %xmm0, 0x1a19e(%rip)    # 0x1d598
movss 0x13c02(%rip), %xmm0    # 0x17004
movss %xmm0, 0x1a192(%rip)    # 0x1d59c
movl $0x100, 0x1a18c(%rip)   # imm = 0x100
movss 0x13cc4(%rip), %xmm0    # 0x170e0
movss %xmm0, 0x1a180(%rip)    # 0x1d5a4
movl $0x1, 0x1a17a(%rip)     # 0x1d5a8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x10d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x345f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x5c, %esi
callq 0x10d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3475
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2e, %esi
callq 0x10d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x34bf
movq -0x18(%rbp), %rax
movq %rax, -0xca8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0xca8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, %rax
addq $0x5, %rax
movq %rsp, %rdx
movq %rdx, -0x30(%rbp)
addq $0x14, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0xcb0(%rbp)
movq %rdi, %rsp
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1150
movq -0xcb0(%rbp), %rdi
addq -0x28(%rbp), %rdi
leaq 0x13bd5(%rip), %rsi     # 0x170f0
callq 0x1040
movq -0xcb0(%rbp), %rax
movq %rax, 0x1a082(%rip)     # 0x1d5b0
movl $0x1, -0x3c(%rbp)
movl $0x0, -0x84(%rbp)
cmpl $0x10, -0x84(%rbp)
jge 0x3583
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x84(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movslq -0x84(%rbp), %rax
movss %xmm0, -0x80(%rbp,%rax,4)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x353f
movl $0x0, -0xc94(%rbp)
cmpl $0x300, -0xc94(%rbp)    # imm = 0x300
jge 0x35d6
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0xc94(%rbp), %ecx
addl $0x10, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x11e0
movl %eax, %ecx
movslq -0xc94(%rbp), %rax
movl %ecx, -0xc90(%rbp,%rax,4)
movl -0xc94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc94(%rbp)
jmp 0x358d
leaq -0x80(%rbp), %rdi
leaq -0xc90(%rbp), %rsi
callq 0x1310
movl -0x8(%rbp), %edi
subl $0x310, %edi            # imm = 0x310
movq -0x10(%rbp), %rsi
addq $0x1880, %rsi           # imm = 0x1880
callq 0x36b0
movss 0x19f91(%rip), %xmm0    # 0x1d598
movss 0x139f5(%rip), %xmm1    # 0x17004
ucomiss %xmm1, %xmm0
jbe 0x364c
movl 0x19f86(%rip), %eax     # 0x1d5a0
movl %eax, -0xc98(%rbp)
cvtsi2ssl 0x19f78(%rip), %xmm0 # 0x1d5a0
divss 0x19f68(%rip), %xmm0    # 0x1d598
cvtss2sd %xmm0, %xmm0
movsd 0x13aac(%rip), %xmm1    # 0x170e8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xc9c(%rbp)
jmp 0x3682
cvtsi2ssl 0x19f4c(%rip), %xmm0 # 0x1d5a0
mulss 0x19f3c(%rip), %xmm0    # 0x1d598
cvtss2sd %xmm0, %xmm0
movsd 0x13a80(%rip), %xmm1    # 0x170e8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xc98(%rbp)
movl 0x19f24(%rip), %eax     # 0x1d5a0
movl %eax, -0xc9c(%rbp)
movl -0xc98(%rbp), %edi
movl -0xc9c(%rbp), %esi
callq 0x37d0
movl $0x0, -0x4(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)