// File: logicx24[P]RayTracer/raytracer.cpp
// Function: main
int main(int argc, char* argv[]) {

    cout << "Ray Tracer!" << endl;

    string outFile = "output.png";

    float eps = 0.05f;
    int width = 1000;
    int height = 1000;

    Scene *scene = parseSceneFile(argv[1], eps, width, height);

    cout << "Rendering Scene..." << endl;

    scene->render();

    cout << "Scene render completed." << endl;
    cout << "Writing to file..." << endl;

    if (argc > 2) outFile = argv[2];
    scene->writeFile(outFile, width, height);

    cout << "Image saved as " << outFile << "." << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x29ae8(%rip), %rdi     # 0x2ffc8
leaq 0x1ee7c(%rip), %rsi     # 0x25363
callq 0x3220
movq %rax, %rdi
movq 0x29ac2(%rip), %rsi     # 0x2ffb8
callq 0x3270
leaq -0x31(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x3500
movq -0xa8(%rbp), %rdx
leaq 0x1ee56(%rip), %rsi     # 0x2536f
leaq -0x30(%rbp), %rdi
callq 0x7cc0
jmp 0x6524
leaq -0x31(%rbp), %rdi
callq 0x3290
movl $0x3d4ccccd, -0x48(%rbp) # imm = 0x3D4CCCCD
movl $0x3e8, -0x4c(%rbp)     # imm = 0x3E8
movl $0x3e8, -0x50(%rbp)     # imm = 0x3E8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x3500
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x7cc0
jmp 0x657a
movss -0x48(%rbp), %xmm0
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edx
leaq -0x78(%rbp), %rdi
callq 0x49c0
movq %rax, -0xc0(%rbp)
jmp 0x6597
leaq -0x78(%rbp), %rdi
callq 0x3160
leaq -0x79(%rbp), %rdi
callq 0x3290
movq -0xc0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x29a0d(%rip), %rdi     # 0x2ffc8
leaq 0x1edb8(%rip), %rsi     # 0x2537a
callq 0x3220
movq %rax, -0xc8(%rbp)
jmp 0x65d0
movq -0xc8(%rbp), %rdi
movq 0x299da(%rip), %rsi     # 0x2ffb8
callq 0x3270
jmp 0x65e5
movq -0x58(%rbp), %rdi
callq 0x95b0
jmp 0x65f0
movq 0x299d1(%rip), %rdi     # 0x2ffc8
leaq 0x1ed8f(%rip), %rsi     # 0x2538d
callq 0x3220
movq %rax, -0xd0(%rbp)
jmp 0x660c
movq -0xd0(%rbp), %rdi
movq 0x2999e(%rip), %rsi     # 0x2ffb8
callq 0x3270
jmp 0x6621
movq 0x299a0(%rip), %rdi     # 0x2ffc8
leaq 0x1ed76(%rip), %rsi     # 0x253a5
callq 0x3220
movq %rax, -0xd8(%rbp)
jmp 0x663d
movq -0xd8(%rbp), %rdi
movq 0x2996d(%rip), %rsi     # 0x2ffb8
callq 0x3270
jmp 0x6652
cmpl $0x2, -0x8(%rbp)
jle 0x66c9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x33a0
jmp 0x666b
jmp 0x66c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3290
jmp 0x67b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x66aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3160
leaq -0x79(%rbp), %rdi
callq 0x3290
jmp 0x67a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x67a7
movq -0x58(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
jmp 0x66e6
movq -0xe0(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
leaq -0xa0(%rbp), %rsi
callq 0x96c0
jmp 0x6701
leaq -0xa0(%rbp), %rdi
callq 0x3160
movq 0x298b4(%rip), %rdi     # 0x2ffc8
leaq 0x1ec9d(%rip), %rsi     # 0x253b8
callq 0x3220
movq %rax, -0xe8(%rbp)
jmp 0x6729
movq -0xe8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3210
movq %rax, -0xf0(%rbp)
jmp 0x6742
movq -0xf0(%rbp), %rdi
leaq 0x1ec66(%rip), %rsi     # 0x253b6
callq 0x3220
movq %rax, -0xf8(%rbp)
jmp 0x675e
movq -0xf8(%rbp), %rdi
movq 0x2984c(%rip), %rsi     # 0x2ffb8
callq 0x3270
jmp 0x6773
movl $0x0, -0x4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3160
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3160
leaq -0x30(%rbp), %rdi
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x34f0
nopl (%rax)