// File: /workspace/github_cpp_makefile_star2_O3/Aries-orz[P]Ari-RayTracing/src/Demo.cpp
// Function: generateWorld(rt::Scene&)
void generateWorld(Scene& scene) {
    //Add the walls
    scene.addObj(new RTPlane(Vec3d(1, 0, 0), Vec3d(1, 0, 0), RTObject::DIFFUSE, Vec3d(), Vec3d(.75, .25, .25)));//left
    scene.addObj(new RTPlane(Vec3d(99, 0, 0), Vec3d(-1, 0, 0), RTObject::DIFFUSE, Vec3d(), Vec3d(.25, .75, .25)));//right
    scene.addObj(new RTPlane(Vec3d(0, 0, 0), Vec3d(0, 0, 1), RTObject::REFRACTIVE, Vec3d(), Vec3d(1, 1, 1)));//back
    scene.addObj(new RTPlane(Vec3d(0, 0, 300), Vec3d(0, 0, -1), RTObject::REFRACTIVE, Vec3d(), Vec3d()));//front
    scene.addObj(new RTPlane(Vec3d(0, 0, 0), Vec3d(0, 1, 0), RTObject::DIFFUSE, Vec3d(), Vec3d(.75, .75, .75)));//bottom
    scene.addObj(new RTPlane(Vec3d(0, 81.6, 0), Vec3d(0, -1, 0), RTObject::DIFFUSE, Vec3d(), Vec3d(.75, .75, .75)));//top
    
    //Add the light
    scene.addObj(new RTTriangle(Vec3d(40, 81.6-.01, 70), Vec3d(60, 81.6-.01, 70), Vec3d(40, 81.6-.01, 90),
                                RTObject::DIFFUSE, Vec3d(12, 12, 12), Vec3d()));
    scene.addObj(new RTTriangle(Vec3d(60, 81.6-.01, 90), Vec3d(60, 81.6-.01, 70), Vec3d(40, 81.6-.01, 90),
                                RTObject::DIFFUSE, Vec3d(12, 12, 12), Vec3d()));
    
    //Add two sphere
    scene.addObj(new RTSphere(Vec3d(45,12,120),    Vec3d(), Vec3d(1,1,1)*.999, 12, RTObject::REFRACTIVE));
    scene.addObj(new RTSphere(Vec3d(27,52.001,47), Vec3d(), Vec3d(1,1,1)*.999, 12, RTObject::DIFFUSE));

    //Add one box
    scene.addObj(new RTBox(Vec3d(10.5,0,30.5), Vec3d(43.5,40,63.5), RTObject::DIFFUSE, Vec3d(), Vec3d(1,1,1)*.999));
    
    //Parse the .obj file
    ObjParser parser;
    parser.readFromObj("test_data/block.obj");
    int num = parser.numOfFaces;
    
    //Add the block object
    RTTriangle* indices = new RTTriangle[num];
    for (int i=0; i<num; ++i) {
        Vec3d p0 = parser.verticeList[parser.faceList[i][0]];
        Vec3d p1 = parser.verticeList[parser.faceList[i][1]];
        Vec3d p2 = parser.verticeList[parser.faceList[i][2]];
        indices[i] = RTTriangle(p0+Vec3d(73,10,79), p1+Vec3d(73,10,79), p2+Vec3d(73,10,79), RTObject::DIFFUSE, Vec3d(), Vec3d(0,0,1));
    }
    RTBBox *bbox = new RTBBox(Vec3d(53,0,68), Vec3d(93,20,88)); //Add a bounding box for the complex object
    scene.addObj(new RTComplexObj(indices, bbox, num, RTObject::DIFFUSE, Vec3d(), Vec3d(0,0,1)));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x678, %rsp            # imm = 0x678
movq %rdi, %r13
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq 0xf0(%rsp), %rsi
movq %rax, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movups %xmm0, 0x8(%rdx)
leaq 0x640(%rsp), %r8
movaps %xmm0, (%r8)
movq $0x0, 0x10(%r8)
movaps 0x3c60(%rip), %xmm0     # 0x6010
leaq 0x620(%rsp), %r9
movaps %xmm0, (%r9)
movabsq $0x3fd0000000000000, %r15 # imm = 0x3FD0000000000000
movq %r15, 0x10(%r9)
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
movabsq $0x4058c00000000000, %rax # imm = 0x4058C00000000000
leaq 0xf0(%rsp), %rsi
movq %rax, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movabsq $-0x4010000000000000, %rbx # imm = 0xBFF0000000000000
leaq 0x10(%rsp), %rdx
movq %rbx, (%rdx)
movups %xmm0, 0x8(%rdx)
leaq 0x600(%rsp), %r8
movaps %xmm0, (%r8)
movq $0x0, 0x10(%r8)
movaps 0x3be7(%rip), %xmm0     # 0x6020
leaq 0x5e0(%rsp), %r9
movaps %xmm0, (%r9)
movq %r15, 0x10(%r9)
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
xorl %eax, %eax
leaq 0xf0(%rsp), %rsi
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%rdx)
leaq 0x5c0(%rsp), %r8
movaps %xmm0, (%r8)
movq %rax, 0x10(%r8)
movaps 0x3b84(%rip), %xmm0     # 0x6030
leaq 0x5a0(%rsp), %r9
movaps %xmm0, (%r9)
movq %rcx, 0x10(%r9)
movq %r14, %rdi
movl $0x2, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
leaq 0xf0(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movabsq $0x4072c00000000000, %rax # imm = 0x4072C00000000000
movq %rax, 0x10(%rsi)
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rbx, 0x10(%rdx)
leaq 0x580(%rsp), %r8
movaps %xmm0, (%r8)
xorl %eax, %eax
movq %rax, 0x10(%r8)
leaq 0x560(%rsp), %r9
movaps %xmm0, (%r9)
movq %rax, 0x10(%r9)
movq %r14, %rdi
movl $0x2, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
xorl %eax, %eax
leaq 0xf0(%rsp), %rsi
movq %rax, 0x10(%rsi)
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
movhps 0x3b85(%rip), %xmm0     # xmm0 = xmm0[0,1],mem[0,1]
movaps %xmm1, (%rsi)
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rax, 0x10(%rdx)
leaq 0x540(%rsp), %r8
movaps %xmm1, (%r8)
movq %rax, 0x10(%r8)
movaps 0x3aaf(%rip), %xmm0     # 0x6040
leaq 0x520(%rsp), %r9
movaps %xmm0, (%r9)
movabsq $0x3fe8000000000000, %rbx # imm = 0x3FE8000000000000
movq %rbx, 0x10(%r9)
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x70, %edi
callq 0x2110
movq %rax, %r14
xorps %xmm0, %xmm0
movhps 0x3b21(%rip), %xmm0     # xmm0 = xmm0[0,1],mem[0,1]
leaq 0xf0(%rsp), %rsi
movaps %xmm0, (%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
movhps 0x3b0e(%rip), %xmm0     # xmm0 = xmm0[0,1],mem[0,1]
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rax, 0x10(%rdx)
leaq 0x500(%rsp), %r8
xorps %xmm0, %xmm0
movaps %xmm0, (%r8)
movq %rax, 0x10(%r8)
leaq 0x4e0(%rsp), %r9
movaps 0x3a20(%rip), %xmm0     # 0x6040
movaps %xmm0, (%r9)
movq %rbx, 0x10(%r9)
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52e8
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x88, %edi
callq 0x2110
movq %rax, %r14
movaps 0x39ff(%rip), %xmm0     # 0x6050
leaq 0x4c0(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $0x4051800000000000, %rbx # imm = 0x4051800000000000
movq %rbx, 0x10(%rsi)
movaps 0x39ef(%rip), %xmm1     # 0x6060
leaq 0x4a0(%rsp), %rdx
movaps %xmm1, (%rdx)
movq %rbx, 0x10(%rdx)
leaq 0x480(%rsp), %rcx
movaps %xmm0, (%rcx)
movabsq $0x4056800000000000, %r15 # imm = 0x4056800000000000
movq %r15, 0x10(%rcx)
movaps 0x39d0(%rip), %xmm0     # 0x6070
leaq 0x460(%rsp), %r9
movaps %xmm0, (%r9)
movabsq $0x4028000000000000, %r12 # imm = 0x4028000000000000
movq %r12, 0x10(%r9)
xorps %xmm0, %xmm0
leaq 0x440(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, (%rsp)
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x5658
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x88, %edi
callq 0x2110
movq %rax, %r14
leaq 0x420(%rsp), %rsi
movaps 0x395a(%rip), %xmm0     # 0x6060
movaps %xmm0, (%rsi)
movq %r15, 0x10(%rsi)
leaq 0x400(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rbx, 0x10(%rdx)
leaq 0x3e0(%rsp), %rcx
movaps 0x3925(%rip), %xmm0     # 0x6050
movaps %xmm0, (%rcx)
movq %r15, 0x10(%rcx)
leaq 0x3c0(%rsp), %r9
movaps 0x392f(%rip), %xmm0     # 0x6070
movaps %xmm0, (%r9)
movq %r12, 0x10(%r9)
leaq 0x3a0(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, (%rsp)
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x5658
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x60, %edi
callq 0x2110
movq %rax, %r14
movaps 0x38f3(%rip), %xmm0     # 0x6080
movaps %xmm0, 0x240(%rsp)
movabsq $0x405e000000000000, %rax # imm = 0x405E000000000000
movq %rax, 0x250(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x220(%rsp)
movq $0x0, 0x230(%rsp)
leaq 0xf0(%rsp), %rsi
movaps 0x3863(%rip), %xmm0     # 0x6030
movaps %xmm0, (%rsi)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x10(%rsi)
leaq 0x308(%rsp), %rdi
movsd 0x391a(%rip), %xmm0     # 0x6108
callq 0x5d12
leaq 0x240(%rsp), %rsi
leaq 0x220(%rsp), %rdx
leaq 0x308(%rsp), %rcx
movsd 0x38fd(%rip), %xmm0     # 0x6110
movq %r14, %rdi
movl $0x2, %r8d
callq 0x544c
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x60, %edi
callq 0x2110
movq %rax, %r14
movaps 0x3850(%rip), %xmm0     # 0x6090
movaps %xmm0, 0x200(%rsp)
movabsq $0x4047800000000000, %rax # imm = 0x4047800000000000
movq %rax, 0x210(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x1e0(%rsp)
movq $0x0, 0x1f0(%rsp)
leaq 0xf0(%rsp), %rsi
movaps 0x37b0(%rip), %xmm0     # 0x6030
movaps %xmm0, (%rsi)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x10(%rsi)
leaq 0x2f0(%rsp), %rdi
movsd 0x3867(%rip), %xmm0     # 0x6108
callq 0x5d12
leaq 0x200(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
leaq 0x2f0(%rsp), %rcx
movsd 0x384a(%rip), %xmm0     # 0x6110
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x544c
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
movl $0x78, %edi
callq 0x2110
movq %rax, %r14
movsd 0x3827(%rip), %xmm0     # 0x6118
movaps %xmm0, 0x1c0(%rsp)
movabsq $0x403e800000000000, %rax # imm = 0x403E800000000000
movq %rax, 0x1d0(%rsp)
movaps 0x378e(%rip), %xmm0     # 0x60a0
movaps %xmm0, 0x1a0(%rsp)
movabsq $0x404fc00000000000, %rax # imm = 0x404FC00000000000
movq %rax, 0x1b0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x180(%rsp)
movq $0x0, 0x190(%rsp)
leaq 0xf0(%rsp), %rsi
movaps 0x36de(%rip), %xmm0     # 0x6030
movaps %xmm0, (%rsi)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x10(%rsi)
leaq 0x2d8(%rsp), %rdi
movsd 0x3795(%rip), %xmm0     # 0x6108
callq 0x5d12
leaq 0x1c0(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
leaq 0x180(%rsp), %r8
leaq 0x2d8(%rsp), %r9
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x4d54
movq %r13, %rdi
movq %r14, %rsi
callq 0x5a3c
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x40b4
leaq 0x376f(%rip), %rsi      # 0x6130
movq %rbx, %rdi
callq 0x4108
movq %r13, 0x40(%rsp)
movslq 0x14(%rsp), %rbx
movl $0x88, %ecx
movq %rbx, %rax
mulq %rcx
movq %rax, %r14
seto %al
addq $0x8, %r14
movq $-0x1, %rcx
cmovbq %rcx, %r14
testb %al, %al
cmovneq %rcx, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, %r12
movq %rbx, (%rax)
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq %rbx, 0x30(%rsp)
testl %ebx, %ebx
je 0x2c72
movq 0x30(%rsp), %rbp
imulq $-0x88, %rbp, %r13
xorl %r15d, %r15d
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x5624
addq $-0x88, %r15
addq $0x88, %rbx
cmpq %r15, %r13
jne 0x2a31
testl %ebp, %ebp
jle 0x2c72
movq 0x30(%rsp), %rcx
movq %rcx, %rax
shlq $0x7, %rax
leaq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
xorl %r15d, %r15d
movabsq $0x4053c00000000000, %rbx # imm = 0x4053C00000000000
leaq 0x660(%rsp), %r13
leaq 0xf0(%rsp), %rbp
xorl %r14d, %r14d
movq 0x20(%rsp), %rax
movslq (%rax,%r15), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x18(%rsp), %rsi
leaq 0x2c0(%rsp), %rdi
callq 0x5c94
movq 0x20(%rsp), %rax
movslq 0x4(%rax,%r15), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x18(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x5c94
movq 0x20(%rsp), %rax
movslq 0x8(%rax,%r15), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x18(%rsp), %rsi
leaq 0x290(%rsp), %rdi
callq 0x5c94
movaps 0x35b5(%rip), %xmm0     # 0x60b0
movaps %xmm0, 0xd0(%rsp)
movq %rbx, 0xe0(%rsp)
leaq 0x278(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x5ca6
movaps 0x3581(%rip), %xmm0     # 0x60b0
movaps %xmm0, 0xb0(%rsp)
movq %rbx, 0xc0(%rsp)
leaq 0x260(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x5ca6
movaps 0x354d(%rip), %xmm0     # 0x60b0
movaps %xmm0, 0x90(%rsp)
movq %rbx, 0xa0(%rsp)
movq %r13, %rdi
leaq 0x290(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5ca6
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movaps %xmm0, 0x50(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x60(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
leaq 0x278(%rsp), %rsi
leaq 0x260(%rsp), %rdx
movq %r13, %rcx
xorl %r8d, %r8d
leaq 0x70(%rsp), %r9
callq 0x5658
movl 0xf8(%rsp), %eax
movl %eax, 0x10(%r12,%r14)
leaq (%r12,%r14), %rdi
addq $0x18, %rdi
leaq 0x100(%rsp), %rsi
callq 0x5d7a
leaq (%r12,%r14), %rdi
addq $0x30, %rdi
leaq 0x118(%rsp), %rsi
callq 0x5d7a
leaq (%r12,%r14), %rdi
addq $0x48, %rdi
leaq 0x130(%rsp), %rsi
callq 0x5d7a
leaq (%r12,%r14), %rdi
addq $0x60, %rdi
leaq 0x148(%rsp), %rsi
callq 0x5d7a
leaq (%r12,%r14), %rdi
addq $0x78, %rdi
leaq 0x160(%rsp), %rsi
callq 0x5d7a
movq %rbp, %rdi
callq 0x52e4
addq $0x88, %r14
addq $0xc, %r15
cmpq %r14, 0x48(%rsp)
jne 0x2a89
movl $0x70, %edi
callq 0x2110
movq 0x40(%rsp), %rbx
movq 0x30(%rsp), %r12
movq %rax, %r14
movsd 0x348f(%rip), %xmm0     # 0x6120
leaq 0x380(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $0x4051000000000000, %rax # imm = 0x4051000000000000
movq %rax, 0x10(%rsi)
movaps 0x340f(%rip), %xmm0     # 0x60c0
leaq 0x360(%rsp), %rdx
movaps %xmm0, (%rdx)
movabsq $0x4056000000000000, %rax # imm = 0x4056000000000000
movq %rax, 0x10(%rdx)
movq %r14, %rdi
callq 0x4b98
movl $0x58, %edi
callq 0x2110
movq %rax, %r15
xorps %xmm0, %xmm0
leaq 0x340(%rsp), %r9
movaps %xmm0, (%r9)
movq $0x0, 0x10(%r9)
leaq 0x320(%rsp), %rax
movaps %xmm0, (%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%rax)
movq %rax, (%rsp)
movq %r15, %rdi
movq 0x38(%rsp), %rsi
movq %r14, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x509c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5a3c
leaq 0x10(%rsp), %rdi
callq 0x40c4
addq $0x678, %rsp            # imm = 0x678
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x58, %esi
movq %r15, %rdi
jmp 0x2d68
movq %rax, %rbx
movl $0x70, %esi
movq %r14, %rdi
callq 0x2120
jmp 0x2e06
jmp 0x2df1
jmp 0x2df1
jmp 0x2d78
movq %rax, %rbx
movl $0x88, %esi
jmp 0x2daa
jmp 0x2d8c
jmp 0x2d8c
jmp 0x2d8c
jmp 0x2d8c
jmp 0x2d8c
movq %rax, %rbx
movl $0x70, %esi
jmp 0x2daa
movq %rax, %rbx
movl $0x78, %esi
jmp 0x2daa
jmp 0x2da2
movq %rax, %rbx
movl $0x60, %esi
movq %r14, %rdi
callq 0x2120
jmp 0x2e10
jmp 0x2df1
jmp 0x2df1
jmp 0x2df1
jmp 0x2df1
jmp 0x2df1
jmp 0x2df1
movq %rax, %rbx
testq %r15, %r15
je 0x2de4
negq %r15
movq %r12, %r13
addq $-0x80, %r13
leaq (%r15,%r13), %rdi
callq 0x52e4
addq $-0x88, %r15
jne 0x2dd2
movq %r12, %rdi
movq %r14, %rsi
callq 0x21f0
jmp 0x2e06
movq %rax, %rbx
jmp 0x2e06
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x52e4
leaq 0x10(%rsp), %rdi
callq 0x40c4
movq %rbx, %rdi
callq 0x21c0