// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/dinit.cc
// Function: dinit_main(int, char**)
int dinit_main(int argc, char **argv)
{
    using namespace std;
    
    am_system_mgr = (getpid() == 1);
    am_system_init = (getuid() == 0);
    
    struct options opts;

    // if we are PID 1 and user id 0, we are *most probably* the system init. (Or on linux at least, we
    // could instead be in a container; then we expect -o argument and unset this then).
    opts.process_sys_args = am_system_mgr && am_system_init;

    const char * &env_file = opts.env_file;
    bool &control_socket_path_set = opts.control_socket_path_set;
    bool &env_file_set = opts.env_file_set;
    bool &log_specified = opts.log_specified;
    service_dir_opt &service_dir_opts = opts.service_dir_opts;
    list<const char *> &services_to_start = opts.services_to_start;

    for (int i = 1; i < argc; i++) {
        int p = process_commandline_arg(argv, argc, i, opts);
        if (p == -1) {
            // clean exit
            return 0;
        }
        if (p == 1) {
            // error exit
            return 1;
        }
    }

    if (am_system_mgr) {
        // setup STDIN, STDOUT, STDERR so that we can use them
        int onefd = open("/dev/console", O_RDONLY, 0);
        if (onefd != -1) {
            dup2(onefd, 0);
        }
        int twofd = open("/dev/console", O_RDWR, 0);
        if (twofd != -1) {
            dup2(twofd, 1);
            dup2(twofd, 2);
        }
        
        if (onefd > 2) close(onefd);
        if (twofd > 2) close(twofd);

        if (! env_file_set) {
            env_file = env_file_path;
        }

        // we will assume an empty cgroups root path
        #if SUPPORT_CGROUPS
        have_cgroups_path = true;
        #endif
    }

    /* Set up signal handlers etc */
    sigset_t sigwait_set;
    if (am_system_mgr) {
        // Block all signals in system manager mode - don't want to chance provoking a signal that
        // will suspend or terminate the process
        sigfillset(&sigwait_set);
    }
    else {
        sigemptyset(&sigwait_set);
        sigaddset(&sigwait_set, SIGCHLD);
        sigaddset(&sigwait_set, SIGINT);
        sigaddset(&sigwait_set, SIGTERM);
    }
    sigprocmask(SIG_BLOCK, &sigwait_set, &orig_signal_mask);

    // Terminal access control signals - we ignore these so that dinit can't be
    // suspended if it writes to the terminal after some other process has claimed
    // ownership of it.
    signal(SIGTSTP, SIG_IGN);
    signal(SIGTTIN, SIG_IGN);
    signal(SIGTTOU, SIG_IGN);
    
    signal(SIGPIPE, SIG_IGN);
    
    event_loop.init();

    if (!am_system_init && !control_socket_path_set) {
        const char * rundir = getenv("XDG_RUNTIME_DIR");
        const char * sockname = "dinitctl";
        if (rundir == nullptr) {
            rundir = service_dir_opt::get_user_home();
            sockname = ".dinitctl";
        }
        if (rundir != nullptr) {
            control_socket_str = rundir;
            control_socket_str.push_back('/');
            control_socket_str += sockname;
            control_socket_path = control_socket_str.c_str();
        }
    }
    
    if (services_to_start.empty()) {
        services_to_start.push_back("boot");
    }

    // Set up signal handlers
    callback_signal_handler sigterm_watcher {sigterm_cb};
    callback_signal_handler sigint_watcher;
    callback_signal_handler sigquit_watcher;

    if (am_system_mgr) {
        sigint_watcher.set_cb_func(sigint_reboot_cb);
        sigquit_watcher.set_cb_func(sigquit_cb);
    }
    else {
        sigint_watcher.set_cb_func(sigterm_cb);
    }

    sigint_watcher.add_watch(event_loop, SIGINT);
    sigterm_watcher.add_watch(event_loop, SIGTERM);
    
    if (am_system_mgr) {
        // PID 1: we may ask for console input; SIGQUIT exec's shutdown
        console_input_io.add_watch(event_loop, STDIN_FILENO, dasynq::IN_EVENTS, false);
        sigquit_watcher.add_watch(event_loop, SIGQUIT);
        // (If not PID 1, we instead just let SIGQUIT perform the default action.)
    }

    init_log(log_is_syslog);
    log_flush_timer.add_timer(event_loop, dasynq::clock_type::MONOTONIC);

    #if SUPPORT_CGROUPS
    if (!have_cgroups_path) {
        find_cgroup_path();
        // We will press on if the cgroup root path could not be identified, since services might
        // not require cgroups anyway and/or might only specify absolute cgroups paths.
    }
    #endif

    // Try to open control socket (may fail due to readonly filesystem, we ignore that if we are
    // system init)
    if (!open_control_socket(!am_system_init)) {
        flush_log();
        return EXIT_FAILURE;
    }
    
#ifdef __linux__
    if (am_system_mgr) {
        // Disable non-critical kernel output to console
        klogctl(6 /* SYSLOG_ACTION_CONSOLE_OFF */, nullptr, 0);
        // Make ctrl+alt+del combination send SIGINT to PID 1 (this process)
        reboot(RB_DISABLE_CAD);
    }

    // Mark ourselves as a subreaper. This means that if a process we start double-forks, the
    // orphaned child will re-parent to us rather than to PID 1 (although that could be us too).
    prctl(PR_SET_CHILD_SUBREAPER, 1);
#elif defined(__FreeBSD__) || defined(__DragonFly__)
    // Documentation (man page) for this kind-of sucks. PROC_REAP_ACQUIRE "acquires the reaper status for
    // the current process" but does that mean the first two arguments still need valid values to be
    // supplied? We'll play it safe and explicitly target our own process:
    procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL);
