// File: Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::from_json(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>)
RenderWorld* RenderWorld::from_json(nlohmann::json json_obj) {
    // Check if the object has an object type
    if (!json_obj.is_object()) {
        throw InvalidObjectFormat("RenderWorld", json::object().type_name(), json_obj.type_name());
    }

    // Parse all the items in this array
    RenderWorld* world = new RenderWorld();

    // Parse the objects field if it exists
    if (!json_obj["objects"].is_null()) {
        // Check if the fields are arrays
        if (!json_obj["objects"].is_array()) {
            delete world;
            throw InvalidFieldFormat("RenderWorld", "objects", json::array().type_name(), json_obj["objects"].type_name());
        }

        // Parse the objects
        for (std::size_t i = 0; i < json_obj["objects"].size(); i++) {
            world->add_object(RenderObject::from_json(json_obj["objects"][i]));
        }
    }
    
    // Parse the init function field
    if (!json_obj["init"].is_null()) {
        // Check if it is a string
        if (!json_obj["init"].is_string()) {
            delete world;
            throw InvalidFieldFormat("RenderWorld", "init", "string", json_obj["init"].type_name());
        }

        cout << "Test 1" << endl;

        // Check if there is a file ending in .so with that name
        std::string path = json_obj["init"].get<std::string>();
        if (FILE* file = fopen(path.c_str(), "r")) {
            fclose(file);
        } else {
            // Doesn't exist
            delete world;
            throw FileIOException("RenderWorld", path, errno);
        }

        cout << "Test 2" << endl;

        // There is, so try to load it using the dl library
        void* handle = dlopen(path.c_str(), RTLD_NOW);
        if (handle == NULL) {
            throw SOLoadException("RenderWorld", path, dlerror());
        }
        void (*init)(const RenderWorld& world) = (void (*)(const RenderWorld& world)) dlsym(handle, "init");
        if (init == NULL) {
            dlclose(handle);
            throw SOFuncLoadException("RenderWorld", path, "init", dlerror());
        }

        cout << "Test 3" << endl;

        // Run the function on the given world
        try {
            (*init)(*world);
        } catch (std::exception& e) {
            dlclose(handle);
            throw SORunException("RenderWorld", path, "init", string(e.what()));
        }

        cout << "Test 4" << endl;

        // Close the library
        //dlclose(handle);

        cout << "Test 5" << endl;
    }

    // Optimize the inner tree
    world->optimize();

    return world;
}