#endif
    
    service_dir_opts.build_paths(am_system_init);

    // Start requested services

    services = new dirload_service_set(std::move(service_dir_opts.get_paths()));

    setup_log_console_handoff(services);

    if (am_system_init) {
        log(loglevel_t::NOTICE, false, "Starting system");
    }
    
    // If a log file was specified, open it now.
    if (log_specified) {
        setup_external_log();
        if (!am_system_init && !external_log_open) {
            flush_log(); // flush console messages
            return EXIT_FAILURE;
        }
    }

    if (env_file != nullptr) {
        read_env_file(env_file, true, main_env, false);
    }

    for (auto svc : services_to_start) {
        try {
            services->start_service(svc);
            // Note in general if we fail to start a service we don't need any special error handling,
            // since we either leave other services running or, if it was the only service, then no
            // services will be running and we will process normally (reboot if system process,
            // exit if user process).
        }
        catch (service_not_found &snf) {
            log(loglevel_t::ERROR, snf.service_name, ": could not find service description.");
        }
        catch (service_description_exc &sde) {
            log_service_load_failure(sde);
        }
        catch (service_load_exc &sle) {
            log(loglevel_t::ERROR, sle.service_name, ": error loading: ", sle.exc_description);
        }
        catch (std::bad_alloc &badalloce) {
            log(loglevel_t::ERROR, "Out of memory when trying to start service: ", svc, ".");
            break;
        }
    }

    // Notify readiness just before the event loop starts (and after services
    // are scheduled to start). If the socket is not ready yet (may be in case
    // of read-only file system), we will report it when it is.
    control_socket_ready();
    
    run_event_loop:
    
    // Process events until all services have terminated.
    while (services->count_active_services() != 0) {
        event_loop.run();
    }

    shutdown_type_t shutdown_type = services->get_shutdown_type();
    if (shutdown_type == shutdown_type_t::REMAIN) {
        goto run_event_loop;
    }
    
    if (am_system_mgr) {
        log_msg_begin(loglevel_t::NOTICE, "No more active services.");
        
        if (shutdown_type == shutdown_type_t::REBOOT) {
            log_msg_end(" Will reboot.");
        }
        if (shutdown_type == shutdown_type_t::SOFTREBOOT) {
            log_msg_end(" Will soft-reboot.");
        }
        else if (shutdown_type == shutdown_type_t::HALT) {
            log_msg_end(" Will halt.");
        }
        else if (shutdown_type == shutdown_type_t::POWEROFF) {
            log_msg_end(" Will power down.");
        }
        else if (shutdown_type == shutdown_type_t::KEXEC) {
            log_msg_end(" Will kexec.");
        }
        else if (shutdown_type == shutdown_type_t::NONE) {
            log_msg_end(" Will handle boot failure.");
        }
    }

    flush_log();
    bool need_log_flush = false;
    close_control_socket();
    
    if (am_system_mgr) {
        if (shutdown_type == shutdown_type_t::SOFTREBOOT) {
            sync(); // Sync to minimise data loss in case soft-boot fails

            execv(dinit_exec, argv);
            log(loglevel_t::ERROR, error_exec_dinit, strerror(errno));

            // if we get here, soft reboot failed; reboot normally
            log(loglevel_t::ERROR, "Could not soft-reboot. Will attempt reboot.");
            shutdown_type = shutdown_type_t::REBOOT;
            need_log_flush = true;
        }

        if (shutdown_type == shutdown_type_t::NONE) {
            // Services all stopped but there was no shutdown issued. Inform user, wait for ack, and
            // re-start boot sequence.
            sync(); // Sync to minimise data loss if user elects to power off / hard reset
            if (auto_recovery) {
                try {
                    services->start_service("recovery");
                }
                catch (std::exception &exc) {
                    log(loglevel_t::ERROR, "Unable to start recovery service: ", exc.what());
                    // As the following prompt UI could be inaccessible flush the log again already
                    flush_log();
                }
            }
            confirm_restart_boot();
            if (services->count_active_services() != 0) {
                // Recovery service started
                goto run_event_loop;
            }
            shutdown_type = services->get_shutdown_type();
            if (shutdown_type == shutdown_type_t::NONE) {
                try {
                    services->start_service("boot");
                    goto run_event_loop; // yes, the "evil" goto
                }
                catch (...) {
                    // Couldn't start boot service, let's reboot the system
                    log(loglevel_t::ERROR, "Could not start 'boot' service. Will attempt reboot.");
                    need_log_flush = true;
                    shutdown_type = shutdown_type_t::REBOOT;
                }
            }
        }
        
        if (need_log_flush) {
            // In case of error since the log was previously flushed, flush again now
            flush_log();
        }

        const char * cmd_arg;
        if (shutdown_type == shutdown_type_t::HALT) {
            cmd_arg = "-h";
        }
        else if (shutdown_type == shutdown_type_t::REBOOT) {
            cmd_arg = "-r";
        }
        else if (shutdown_type == shutdown_type_t::KEXEC) {
            cmd_arg = "-k";
        }
        else {
            // power off.
            cmd_arg = "-p";
        }
        
        // Fork and execute dinit-reboot.
        execl(shutdown_exec.c_str(), shutdown_exec.c_str(), "--system", cmd_arg, nullptr);
        log(loglevel_t::ERROR, error_exec_sd, strerror(errno));
        
        // PID 1 must not actually exit, although we should never reach this point:
        while (true) {
            event_loop.run();
        }
    }
    else if (shutdown_type == shutdown_type_t::REBOOT) {
        // Non-system-process. If we got SIGINT, let's die due to it:
        sigset_t sigwait_set_int;
        sigemptyset(&sigwait_set_int);
        sigaddset(&sigwait_set_int, SIGINT);
        raise(SIGINT);
        sigprocmask(SIG_UNBLOCK, &sigwait_set_int, NULL);
    }
    
    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rsi, 0x8(%rsp)
movl %edi, %r12d
callq 0x8930
cmpl $0x1, %eax
sete 0x3d82c(%rip)           # 0x46d10
callq 0x82d0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
sete 0x3d81a(%rip)           # 0x46d11
leaq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x68(%rsp), %rdx
xorl %eax, %eax
movq %rax, -0x40(%rdx)
movl $0x0, -0x38(%rdx)
movq %rdx, 0x8(%rdx)
movq %rdx, (%rdx)
movq %rax, 0x10(%rdx)
cmpb $0x0, 0x3d7e2(%rip)     # 0x46d10
cmovel %eax, %ecx
movb %cl, -0x35(%rdx)
movl $0x1, 0x80(%rsp)
cmpl $0x2, %r12d
setge %bl
jl 0x9d56
movl $0x1, %r13d
leaq 0x1a8(%rsp), %rbp
movq 0x8(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movl %r12d, 0x2f8(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, 0x250(%rsp)
leaq 0x2f8(%rsp), %rcx
movq %rcx, 0x258(%rsp)
movq %rbp, 0x260(%rsp)
movslq %r13d, %r14
movq (%rax,%r14,8), %r15
movzbl (%r15), %eax
testl %eax, %eax
je 0x98bb
cmpl $0x2d, %eax
jne 0x98cc
movq %r15, %rdi
leaq 0x29cd8(%rip), %rsi     # 0x33295
callq 0x8880
testl %eax, %eax
je 0x991b
movq %r15, %rdi
leaq 0x29ccc(%rip), %rsi     # 0x332a0
callq 0x8880
testl %eax, %eax
je 0x991b
movq %r15, %rdi
leaq 0x29ce7(%rip), %rsi     # 0x332d2
callq 0x8880
testl %eax, %eax
je 0x9960
movq %r15, %rdi
leaq 0x29cdf(%rip), %rsi     # 0x332e1
callq 0x8880
testl %eax, %eax
je 0x9960
movq %r15, %rdi
leaq 0x29bd8(%rip), %rsi     # 0x331f1
callq 0x8880
testl %eax, %eax
je 0x99b7
movq %r15, %rdi
leaq 0x29ce7(%rip), %rsi     # 0x33317
callq 0x8880
testl %eax, %eax
je 0x99b7
movq %r15, %rdi
leaq 0x29cd3(%rip), %rsi     # 0x3331a
callq 0x8880
testl %eax, %eax
je 0x99c0
movq %r15, %rdi
leaq 0x29cc9(%rip), %rsi     # 0x33327
callq 0x8880
testl %eax, %eax
je 0x99c0
movq %r15, %rdi
leaq 0x29cb5(%rip), %rsi     # 0x3332a
callq 0x8880
testl %eax, %eax
je 0x99ce
movq %r15, %rdi
leaq 0x29ca5(%rip), %rsi     # 0x33331
callq 0x8880
testl %eax, %eax
je 0x99ce
movq %r15, %rdi
leaq 0x29c91(%rip), %rsi     # 0x33334
callq 0x8880
testl %eax, %eax
je 0x99d7
movq %r15, %rdi
leaq 0x29c86(%rip), %rsi     # 0x33340
callq 0x8880
testl %eax, %eax
je 0x99d7
movq %r15, %rdi
leaq 0x29c72(%rip), %rsi     # 0x33343
callq 0x8880
testl %eax, %eax
je 0x99e5
movq %r15, %rdi
leaq 0x29b00(%rip), %rsi     # 0x331e8
callq 0x8880
testl %eax, %eax
je 0x99e5
movq %r15, %rdi
leaq 0x29c54(%rip), %rsi     # 0x33353
callq 0x8880
testl %eax, %eax
je 0x9a41
movq %r15, %rdi
leaq 0x29ad8(%rip), %rsi     # 0x331ee
callq 0x8880
testl %eax, %eax
je 0x9a41
movq %r15, %rdi
leaq 0x29c66(%rip), %rsi     # 0x33393
callq 0x8880
testl %eax, %eax
je 0x9a8f
movq %r15, %rdi
leaq 0x29c5a(%rip), %rsi     # 0x3339e
callq 0x8880
testl %eax, %eax
je 0x9a8f
movq %r15, %rdi
leaq 0x29ce8(%rip), %rsi     # 0x33443
callq 0x8880
testl %eax, %eax
je 0x9b23
movq %r15, %rdi
leaq 0x29cdc(%rip), %rsi     # 0x3344e
callq 0x8880
testl %eax, %eax
je 0x9b23
movq %r15, %rdi
leaq 0x29cf7(%rip), %rsi     # 0x33480
callq 0x8880
testl %eax, %eax
je 0x9b78
movq %r15, %rdi
leaq 0x29ce8(%rip), %rsi     # 0x33488
callq 0x8880
testl %eax, %eax
je 0x9b78
movq %r15, %rdi
leaq 0x29cd4(%rip), %rsi     # 0x3348b
callq 0x8880
testl %eax, %eax
je 0x9c03
movq %r15, %rdi
leaq 0x29ccd(%rip), %rsi     # 0x3349b
callq 0x8880
testl %eax, %eax
je 0x9c89
movq %r15, %rdi
leaq 0x29cc2(%rip), %rsi     # 0x334a7
callq 0x8880
testl %eax, %eax
je 0x9c3d
movq %r15, %rdi
leaq 0x29cb9(%rip), %rsi     # 0x334b5
callq 0x8880
testl %eax, %eax
je 0x9c3d
movq %r15, %rdi
leaq 0x29cd7(%rip), %rsi     # 0x334ea
callq 0x8880
testl %eax, %eax
je 0x9cce
movq %r15, %rdi
leaq 0x29cca(%rip), %rsi     # 0x334f4
callq 0x8880
testl %eax, %eax
je 0x9cce
movq %r15, %rdi
leaq 0x29ce4(%rip), %rsi     # 0x33525
callq 0x8880
testl %eax, %eax
je 0x9d23
movq %r15, %rdi
leaq 0x29cd7(%rip), %rsi     # 0x3352f
callq 0x8880
testl %eax, %eax
je 0x9d33
cmpb $0x0, 0x33(%rsp)
jne 0x99ec
movl $0x1c, %edx
movq 0x3c76c(%rip), %rdi     # 0x45fe8
leaq 0x2a1ce(%rip), %rsi     # 0x33a51
callq 0x86c0
movq 0x1a8(%rsp), %rax
movslq 0x80(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x3c745(%rip), %rdi     # 0x45fe8
callq 0x85e0
movl $0x1, %r14d
movq %rax, %rdi
callq 0x82b0
jmp 0x99ef
movl $0x2a, %edx
leaq 0x2a1a7(%rip), %rsi     # 0x33a6e
jmp 0x99a3
cmpb $0x1, 0x33(%rsp)
leaq 0x68(%rsp), %r13
jne 0x98ef
movq %r15, %rdi
leaq 0x2a1b7(%rip), %rsi     # 0x33a99
callq 0x8880
testl %eax, %eax
jne 0x99ec
movl $0x18, %edi
callq 0x8600
movq 0x8(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x8060
incq 0x78(%rsp)
jmp 0x99ec
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x2e, %edx
cmpl %r12d, %r13d
jge 0x9957
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
cmpb $0x0, (%rax)
leaq 0x2995d(%rip), %rsi     # 0x332a3
je 0x99a3
movb $0x1, 0x31(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x99ec
leaq 0x29945(%rip), %rsi     # 0x332a3
jmp 0x99a3
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x32, %edx
cmpl %r12d, %r13d
jge 0x999c
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
cmpb $0x0, (%rax)
leaq 0x29959(%rip), %rsi     # 0x332e4
je 0x99a3
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0xd304
jmp 0x99ec
leaq 0x29941(%rip), %rsi     # 0x332e4
movl $0x1, %r14d
movq 0x3c638(%rip), %rdi     # 0x45fe8
callq 0x86c0
jmp 0x99ef
movb $0x1, 0x3d353(%rip)     # 0x46d11
jmp 0x99ec
movb $0x1, 0x3d349(%rip)     # 0x46d10
movb $0x0, 0x33(%rsp)
jmp 0x99ec
movb $0x0, 0x3d33c(%rip)     # 0x46d11
jmp 0x99ec
xorl %eax, %eax
movb %al, 0x3d331(%rip)      # 0x46d10
movb %al, 0x33(%rsp)
jmp 0x99ec
movb $0x1, 0x3d334(%rip)     # 0x46d20
xorl %r14d, %r14d
cmpl $-0x1, %r14d
je 0x9a07
cmpl $0x1, %r14d
jne 0x9a13
movl $0x1, 0x14(%rsp)
xorl %eax, %eax
jmp 0x9a15
xorl %eax, %eax
movl $0x0, 0x14(%rsp)
jmp 0x9a15
movb $0x1, %al
testb %al, %al
je 0x9d56
movl 0x80(%rsp), %r13d
incl %r13d
movl %r13d, 0x80(%rsp)
cmpl %r12d, %r13d
setl %bl
jl 0x955a
jmp 0x9d56
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x31, %edx
cmpl %r12d, %r13d
jge 0x9a83
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
cmpb $0x0, (%rax)
leaq 0x298f5(%rip), %rsi     # 0x33361
je 0x99a3
movq %rax, 0x3cb6f(%rip)     # 0x465e8
movb $0x1, 0x30(%rsp)
jmp 0x99ec
leaq 0x298d7(%rip), %rsi     # 0x33361
jmp 0x99a3
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x2e, %edx
leaq 0x2996e(%rip), %rsi     # 0x33414
cmpl %r12d, %r13d
jge 0x99a3
movq $0x0, 0x100(%rsp)
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
leaq 0x100(%rsp), %rsi
movl $0xa, %edx
callq 0x81b0
movq 0x100(%rsp), %rcx
movq 0x1a8(%rsp), %rdx
movslq 0x80(%rsp), %rsi
cmpq (%rdx,%rsi,8), %rcx
je 0x9b00
cmpb $0x0, (%rcx)
je 0x9b95
movl $0x37, %edx
movq 0x3c4dc(%rip), %rdi     # 0x45fe8
leaq 0x2988e(%rip), %rsi     # 0x333a1
callq 0x86c0
movl $0x1, %r14d
jmp 0x99ef
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x2e, %edx
cmpl %r12d, %r13d
jge 0x9b6c
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
cmpb $0x0, (%rax)
leaq 0x29903(%rip), %rsi     # 0x33451
je 0x99a3
movq %rax, 0x3ca95(%rip)     # 0x465f0
movb $0x1, %al
movb %al, 0x3d1af(%rip)      # 0x46d12
movb %al, 0x32(%rsp)
jmp 0x99ec
leaq 0x298de(%rip), %rsi     # 0x33451
jmp 0x99a3
leaq 0x3cb51(%rip), %rax     # 0x466d0
movb $0x0, (%rax)
leaq 0x3cb3f(%rip), %rax     # 0x466c8
movl $0x4, 0x4(%rax)
jmp 0x99ec
movl %eax, 0x3ca45(%rip)     # 0x465e0
movl %eax, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x8390
movl 0x3ca31(%rip), %edi     # 0x465e0
testl %edi, %edi
setne %cl
testl %eax, %eax
setns %r15b
andb %cl, %r15b
je 0x9bd7
cmpl $0x3, %edi
jl 0x9bef
orl $0x1, %eax
movl $0x2, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x8390
jmp 0x9bef
movl $0x3a, %edx
movq 0x3c405(%rip), %rdi     # 0x45fe8
leaq 0x297ef(%rip), %rsi     # 0x333d9
callq 0x86c0
movl $0x1, %r14d
testb %r15b, %r15b
jne 0x99ec
jmp 0x99ef
leaq 0x250(%rsp), %rdi
leaq 0x29879(%rip), %rsi     # 0x3348b
leaq 0x100(%rsp), %rdx
callq 0xb52a
testb %al, %al
je 0x9b18
movl 0x100(%rsp), %eax
leaq 0x3ca93(%rip), %rcx     # 0x466c8
movl %eax, 0x4(%rcx)
jmp 0x99ec
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x31, %edx
cmpl %r12d, %r13d
jge 0x9cc2
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
cmpb $0x0, (%rax)
leaq 0x29850(%rip), %rsi     # 0x334b8
je 0x99a3
leaq 0x3cfcb(%rip), %rdi     # 0x46c40
movq %rax, %rsi
callq 0x8850
movb $0x1, 0x3cfdc(%rip)     # 0x46c60
jmp 0x99ec
leaq 0x250(%rsp), %rdi
leaq 0x29803(%rip), %rsi     # 0x3349b
leaq 0x100(%rsp), %rdx
callq 0xb52a
testb %al, %al
je 0x9b18
movl 0x100(%rsp), %eax
leaq 0x3ca0d(%rip), %rcx     # 0x466c8
movl %eax, (%rcx)
jmp 0x99ec
leaq 0x297ef(%rip), %rsi     # 0x334b8
jmp 0x99a3
incl %r13d
movl %r13d, 0x80(%rsp)
movl $0x2d, %edx
cmpl %r12d, %r13d
jge 0x9d17
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
cmpb $0x0, (%rcx)
leaq 0x297fe(%rip), %rsi     # 0x334f7
je 0x99a3
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
leaq 0x68(%rsp), %rdi
callq 0xd32a
jmp 0x99ec
leaq 0x297d9(%rip), %rsi     # 0x334f7
jmp 0x99a3
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
callq 0xb6e8
jmp 0x99ef
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0x51a, %edx            # imm = 0x51A
movq 0x3c23b(%rip), %rdi     # 0x45f80
leaq 0x297ea(%rip), %rsi     # 0x33536
callq 0x86c0
jmp 0x99ef
testb $0x1, %bl
jne 0xa563
cmpb $0x1, 0x3cfaa(%rip)     # 0x46d10
leaq 0x68(%rsp), %r13
jne 0x9df9
leaq 0x292c8(%rip), %rdi     # 0x33040
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x8450
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x9d93
movl %ebx, %edi
xorl %esi, %esi
callq 0x8590
leaq 0x292a6(%rip), %rdi     # 0x33040
movl $0x2, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x8450
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x9dc7
movl %ebp, %edi
movl $0x1, %esi
callq 0x8590
movl %ebp, %edi
movl $0x2, %esi
callq 0x8590
cmpl $0x3, %ebx
jl 0x9dd3
movl %ebx, %edi
callq 0x8b60
cmpl $0x3, %ebp
jl 0x9ddf
movl %ebp, %edi
callq 0x8b60
cmpb $0x0, 0x31(%rsp)
jne 0x9df2
leaq 0x29da3(%rip), %rax     # 0x33b90
movq %rax, 0x28(%rsp)
movb $0x1, 0x3ce67(%rip)     # 0x46c60
cmpb $0x1, 0x3cf10(%rip)     # 0x46d10
jne 0x9e11
leaq 0x2f8(%rsp), %rdi
callq 0x81a0
jmp 0x9e48
leaq 0x2f8(%rsp), %rbx
movq %rbx, %rdi
callq 0x8770
movq %rbx, %rdi
movl $0x11, %esi
callq 0x8970
movq %rbx, %rdi
movl $0x2, %esi
callq 0x8970
movq %rbx, %rdi
movl $0xf, %esi
callq 0x8970
leaq 0x3cd51(%rip), %rdx     # 0x46ba0
leaq 0x2f8(%rsp), %rsi
xorl %edi, %edi
callq 0x8280
movl $0x1, %esi
movl $0x14, %edi
callq 0x8710
movl $0x1, %esi
movl $0x15, %edi
callq 0x8710
movl $0x1, %esi
movl $0x16, %edi
callq 0x8710
movl $0x1, %esi
movl $0xd, %edi
callq 0x8710
leaq 0x3cb8f(%rip), %rdi     # 0x46a30
callq 0xe044
cmpb $0x0, 0x3ce64(%rip)     # 0x46d11
jne 0x9f4b
cmpb $0x0, 0x30(%rsp)
jne 0x9f4b
leaq 0x29188(%rip), %rdi     # 0x3304d
callq 0x8730
testq %rax, %rax
je 0x9edb
movq %rax, %r15
leaq 0x29185(%rip), %rbx     # 0x3305e
jmp 0x9eea
callq 0x2fd60
movq %rax, %r15
leaq 0x29173(%rip), %rbx     # 0x3305d
testq %r15, %r15
je 0x9f4b
movq 0x3cd32(%rip), %r12     # 0x46c28
leaq 0x3cd23(%rip), %r13     # 0x46c20
movq %r15, %rdi
callq 0x8230
movq %r13, %rdi
leaq 0x68(%rsp), %r13
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x89a0
leaq 0x3ccfc(%rip), %rdi     # 0x46c20
movl $0x2f, %esi
callq 0x8510
leaq 0x3cceb(%rip), %rdi     # 0x46c20
movq %rbx, %rsi
callq 0x8b50
movq 0x3ccdc(%rip), %rax     # 0x46c20
movq %rax, 0x3c69d(%rip)     # 0x465e8
cmpq %r13, 0x68(%rsp)
jne 0x9f77
movl $0x18, %edi
callq 0x8600
leaq 0x29104(%rip), %rcx     # 0x33067
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x8060
incq 0x78(%rsp)
xorl %ecx, %ecx
movl %ecx, 0x258(%rsp)
leaq 0x3afe1(%rip), %rdx     # 0x44f68
movq %rdx, 0x250(%rsp)
leaq 0xc59(%rip), %rax       # 0xabef
movq %rax, 0x2f0(%rsp)
movl %ecx, 0x1b0(%rsp)
movq %rdx, 0x1a8(%rsp)
movq %rcx, 0x248(%rsp)
movl %ecx, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movq %rcx, 0x1a0(%rsp)
cmpb $0x1, 0x3cd3d(%rip)     # 0x46d10
jne 0x9ff5
leaq 0xc24(%rip), %rax       # 0xac00
movq %rax, 0x248(%rsp)
leaq 0xc26(%rip), %rax       # 0xac11
movq %rax, 0x1a0(%rsp)
jmp 0x9ffd
movq %rax, 0x248(%rsp)
leaq 0x1a8(%rsp), %rsi
andb $-0x20, 0xc(%rsi)
movl $0x32, 0x18(%rsi)
movl $0x2, 0x20(%rsi)
leaq 0x3ca12(%rip), %rdi     # 0x46a30
movl $0x2, %edx
callq 0xe6e0
leaq 0x250(%rsp), %rsi
andb $-0x20, 0xc(%rsi)
movl $0x32, 0x18(%rsi)
movl $0xf, 0x20(%rsi)
leaq 0x3c9e7(%rip), %rdi     # 0x46a30
movl $0xf, %edx
callq 0xe6e0
cmpb $0x1, 0x3ccb6(%rip)     # 0x46d10
jne 0xa0c6
andb $-0x20, 0x3cc39(%rip)   # 0x46c9c
leaq 0x3cc26(%rip), %rsi     # 0x46c90
movq $0x32, 0x3cc33(%rip) # 0x46ca8
movl $0x1, 0x3cc31(%rip)     # 0x46cb0
leaq 0x3c9aa(%rip), %rdi     # 0x46a30
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xe744
leaq 0x100(%rsp), %rsi
andb $-0x20, 0xc(%rsi)
movl $0x32, 0x18(%rsi)
movl $0x3, 0x20(%rsi)
leaq 0x3c974(%rip), %rdi     # 0x46a30
movl $0x3, %edx
callq 0xe6e0
movzbl 0x3cc45(%rip), %edi     # 0x46d12
xorl $0x1, %edi
callq 0x2e314
andb $-0x20, 0x3cbe8(%rip)   # 0x46cc4
leaq 0x3cbd5(%rip), %rsi     # 0x46cb8
movl $0x32, 0x3cbe3(%rip)    # 0x46cd0
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x3cc02(%rip)     # 0x46d00
leaq 0x3c92b(%rip), %rdi     # 0x46a30
movl $0x1, %edx
callq 0xe818
cmpb $0x0, 0x3cb4a(%rip)     # 0x46c60
jne 0xa35f
leaq 0x29d17(%rip), %rdi     # 0x33e3a
xorl %esi, %esi
xorl %eax, %eax
callq 0x8450
cmpl $-0x1, %eax
je 0xa35f
movl %eax, 0x4(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x40, %ebx
movl $0x40, %edi
callq 0x8600
leaq 0x80(%rsp), %rcx
movq %rax, (%rcx)
addq $0x40, %rax
movq %rax, 0x10(%rcx)
movq %rax, 0x8(%rcx)
movq $-0x1, %r12
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r15d, %r15d
movq 0x80(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %r14
movq %rbx, %rdx
subq %r15, %rdx
movl 0x4(%rsp), %edi
callq 0x88f0
movq %rax, %rbx
cmpq $-0x1, %rax
je 0xa1d3
testq %rbx, %rbx
jne 0xa1e6
leaq 0x1(%r15), %rax
cmpq $-0x1, %r12
cmoveq %rax, %r12
movl $0x3, %ebp
jmp 0xa2b4
movl $0x1, %ebp
movl 0x4(%rsp), %edi
callq 0x8b60
jmp 0xa2b4
setne %r13b
movl $0x4, %ebp
je 0xa277
movq 0x80(%rsp), %rax
addq %r15, %rax
movb $0x1, %r13b
xorl %ecx, %ecx
leaq (%r15,%rcx), %rdx
movb (%rax,%rcx), %sil
cmpb $0xa, %sil
jne 0xa218
movq %rdx, %r12
jmp 0xa24a
cmpq $-0x1, %r12
jne 0xa258
movq $-0x1, %r12
cmpb $0x3a, %sil
jne 0xa24a
movq 0x20(%rsp), %rdi
incq %rdi
movq %rdi, 0x20(%rsp)
cmpq $0x2, %rdi
movq 0x18(%rsp), %rsi
cmoveq %rdx, %rsi
movq %rsi, 0x18(%rsp)
incq %rcx
cmpq %rbx, %rcx
setb %r13b
jne 0xa205
jmp 0xa277
movl $0x2, %edi
leaq 0x29be8(%rip), %rsi     # 0x33e4c
callq 0x2e562
movl $0x1, %ebp
movl 0x4(%rsp), %edi
callq 0x8b60
testb $0x1, %r13b
je 0xa284
leaq 0x68(%rsp), %r13
jmp 0xa2b4
addq %rbx, %r15
movl $0x3, %ebp
cmpq $-0x1, %r12
leaq 0x68(%rsp), %r13
jne 0xa2b4
xorl %ebp, %ebp
cmpq %r14, %r15
jne 0xa2b4
movq %r14, %rsi
addq %r14, %rsi
leaq 0x80(%rsp), %rdi
movq %rsi, %r14
callq 0xdf3c
testl %ebp, %ebp
movq %r14, %rbx
je 0xa192
cmpl $0x3, %ebp
jne 0xa342
movl 0x4(%rsp), %edi
callq 0x8b60
cmpq $0x2, 0x20(%rsp)
movq 0x18(%rsp), %rsi
jb 0xa331
movq %r12, %rax
subq %rsi, %rax
cmpq $0x1, %rax
je 0xa331
movq 0x80(%rsp), %rax
cmpb $0x2f, 0x1(%rax,%rsi)
jne 0xa331
movq $0x0, 0x3c948(%rip) # 0x46c48
leaq 0x3c939(%rip), %rdi     # 0x46c40
movq 0x3c932(%rip), %rax     # 0x46c40
movb $0x0, (%rax)
addq $0x2, %rsi
subq %rsi, %r12
addq 0x80(%rsp), %rsi
movq %r12, %rdx
callq 0x8080
movb $0x1, 0x3c931(%rip)     # 0x46c60
jmp 0xa342
leaq 0x29b4b(%rip), %rsi     # 0x33e83
movl $0x2, %edi
callq 0x2e562
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xa35f
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movzbl 0x3c9ab(%rip), %edi     # 0x46d11
xorl $0x1, %edi
callq 0xac5f
testb %al, %al
je 0xa556
cmpb $0x1, 0x3c993(%rip)     # 0x46d10
jne 0xa394
movl $0x6, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8b70
xorl %edi, %edi
callq 0x8500
movl $0x24, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x87d0
movzbl 0x3c965(%rip), %esi     # 0x46d11
leaq 0x38(%rsp), %rdi
callq 0x2fdac
movl $0x60, %edi
callq 0x8600
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x18(%rax)
movq %rcx, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movl $0x0, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movq %rcx, 0x40(%rax)
movw $0x1, 0x28(%rax)
leaq 0x3aeac(%rip), %rdx     # 0x452a0
addq $0x10, %rdx
movq %rdx, (%rax)
movq 0x50(%rsp), %rdx
movq %rdx, 0x48(%rax)
movq 0x58(%rsp), %rdx
movq %rdx, 0x50(%rax)
movq 0x60(%rsp), %rdx
movq %rdx, 0x58(%rax)
movq %rcx, 0x60(%rsp)
movups %xmm0, 0x50(%rsp)
movq %rax, 0x3c8f1(%rip)     # 0x46d18
movq %rax, %rdi
callq 0x2e435
cmpb $0x1, 0x3c8db(%rip)     # 0x46d11
jne 0xa44b
leaq 0x28c2d(%rip), %rdx     # 0x3306c
movl $0x1, %edi
xorl %esi, %esi
callq 0x2e635
cmpb $0x1, 0x32(%rsp)
jne 0xa46d
callq 0xafd9
cmpb $0x0, 0x3c8b3(%rip)     # 0x46d11
jne 0xa46d
cmpb $0x1, 0x3c731(%rip)     # 0x46b98
jne 0xa556
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xa48a
leaq 0x3e992(%rip), %rdx     # 0x48e10
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x30a5c
movq 0x68(%rsp), %r14
cmpq %r13, %r14
je 0xa5e5
leaq 0x28c1c(%rip), %rbx     # 0x330bb
movq 0x10(%r14), %rsi
movq %rsi, 0x80(%rsp)
movq 0x3c866(%rip), %r15     # 0x46d18
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rax, %rdi
callq 0x228ae
movq %r15, %rdi
callq 0xd8da
movq (%r14), %r14
cmpq %r13, %r14
jne 0xa49f
jmp 0xa5e5
movq %rax, %rbp
cmpl $0x5, %edx
jne 0xa509
movq %rbp, %rdi
callq 0x8210
movq (%rax), %rsi
movl $0x3, %edi
callq 0x2e63a
movq %rbx, %rdi
callq 0x2e759
callq 0x8a50
leaq 0x68(%rsp), %r13
jmp 0xa4cb
cmpl $0x4, %edx
jne 0xa52a
movq %rbp, %rdi
callq 0x8210
movq %rax, %rdi
callq 0xb7d5
callq 0x8a50
leaq 0x68(%rsp), %r13
jmp 0xa4cb
cmpl $0x3, %edx
jne 0xa5c2
movq %rbp, %rdi
callq 0x8210
leaq 0x20(%rax), %rsi
movq %rax, %rdi
callq 0xb1ee
callq 0x8a50
leaq 0x68(%rsp), %r13
jmp 0xa4cb
callq 0xaf5b
movl $0x1, 0x14(%rsp)
leaq 0x68(%rsp), %r14
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xa587
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x8620
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0xa572
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0xd93e
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
movl 0x14(%rsp), %ebx
je 0xa5ae
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movl %ebx, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %edx
jne 0xabdd
movq %rbp, %rdi
callq 0x8210
leaq 0x80(%rsp), %rdi
callq 0xb1c4
callq 0x8a50
callq 0xb214
leaq 0x80(%rsp), %r12
leaq 0x3c437(%rip), %r15     # 0x46a30
movq 0x3c718(%rip), %rax     # 0x46d18
cmpl $0x0, 0x8(%rax)
je 0xa615
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xb8ca
jmp 0xa5f9
movzbl 0x29(%rax), %r14d
movb $0x1, %r13b
cmpq $0x1, %r14
je 0xa9db
cmpb $0x1, 0x3c6e2(%rip)     # 0x46d10
jne 0xa668
movl $0x1, %edi
leaq 0x28aa5(%rip), %rsi     # 0x330e1
callq 0x2e63a
cmpb $0x6, %r14b
ja 0xa668
movzbl %r14b, %eax
movl $0x7d, %ecx
btl %eax, %ecx
jae 0xa668
leaq 0x29c28(%rip), %rax     # 0x34284
movslq (%rax,%r14,4), %rdi
addq %rax, %rdi
callq 0x2e759
callq 0xaf5b
callq 0xb274
cmpb $0x1, 0x3c697(%rip)     # 0x46d10
jne 0xa7a7
cmpb $0x5, %r14b
sete 0x18(%rsp)
jne 0xa6dc
callq 0x85b0
leaq 0x29896(%rip), %rdi     # 0x33f2c
movq 0x8(%rsp), %rsi
callq 0x8570
callq 0x8050
movl (%rax), %edi
callq 0x81d0
movq %rax, %rbx
movl $0x3, %edi
leaq 0x2987d(%rip), %rsi     # 0x33f38
callq 0x2e63a
movq %rbx, %rdi
callq 0x2e759
movl $0x3, %edi
leaq 0x28a8d(%rip), %rsi     # 0x33161
callq 0x2e562
movb $0x4, %r14b
testb %r14b, %r14b
jne 0xaa55
callq 0x85b0
cmpb $0x1, 0x3c62f(%rip)     # 0x46d20
jne 0xa71a
movq 0x3c61e(%rip), %rbx     # 0x46d18
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2a951(%rip), %rsi     # 0x35058
callq *0x10(%rax)
movq %rax, %rdi
callq 0x228ae
movq %rbx, %rdi
callq 0xd8da
movl $0x41, %edx
movq 0x3b85a(%rip), %rdi     # 0x45f80
leaq 0x29514(%rip), %rsi     # 0x33c41
callq 0x86c0
movq %r12, %rbx
xorl %edi, %edi
movq %r12, %rsi
callq 0x8690
testl %eax, %eax
je 0xa7fa
movl $0x8, %edx
movq 0x3b82d(%rip), %rdi     # 0x45f80
leaq 0x29529(%rip), %rsi     # 0x33c83
callq 0x86c0
movq 0x3b81a(%rip), %rcx     # 0x45f80
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x85d0
movsbl %al, %esi
movq 0x3b7fc(%rip), %rdi     # 0x45f80
callq 0x8040
movq %rax, %rdi
callq 0x8410
movq 0x3c580(%rip), %rdi     # 0x46d18
movl $0x2, %esi
callq 0xd98c
jmp 0xa9a1
xorl %r13d, %r13d
movl $0x0, 0x14(%rsp)
cmpb $0x4, %r14b
jne 0xa9db
movq %r12, %rdi
callq 0x8770
movq %r12, %rdi
movl $0x2, %esi
callq 0x8970
movl $0x2, %edi
callq 0x8610
xorl %r13d, %r13d
movl $0x1, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x8280
movl $0x0, 0x14(%rsp)
jmp 0xa9db
andb $-0x3, 0x8c(%rsp)
xorl %edi, %edi
movl $0x2, %esi
movq %rbx, %rdx
callq 0x87b0
xorl %edi, %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x8390
movl %eax, %ebp
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
xorl %edi, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x8390
movl $0x44, %edx
movq 0x3b73d(%rip), %rdi     # 0x45f80
leaq 0x29442(%rip), %rsi     # 0x33c8c
callq 0x86c0
movq 0x3b72a(%rip), %rdi     # 0x45f80
callq 0x8410
leaq 0x3c42e(%rip), %rdi     # 0x46c90
movq %r15, %rsi
movl $0x1, %edx
callq 0xd9d0
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xb8ca
cmpb $0x0, 0x3c49f(%rip)     # 0x46d22
jne 0xa892
movq 0x3c48c(%rip), %rax     # 0x46d18
cmpb $0x0, 0x29(%rax)
je 0xa86f
leaq 0x3c3f7(%rip), %rdi     # 0x46c90
movq %r15, %rsi
xorl %edx, %edx
callq 0xd9d0
cmpb $0x1, 0x3c478(%rip)     # 0x46d22
jne 0xa97d
movb $0x0, 0x3c46b(%rip)     # 0x46d22
movl $0x1, %edx
xorl %edi, %edi
leaq 0x3(%rsp), %rsi
callq 0x88f0
cmpl $0x1, %eax
jne 0xa974
movl $0x1, %edx
movq 0x3b6a3(%rip), %rdi     # 0x45f80
leaq 0x2923c(%rip), %rsi     # 0x33b20
callq 0x86c0
movzbl 0x3(%rsp), %eax
andl $-0x21, %eax
cmpl $0x4f, %eax
jg 0xa918
cmpl $0x45, %eax
jne 0xa837
movq 0x3c412(%rip), %rbx     # 0x46d18
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2a745(%rip), %rsi     # 0x35058
callq *0x10(%rax)
jmp 0xa961
cmpl $0x50, %eax
je 0xa9f7
cmpl $0x53, %eax
je 0xa974
cmpl $0x52, %eax
jne 0xa837
jmp 0xa9e9
movq %rax, %rdi
callq 0x8210
movl $0x22, %edx
movq 0x3b638(%rip), %rdi     # 0x45f80
leaq 0x29382(%rip), %rsi     # 0x33cd1
callq 0x86c0
movq %r12, %rbx
callq 0x8a50
jmp 0xa837
movq %rax, %rdi
callq 0x228ae
movq %rbx, %rdi
callq 0xd8da
movq %r12, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x8960
orb $0x2, 0x8c(%rsp)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x87b0
xorl %edi, %edi
movl $0x4, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x8390
movq 0x3c370(%rip), %rbx     # 0x46d18
cmpl $0x0, 0x8(%rbx)
jne 0xa9db
movb 0x29(%rbx), %r14b
testb %r14b, %r14b
jne 0xaa55
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2869f(%rip), %rsi     # 0x33067
callq *0x10(%rax)
movq %rax, %rdi
callq 0x228ae
movq %rbx, %rdi
callq 0xd8da
testb %r13b, %r13b
jne 0xa5f9
jmp 0xa563
movq 0x3c328(%rip), %rdi     # 0x46d18
movl $0x4, %esi
jmp 0xaa03
movq 0x3c31a(%rip), %rdi     # 0x46d18
movl $0x3, %esi
callq 0xd98c
jmp 0xa974
movq %rax, %rbp
cmpl $0x6, %edx
jne 0xabdd
movq %rbp, %rdi
callq 0x8210
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq %rax, %rbx
movl $0x3, %edi
leaq 0x28754(%rip), %rsi     # 0x3318d
callq 0x2e63a
movq %rbx, %rdi
callq 0x2e759
callq 0xaf5b
callq 0x8a50
jmp 0xa71a
addb $-0x2, %r14b
cmpb $0x0, 0x18(%rsp)
je 0xaa65
callq 0xaf5b
cmpb $0x4, %r14b
ja 0xaa7f
movzbl %r14b, %eax
leaq 0x297fa(%rip), %rdx     # 0x34270
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmp 0xaa86
leaq 0x28768(%rip), %rcx     # 0x331ee
leaq 0x294c9(%rip), %rdi     # 0x33f56
leaq 0x2875d(%rip), %rdx     # 0x331f1
movq %rdi, %rsi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x8750
callq 0x8050
movl (%rax), %edi
callq 0x81d0
movq %rax, %rbx
leaq 0x294ae(%rip), %rsi     # 0x33f65
movl $0x3, %edi
callq 0x2e63a
movq %rbx, %rdi
callq 0x2e759
leaq 0x3bf60(%rip), %rbx     # 0x46a30
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xb8ca
jmp 0xaad0
jmp 0xabda
jmp 0xabda
jmp 0xabda
movq %rax, %rbp
callq 0x8a50
jmp 0xabdd
jmp 0xabd2
jmp 0xabda
jmp 0xabda
movq %rdx, %r12
movq %rax, %rbx
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
jmp 0xab72
jmp 0xab6c
jmp 0xab6c
movq %rdx, %r12
movq %rax, %rbx
jmp 0xab8f
jmp 0xab6c
jmp 0xabda
jmp 0xabda
jmp 0xabda
movq %rax, %rdi
callq 0x8210
leaq 0x2866a(%rip), %rsi     # 0x331b0
movl $0x3, %edi
callq 0x2e562
callq 0x8a50
movb $0x1, 0x18(%rsp)
movb $0x2, %r14b
jmp 0xaa59
jmp 0xabda
jmp 0xabda
jmp 0xabda
jmp 0xabd2
jmp 0xabda
movq %rdx, %r12
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xab8f
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movq %rbx, %rdi
cmpl $0x2, %r12d
jne 0xabcb
callq 0x8210
movl 0x4(%rsp), %edi
cmpl $-0x1, %edi
leaq 0x68(%rsp), %r13
je 0xabb0
callq 0x8b60
leaq 0x292f1(%rip), %rsi     # 0x33ea8
movl $0x2, %edi
callq 0x2e562
callq 0x8a50
jmp 0xa35f
callq 0xb8be
jmp 0xabd2
movq %rax, %rdi
callq 0xb8be
movq %rax, %rbp
leaq 0x28(%rsp), %rdi
callq 0xb954
movq %rbp, %rdi
callq 0x8ab0