// Assembly:
subq $0x608, %rsp            # imm = 0x608
movq %rdi, 0x1a0(%rsp)
movq %rdi, 0x600(%rsp)
callq 0xd9b20
testb $0x1, %al
jne 0x163549
movb $0x1, 0x55e(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0x190(%rsp)
leaq 0x5df(%rsp), %rdi
movq %rdi, 0x198(%rsp)
callq 0xd0a20
movq 0x198(%rsp), %rdx
leaq 0xda2a(%rip), %rsi      # 0x170d6c
leaq 0x5e0(%rsp), %rdi
callq 0xd8b80
jmp 0x163351
leaq 0x588(%rsp), %rdi
callq 0x155e60
movq 0x588(%rsp), %rsi
movq 0x590(%rsp), %rdx
leaq 0x598(%rsp), %rdi
callq 0x15a2a0
jmp 0x16337d
leaq 0x598(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x180(%rsp)
leaq 0x587(%rsp), %rdi
movq %rdi, 0x188(%rsp)
callq 0xd0a20
movq 0x180(%rsp), %rsi
movq 0x188(%rsp), %rdx
leaq 0x5a8(%rsp), %rdi
callq 0xd8b80
jmp 0x1633c6
movq 0x1a0(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x170(%rsp)
leaq 0x55f(%rsp), %rdi
movq %rdi, 0x178(%rsp)
callq 0xd0a20
movq 0x170(%rsp), %rsi
movq 0x178(%rsp), %rdx
leaq 0x560(%rsp), %rdi
callq 0xd8b80
jmp 0x16340f
movq 0x190(%rsp), %rdi
leaq 0x5e0(%rsp), %rsi
leaq 0x5a8(%rsp), %rdx
leaq 0x560(%rsp), %rcx
callq 0x156180
jmp 0x163436
movq 0x190(%rsp), %rdi
movb $0x0, 0x55e(%rsp)
leaq 0x48023(%rip), %rsi     # 0x1ab470
leaq -0xd0c4(%rip), %rdx     # 0x156390
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x16351e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1634f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1634dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x560(%rsp), %rdi
callq 0xd0b38
leaq 0x55f(%rsp), %rdi
callq 0xd0630
leaq 0x5a8(%rsp), %rdi
callq 0xd0b38
leaq 0x587(%rsp), %rdi
callq 0xd0630
leaq 0x598(%rsp), %rdi
callq 0xd9f30
leaq 0x5e0(%rsp), %rdi
callq 0xd0b38
leaq 0x5df(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x55e(%rsp)
jne 0x163537
jmp 0x163544
movq 0x190(%rsp), %rdi
callq 0xd0430
jmp 0x164666
movl $0x10, %edi
callq 0xd05d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x168(%rsp)
callq 0x1629c0
jmp 0x163568
movq 0x1a0(%rsp), %rdi
movq 0x168(%rsp), %rax
movq %rax, 0x550(%rsp)
leaq 0xdd3f(%rip), %rsi      # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
callq 0xd9da0
testb $0x1, %al
jne 0x163a0a
movq 0x1a0(%rsp), %rdi
leaq 0xdd1b(%rip), %rsi      # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
callq 0xefa20
testb $0x1, %al
jne 0x1638f6
movq 0x550(%rsp), %rax
movq %rax, 0x160(%rsp)
cmpq $0x0, %rax
je 0x1635e4
movq 0x160(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movb $0x1, 0x496(%rsp)
movl $0xa8, %edi
callq 0xd02b0
movq %rax, 0x150(%rsp)
leaq 0x52f(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0xd0a20
movq 0x158(%rsp), %rdx
leaq 0xd74a(%rip), %rsi      # 0x170d6c
leaq 0x530(%rsp), %rdi
callq 0xd8b80
jmp 0x163631
leaq 0x507(%rsp), %rdi
movq %rdi, 0x148(%rsp)
callq 0xd0a20
movq 0x148(%rsp), %rdx
leaq 0xdc71(%rip), %rsi      # 0x1712c6
leaq 0x508(%rsp), %rdi
callq 0xd8b80
jmp 0x163664
leaq 0x4c0(%rsp), %rdi
callq 0x155e60
movq 0x4c0(%rsp), %rsi
movq 0x4c8(%rsp), %rdx
leaq 0x4d0(%rsp), %rdi
callq 0x155e10
jmp 0x163690
leaq 0x4d0(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x138(%rsp)
leaq 0x4bf(%rsp), %rdi
movq %rdi, 0x140(%rsp)
callq 0xd0a20
movq 0x138(%rsp), %rsi
movq 0x140(%rsp), %rdx
leaq 0x4e0(%rsp), %rdi
callq 0xd8b80
jmp 0x1636d9
movq 0x1a0(%rsp), %rdi
leaq 0xdbde(%rip), %rsi      # 0x1712c6
callq 0xd9b40
movq %rax, 0x130(%rsp)
jmp 0x1636f7
movq 0x130(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x120(%rsp)
leaq 0x497(%rsp), %rdi
movq %rdi, 0x128(%rsp)
callq 0xd0a20
movq 0x120(%rsp), %rsi
movq 0x128(%rsp), %rdx
leaq 0x498(%rsp), %rdi
callq 0xd8b80
jmp 0x163740
movq 0x150(%rsp), %rdi
leaq 0x530(%rsp), %rsi
leaq 0x508(%rsp), %rdx
leaq 0x4e0(%rsp), %rcx
leaq 0x498(%rsp), %r8
callq 0x15a4a0
jmp 0x16376f
movq 0x150(%rsp), %rdi
movb $0x0, 0x496(%rsp)
leaq 0x47e52(%rip), %rsi     # 0x1ab5d8
leaq -0x8fed(%rip), %rdx     # 0x15a7a0
callq 0xd09b0
jmp 0x16467b
movq 0x168(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
movl $0x10, %esi
callq 0xd05e0
jmp 0x164666
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1638cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1638b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1638a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x16388a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x16387d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163870
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x498(%rsp), %rdi
callq 0xd0b38
leaq 0x497(%rsp), %rdi
callq 0xd0630
leaq 0x4e0(%rsp), %rdi
callq 0xd0b38
leaq 0x4bf(%rsp), %rdi
callq 0xd0630
leaq 0x4d0(%rsp), %rdi
callq 0xd9f30
leaq 0x508(%rsp), %rdi
callq 0xd0b38
leaq 0x507(%rsp), %rdi
callq 0xd0630
leaq 0x530(%rsp), %rdi
callq 0xd0b38
leaq 0x52f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x496(%rsp)
jne 0x1638e4
jmp 0x1638f1
movq 0x150(%rsp), %rdi
callq 0xd0430
jmp 0x164666
movq $0x0, 0x488(%rsp)
movq 0x1a0(%rsp), %rdi
movq 0x488(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0xd9a5(%rip), %rsi      # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
callq 0x12ec20
movq %rax, %rcx
movq 0x118(%rsp), %rax
cmpq %rcx, %rax
jae 0x163a08
movq 0x1a0(%rsp), %rdi
movq 0x550(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0xd965(%rip), %rsi      # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
movq 0x488(%rsp), %rsi
callq 0x155ed0
movq %rax, %rsi
leaq 0x478(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0xd9dc0
movq 0x108(%rsp), %rdi
callq 0x159890
movq %rax, 0x110(%rsp)
jmp 0x1639a5
movq 0x110(%rsp), %rsi
movq 0x100(%rsp), %rdi
callq 0x162b90
jmp 0x1639bc
leaq 0x478(%rsp), %rdi
callq 0xd9f30
movq 0x488(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x488(%rsp)
jmp 0x163902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x478(%rsp), %rdi
callq 0xd9f30
jmp 0x164666
jmp 0x163a0a
movq 0x1a0(%rsp), %rdi
leaq 0x1470f(%rip), %rsi     # 0x178128
callq 0xd9b40
movq %rax, %rdi
callq 0xd9da0
testb $0x1, %al
jne 0x164649
movq 0x1a0(%rsp), %rdi
leaq 0x146eb(%rip), %rsi     # 0x178128
callq 0xd9b40
movq %rax, %rdi
callq 0x130060
testb $0x1, %al
jne 0x163cf5
movq 0x550(%rsp), %rax
movq %rax, 0xf8(%rsp)
cmpq $0x0, %rax
je 0x163a76
movq 0xf8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movb $0x1, 0x3de(%rsp)
movl $0xa8, %edi
callq 0xd02b0
movq %rax, 0xe8(%rsp)
leaq 0x457(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0xd0a20
movq 0xf0(%rsp), %rdx
leaq 0xd2b8(%rip), %rsi      # 0x170d6c
leaq 0x458(%rsp), %rdi
callq 0xd8b80
jmp 0x163ac3
leaq 0x42f(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0xd0a20
movq 0xe0(%rsp), %rdx
leaq 0x14641(%rip), %rsi     # 0x178128
leaq 0x430(%rsp), %rdi
callq 0xd8b80
jmp 0x163af6
leaq 0x407(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0xd0a20
movq 0xd8(%rsp), %rdx
leaq 0x10058(%rip), %rsi     # 0x173b72
leaq 0x408(%rsp), %rdi
callq 0xd8b80
jmp 0x163b29
movq 0x1a0(%rsp), %rdi
leaq 0x145f0(%rip), %rsi     # 0x178128
callq 0xd9b40
movq %rax, 0xd0(%rsp)
jmp 0x163b47
movq 0xd0(%rsp), %rdi
callq 0x1302d0
movq %rax, 0xc0(%rsp)
leaq 0x3df(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0xd0a20
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x3e0(%rsp), %rdi
callq 0xd8b80
jmp 0x163b90
movq 0xe8(%rsp), %rdi
leaq 0x458(%rsp), %rsi
leaq 0x430(%rsp), %rdx
leaq 0x408(%rsp), %rcx
leaq 0x3e0(%rsp), %r8
callq 0x15a4a0
jmp 0x163bbf
movq 0xe8(%rsp), %rdi
movb $0x0, 0x3de(%rsp)
leaq 0x47a02(%rip), %rsi     # 0x1ab5d8
leaq -0x943d(%rip), %rdx     # 0x15a7a0
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163cca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163cb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163c96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163c89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163c7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0xd0b38
leaq 0x3df(%rsp), %rdi
callq 0xd0630
leaq 0x408(%rsp), %rdi
callq 0xd0b38
leaq 0x407(%rsp), %rdi
callq 0xd0630
leaq 0x430(%rsp), %rdi
callq 0xd0b38
leaq 0x42f(%rsp), %rdi
callq 0xd0630
leaq 0x458(%rsp), %rdi
callq 0xd0b38
leaq 0x457(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x3de(%rsp)
jne 0x163ce3
jmp 0x163cf0
movq 0xe8(%rsp), %rdi
callq 0xd0430
jmp 0x164666
movq 0x4828c(%rip), %rdi     # 0x1abf88
leaq 0x1442a(%rip), %rsi     # 0x17812d
callq 0xd05b0
movq %rax, %rdi
movq 0x48226(%rip), %rsi     # 0x1abf38
callq 0xd0610
movq 0x1a0(%rsp), %rdi
leaq 0x14402(%rip), %rsi     # 0x178128
callq 0xd9b40
movq %rax, %rsi
leaq 0x3b8(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x1646d0
movq 0xb0(%rsp), %rdi
callq 0xd0220
movq %rax, %rdi
leaq 0xef2e(%rip), %rsi      # 0x172c88
callq 0xd06d0
movq %rax, 0xb8(%rsp)
jmp 0x163d69
movq 0xb8(%rsp), %rax
movq %rax, 0x3b0(%rsp)
cmpq $0x0, 0x3b0(%rsp)
je 0x163db1
movq 0x3b0(%rsp), %rdi
callq 0xd05c0
jmp 0x163d93
jmp 0x163f0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x16463a
movq 0x550(%rsp), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x163dd5
movq 0xa8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movb $0x1, 0x367(%rsp)
movl $0x70, %edi
callq 0xd02b0
movq %rax, 0x98(%rsp)
leaq 0x38f(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0xd0a20
movq 0xa0(%rsp), %rdx
leaq 0xcf59(%rip), %rsi      # 0x170d6c
leaq 0x390(%rsp), %rdi
callq 0xd8b80
jmp 0x163e22
leaq 0x368(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0xd0250
jmp 0x163e39
callq 0xd0090
movq 0x98(%rsp), %rdi
movl (%rax), %ecx
leaq 0x390(%rsp), %rsi
leaq 0x368(%rsp), %rdx
callq 0x164760
jmp 0x163e5f
movq 0x98(%rsp), %rdi
movb $0x0, 0x367(%rsp)
leaq 0x47a22(%rip), %rsi     # 0x1ab898
leaq 0xab3(%rip), %rdx       # 0x164930
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163ee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x163ed4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x368(%rsp), %rdi
callq 0xd0b38
leaq 0x390(%rsp), %rdi
callq 0xd0b38
leaq 0x38f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x367(%rsp)
jne 0x163efa
jmp 0x163f07
movq 0x98(%rsp), %rdi
callq 0xd0430
jmp 0x16463a
movq 0x48075(%rip), %rdi     # 0x1abf88
leaq 0x1421a(%rip), %rsi     # 0x178134
callq 0xd05b0
movq %rax, 0x90(%rsp)
jmp 0x163f29
movq 0x90(%rsp), %rdi
movq 0x48000(%rip), %rsi     # 0x1abf38
callq 0xd0610
jmp 0x163f3f
leaq 0x3b8(%rsp), %rdi
callq 0xd0220
movq %rax, %rdi
movl $0x2, %esi
callq 0xd07f0
movq %rax, 0x358(%rsp)
cmpq $0x0, 0x358(%rsp)
jne 0x16410d
movb $0x1, 0x2ee(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0x80(%rsp)
leaq 0x337(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0xd0a20
movq 0x88(%rsp), %rdx
leaq 0xcdbe(%rip), %rsi      # 0x170d6c
leaq 0x338(%rsp), %rdi
callq 0xd8b80
jmp 0x163fbd
leaq 0x310(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0xd0250
jmp 0x163fd4
callq 0xd0580
movq %rax, 0x70(%rsp)
leaq 0x2ef(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0xd0a20
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x2f0(%rsp), %rdi
callq 0xd8b80
jmp 0x164009
movq 0x80(%rsp), %rdi
leaq 0x338(%rsp), %rsi
leaq 0x310(%rsp), %rdx
leaq 0x2f0(%rsp), %rcx
callq 0x164940
jmp 0x164030
movq 0x80(%rsp), %rdi
movb $0x0, 0x2ee(%rsp)
leaq 0x47869(%rip), %rsi     # 0x1ab8b0
leaq 0xae2(%rip), %rdx       # 0x164b30
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1640e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1640d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1640bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x2f0(%rsp), %rdi
callq 0xd0b38
leaq 0x2ef(%rsp), %rdi
callq 0xd0630
leaq 0x310(%rsp), %rdi
callq 0xd0b38
leaq 0x338(%rsp), %rdi
callq 0xd0b38
leaq 0x337(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x2ee(%rsp)
jne 0x1640fb
jmp 0x164108
movq 0x80(%rsp), %rdi
callq 0xd0430
jmp 0x16463a
movq 0x358(%rsp), %rdi
leaq 0x1400c(%rip), %rsi     # 0x178128
callq 0xd0570
movq %rax, 0x2e0(%rsp)
cmpq $0x0, 0x2e0(%rsp)
jne 0x16433b
movq 0x358(%rsp), %rdi
callq 0xd04b0
movb $0x1, 0x24e(%rsp)
movl $0xc8, %edi
callq 0xd02b0
movq %rax, 0x60(%rsp)
leaq 0x2bf(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xd0a20
movq 0x68(%rsp), %rdx
leaq 0xcbf2(%rip), %rsi      # 0x170d6c
leaq 0x2c0(%rsp), %rdi
callq 0xd8b80
jmp 0x164189
leaq 0x298(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0xd0250
jmp 0x1641a0
leaq 0x277(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xd0a20
movq 0x58(%rsp), %rdx
leaq 0x13f6a(%rip), %rsi     # 0x178128
leaq 0x278(%rsp), %rdi
callq 0xd8b80
jmp 0x1641cd
callq 0xd0580
movq %rax, 0x48(%rsp)
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xd0a20
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x250(%rsp), %rdi
callq 0xd8b80
jmp 0x164202
movq 0x60(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
leaq 0x298(%rsp), %rdx
leaq 0x278(%rsp), %rcx
leaq 0x250(%rsp), %r8
callq 0x164b70
jmp 0x16422e
movq 0x60(%rsp), %rdi
movb $0x0, 0x24e(%rsp)
leaq 0x47686(%rip), %rsi     # 0x1ab8c8
leaq 0xcb7(%rip), %rdx       # 0x164f00
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x164313
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x164306
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1642ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1642d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x250(%rsp), %rdi
callq 0xd0b38
leaq 0x24f(%rsp), %rdi
callq 0xd0630
leaq 0x278(%rsp), %rdi
callq 0xd0b38
leaq 0x277(%rsp), %rdi
callq 0xd0630
leaq 0x298(%rsp), %rdi
callq 0xd0b38
leaq 0x2c0(%rsp), %rdi
callq 0xd0b38
leaq 0x2bf(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x24e(%rsp)
jne 0x16432c
jmp 0x164336
movq 0x60(%rsp), %rdi
callq 0xd0430
jmp 0x16463a
movq 0x47c46(%rip), %rdi     # 0x1abf88
leaq 0x13df2(%rip), %rsi     # 0x17813b
callq 0xd05b0
movq %rax, 0x40(%rsp)
jmp 0x164355
movq 0x40(%rsp), %rdi
movq 0x47bd7(%rip), %rsi     # 0x1abf38
callq 0xd0610
jmp 0x164368
movq 0x2e0(%rsp), %rax
movq 0x550(%rsp), %rdi
callq *%rax
jmp 0x16437c
jmp 0x1645d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
movl 0x5cc(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x16463a
movq 0x5d0(%rsp), %rdi
callq 0xd0210
movq %rax, 0x240(%rsp)
movq 0x358(%rsp), %rdi
callq 0xd04b0
movb $0x1, 0x1ae(%rsp)
movl $0xa8, %edi
callq 0xd02b0
movq %rax, 0x30(%rsp)
leaq 0x21f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xd0a20
movq 0x38(%rsp), %rdx
leaq 0xc96c(%rip), %rsi      # 0x170d6c
leaq 0x220(%rsp), %rdi
callq 0xd8b80
jmp 0x16440f
leaq 0x1f8(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0xd0250
jmp 0x164426
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xd0a20
movq 0x28(%rsp), %rdx
leaq 0x13ce4(%rip), %rsi     # 0x178128
leaq 0x1d8(%rsp), %rdi
callq 0xd8b80
jmp 0x164453
movq 0x240(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x18(%rsp)
leaq 0x1af(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xd0a20
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x1b0(%rsp), %rdi
callq 0xd8b80
jmp 0x164494
movq 0x30(%rsp), %rdi
leaq 0x220(%rsp), %rsi
leaq 0x1f8(%rsp), %rdx
leaq 0x1d8(%rsp), %rcx
leaq 0x1b0(%rsp), %r8
callq 0x164f50
jmp 0x1644c0
movq 0x30(%rsp), %rdi
movb $0x0, 0x1ae(%rsp)
leaq 0x4740c(%rip), %rsi     # 0x1ab8e0
leaq 0xd65(%rip), %rdx       # 0x165240
callq 0xd09b0
jmp 0x16467b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x1645a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x164598
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x16457e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
jmp 0x164564
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x5d0(%rsp)
movl %eax, 0x5cc(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0xd0b38
leaq 0x1af(%rsp), %rdi
callq 0xd0630
leaq 0x1d8(%rsp), %rdi
callq 0xd0b38
leaq 0x1d7(%rsp), %rdi
callq 0xd0630
leaq 0x1f8(%rsp), %rdi
callq 0xd0b38
leaq 0x220(%rsp), %rdi
callq 0xd0b38
leaq 0x21f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x1ae(%rsp)
jne 0x1645be
jmp 0x1645c8
movq 0x30(%rsp), %rdi
callq 0xd0430
callq 0xd0940
jmp 0x1645cf
jmp 0x16463a
movq 0x479b0(%rip), %rdi     # 0x1abf88
leaq 0x13b63(%rip), %rsi     # 0x178142
callq 0xd05b0
movq %rax, 0x10(%rsp)
jmp 0x1645eb
movq 0x10(%rsp), %rdi
movq 0x47941(%rip), %rsi     # 0x1abf38
callq 0xd0610
jmp 0x1645fe
movq 0x47983(%rip), %rdi     # 0x1abf88
leaq 0x13b3d(%rip), %rsi     # 0x178149
callq 0xd05b0
movq %rax, 0x8(%rsp)
jmp 0x164618
movq 0x8(%rsp), %rdi
movq 0x47914(%rip), %rsi     # 0x1abf38
callq 0xd0610
jmp 0x16462b
leaq 0x3b8(%rsp), %rdi
callq 0xd0b38
jmp 0x164649
leaq 0x3b8(%rsp), %rdi
callq 0xd0b38
jmp 0x164666
movq 0x550(%rsp), %rdi
callq 0x163030
movq 0x550(%rsp), %rax
addq $0x608, %rsp            # imm = 0x608
retq
movq 0x5d0(%rsp), %rdi
callq 0xd0a10
movq %rax, %rdi
callq 0xd9890
nopl (%rax,%rax)