// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/sentinel.c
// Function: sentinelRefreshInstanceInfo
void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
    sds *lines;
    int numlines, j;
    int role = 0;

    /* cache full INFO output for instance */
    sdsfree(ri->info);
    ri->info = sdsnew(info);

    /* The following fields must be reset to a given value in the case they
     * are not found at all in the INFO output. */
    ri->master_link_down_time = 0;

    /* Process line by line. */
    lines = sdssplitlen(info,strlen(info),"\r\n",2,&numlines);
    for (j = 0; j < numlines; j++) {
        sentinelRedisInstance *slave;
        sds l = lines[j];

        /* run_id:<40 hex chars>*/
        if (sdslen(l) >= 47 && !memcmp(l,"run_id:",7)) {
            if (ri->runid == NULL) {
                ri->runid = sdsnewlen(l+7,40);
            } else {
                if (strncmp(ri->runid,l+7,40) != 0) {
                    sentinelEvent(LL_NOTICE,"+reboot",ri,"%@");
                    sdsfree(ri->runid);
                    ri->runid = sdsnewlen(l+7,40);
                }
            }
        }

        /* old versions: slave0:<ip>,<port>,<state>
         * new versions: slave0:ip=127.0.0.1,port=9999,... */
        if ((ri->flags & SRI_MASTER) &&
            sdslen(l) >= 7 &&
            !memcmp(l,"slave",5) && isdigit(l[5]))
        {
            char *ip, *port, *end;

            if (strstr(l,"ip=") == NULL) {
                /* Old format. */
                ip = strchr(l,':'); if (!ip) continue;
                ip++; /* Now ip points to start of ip address. */
                port = strchr(ip,','); if (!port) continue;
                *port = '\0'; /* nul term for easy access. */
                port++; /* Now port points to start of port number. */
                end = strchr(port,','); if (!end) continue;
                *end = '\0'; /* nul term for easy access. */
            } else {
                /* New format. */
                ip = strstr(l,"ip="); if (!ip) continue;
                ip += 3; /* Now ip points to start of ip address. */
                port = strstr(l,"port="); if (!port) continue;
                port += 5; /* Now port points to start of port number. */
                /* Nul term both fields for easy access. */
                end = strchr(ip,','); if (end) *end = '\0';
                end = strchr(port,','); if (end) *end = '\0';
            }

            /* Check if we already have this slave into our table,
             * otherwise add it. */
            if (sentinelRedisInstanceLookupSlave(ri,ip,atoi(port)) == NULL) {
                if ((slave = createSentinelRedisInstance(NULL,SRI_SLAVE,ip,
                            atoi(port), ri->quorum, ri)) != NULL)
                {
                    sentinelEvent(LL_NOTICE,"+slave",slave,"%@");
                    sentinelFlushConfig();
                }
            }
        }

        /* master_link_down_since_seconds:<seconds> */
        if (sdslen(l) >= 32 &&
            !memcmp(l,"master_link_down_since_seconds",30))
        {
            ri->master_link_down_time = strtoll(l+31,NULL,10)*1000;
        }

        /* role:<role> */
        if (!memcmp(l,"role:master",11)) role = SRI_MASTER;
        else if (!memcmp(l,"role:slave",10)) role = SRI_SLAVE;

        if (role == SRI_SLAVE) {
            /* master_host:<host> */
            if (sdslen(l) >= 12 && !memcmp(l,"master_host:",12)) {
                if (ri->slave_master_host == NULL ||
                    strcasecmp(l+12,ri->slave_master_host))
                {
                    sdsfree(ri->slave_master_host);
                    ri->slave_master_host = sdsnew(l+12);
                    ri->slave_conf_change_time = mstime();
                }
            }

            /* master_port:<port> */
            if (sdslen(l) >= 12 && !memcmp(l,"master_port:",12)) {
                int slave_master_port = atoi(l+12);

                if (ri->slave_master_port != slave_master_port) {
                    ri->slave_master_port = slave_master_port;
                    ri->slave_conf_change_time = mstime();
                }
            }

            /* master_link_status:<status> */
            if (sdslen(l) >= 19 && !memcmp(l,"master_link_status:",19)) {
                ri->slave_master_link_status =
                    (strcasecmp(l+19,"up") == 0) ?
                    SENTINEL_MASTER_LINK_STATUS_UP :
                    SENTINEL_MASTER_LINK_STATUS_DOWN;
            }

            /* slave_priority:<priority> */
            if (sdslen(l) >= 15 && !memcmp(l,"slave_priority:",15))
                ri->slave_priority = atoi(l+15);

            /* slave_repl_offset:<offset> */
            if (sdslen(l) >= 18 && !memcmp(l,"slave_repl_offset:",18))
                ri->slave_repl_offset = strtoull(l+18,NULL,10);
        }
    }
    ri->info_refresh = mstime();
    sdsfreesplitres(lines,numlines);

    /* ---------------------------- Acting half -----------------------------
     * Some things will not happen if sentinel.tilt is true, but some will
     * still be processed. */

    /* Remember when the role changed. */
    if (role != ri->role_reported) {
        ri->role_reported_time = mstime();
        ri->role_reported = role;
        if (role == SRI_SLAVE) ri->slave_conf_change_time = mstime();
        /* Log the event with +role-change if the new role is coherent or
         * with -role-change if there is a mismatch with the current config. */
        sentinelEvent(LL_VERBOSE,
            ((ri->flags & (SRI_MASTER|SRI_SLAVE)) == role) ?
            "+role-change" : "-role-change",
            ri, "%@ new reported role is %s",
            role == SRI_MASTER ? "master" : "slave",
            ri->flags & SRI_MASTER ? "master" : "slave");
    }

    /* None of the following conditions are processed when in tilt mode, so
     * return asap. */
    if (sentinel.tilt) return;

    /* Handle master -> slave role switch. */
    if ((ri->flags & SRI_MASTER) && role == SRI_SLAVE) {
        /* Nothing to do, but masters claiming to be slaves are
         * considered to be unreachable by Sentinel, so eventually
         * a failover will be triggered. */
    }

    /* Handle slave -> master role switch. */
    if ((ri->flags & SRI_SLAVE) && role == SRI_MASTER) {
        /* If this is a promoted slave we can change state to the
         * failover state machine. */
        if ((ri->flags & SRI_PROMOTED) &&
            (ri->master->flags & SRI_FAILOVER_IN_PROGRESS) &&
            (ri->master->failover_state ==
                SENTINEL_FAILOVER_STATE_WAIT_PROMOTION))
        {
            /* Now that we are sure the slave was reconfigured as a master
             * set the master configuration epoch to the epoch we won the
             * election to perform this failover. This will force the other
             * Sentinels to update their config (assuming there is not
             * a newer one already available). */
            ri->master->config_epoch = ri->master->failover_epoch;
            ri->master->failover_state = SENTINEL_FAILOVER_STATE_RECONF_SLAVES;
            ri->master->failover_state_change_time = mstime();
            sentinelFlushConfig();
            sentinelEvent(LL_WARNING,"+promoted-slave",ri,"%@");
            if (sentinel.simfailure_flags &
                SENTINEL_SIMFAILURE_CRASH_AFTER_PROMOTION)
                sentinelSimFailureCrash();
            sentinelEvent(LL_WARNING,"+failover-state-reconf-slaves",
                ri->master,"%@");
            sentinelCallClientReconfScript(ri->master,SENTINEL_LEADER,
                "start",ri->master->addr,ri->addr);
            sentinelForceHelloUpdateForMaster(ri->master);
        } else {
            /* A slave turned into a master. We want to force our view and
             * reconfigure as slave. Wait some time after the change before
             * going forward, to receive new configs if any. */
            mstime_t wait_time = SENTINEL_PUBLISH_PERIOD*4;

            if (!(ri->flags & SRI_PROMOTED) &&
                 sentinelMasterLooksSane(ri->master) &&
                 sentinelRedisInstanceNoDownFor(ri,wait_time) &&
                 mstime() - ri->role_reported_time > wait_time)
            {
                int retval = sentinelSendSlaveOf(ri,
                        ri->master->addr->ip,
                        ri->master->addr->port);
                if (retval == C_OK)
                    sentinelEvent(LL_NOTICE,"+convert-to-slave",ri,"%@");
            }
        }
    }

    /* Handle slaves replicating to a different master address. */
    if ((ri->flags & SRI_SLAVE) &&
        role == SRI_SLAVE &&
        (ri->slave_master_port != ri->master->addr->port ||
         strcasecmp(ri->slave_master_host,ri->master->addr->ip)))
    {
        mstime_t wait_time = ri->master->failover_timeout;

        /* Make sure the master is sane before reconfiguring this instance
         * into a slave. */
        if (sentinelMasterLooksSane(ri->master) &&
            sentinelRedisInstanceNoDownFor(ri,wait_time) &&
            mstime() - ri->slave_conf_change_time > wait_time)
        {
            int retval = sentinelSendSlaveOf(ri,
                    ri->master->addr->ip,
                    ri->master->addr->port);
            if (retval == C_OK)
                sentinelEvent(LL_NOTICE,"+fix-slave-config",ri,"%@");
        }
    }

    /* Detect if the slave that is in the process of being reconfigured
     * changed state. */
    if ((ri->flags & SRI_SLAVE) && role == SRI_SLAVE &&
        (ri->flags & (SRI_RECONF_SENT|SRI_RECONF_INPROG)))
    {
        /* SRI_RECONF_SENT -> SRI_RECONF_INPROG. */
        if ((ri->flags & SRI_RECONF_SENT) &&
            ri->slave_master_host &&
            strcmp(ri->slave_master_host,
                    ri->master->promoted_slave->addr->ip) == 0 &&
            ri->slave_master_port == ri->master->promoted_slave->addr->port)
        {
            ri->flags &= ~SRI_RECONF_SENT;
            ri->flags |= SRI_RECONF_INPROG;
            sentinelEvent(LL_NOTICE,"+slave-reconf-inprog",ri,"%@");
        }

        /* SRI_RECONF_INPROG -> SRI_RECONF_DONE */
        if ((ri->flags & SRI_RECONF_INPROG) &&
            ri->slave_master_link_status == SENTINEL_MASTER_LINK_STATUS_UP)
        {
            ri->flags &= ~SRI_RECONF_INPROG;
            ri->flags |= SRI_RECONF_DONE;
            sentinelEvent(LL_NOTICE,"+slave-reconf-done",ri,"%@");
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x130(%rdi), %rdi
callq 0x392b6
movq %r14, %rdi
callq 0x39245
movq %rax, 0x130(%rbx)
movq $0x0, 0xa0(%rbx)
movq %r14, %rdi
callq 0x26510
leaq 0x4a0bd(%rip), %rdx     # 0xc6d70
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movl %eax, %esi
movl $0x2, %ecx
movq %r15, %r8
callq 0x3a9d4
movq %rax, 0x10(%rsp)
cmpl $0x0, (%r15)
jle 0x7d2d8
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %rbp
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7cd22
leaq 0x5232b(%rip), %rdx     # 0xcf028
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7cd24
movq -0x11(%rbp), %rax
jmp 0x7cd24
movzwl -0x5(%rbp), %eax
jmp 0x7cd24
movl -0x9(%rbp), %eax
jmp 0x7cd24
movzbl -0x3(%rbp), %eax
jmp 0x7cd24
xorl %eax, %eax
cmpq $0x2f, %rax
jb 0x7cd97
movl (%rbp), %eax
movl $0x5f6e7572, %ecx       # imm = 0x5F6E7572
xorl %ecx, %eax
movl 0x3(%rbp), %ecx
movl $0x3a64695f, %edx       # imm = 0x3A64695F
xorl %edx, %ecx
orl %eax, %ecx
jne 0x7cd97
movq 0x10(%rbx), %rdi
leaq 0x7(%rbp), %r15
testq %rdi, %rdi
je 0x7cd86
movl $0x28, %edx
movq %r15, %rsi
callq 0x26360
testl %eax, %eax
je 0x7cd97
movl $0x2, %edi
leaq 0x52ba0(%rip), %rsi     # 0xcf90c
movq %rbx, %rdx
leaq 0x5268a(%rip), %rcx     # 0xcf400
xorl %eax, %eax
callq 0x7a50c
movq 0x10(%rbx), %rdi
callq 0x392b6
movl $0x28, %esi
movq %r15, %rdi
callq 0x3910c
movq %rax, 0x10(%rbx)
testb $0x1, (%rbx)
je 0x7cf32
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7cdda
leaq 0x52287(%rip), %rdx     # 0xcf03c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7cddc
movq -0x11(%rbp), %rax
jmp 0x7cddc
movzwl -0x5(%rbp), %eax
jmp 0x7cddc
movl -0x9(%rbp), %eax
jmp 0x7cddc
movzbl -0x3(%rbp), %eax
jmp 0x7cddc
xorl %eax, %eax
cmpq $0x7, %rax
jb 0x7cf32
movl (%rbp), %eax
movl $0x76616c73, %ecx       # imm = 0x76616C73
xorl %ecx, %eax
movzbl 0x4(%rbp), %ecx
xorl $0x65, %ecx
orl %eax, %ecx
jne 0x7cf32
callq 0x26570
movq (%rax), %rax
movsbq 0x5(%rbp), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x7cf32
movq %rbp, %rdi
leaq 0x52af3(%rip), %rsi     # 0xcf914
callq 0x266c0
testq %rax, %rax
je 0x7ce7a
movq %rax, %r15
movq %rbp, %rdi
leaq 0x52ae0(%rip), %rsi     # 0xcf918
callq 0x266c0
testq %rax, %rax
je 0x7d2c5
movq %rax, %r12
addq $0x3, %r15
movq %r15, %rdi
movl $0x2c, %esi
callq 0x26800
testq %rax, %rax
je 0x7ce62
movb $0x0, (%rax)
addq $0x5, %r12
movq %r12, %rdi
movl $0x2c, %esi
callq 0x26800
testq %rax, %rax
jne 0x7cecb
jmp 0x7cece
movq %rbp, %rdi
movl $0x3a, %esi
callq 0x26800
testq %rax, %rax
je 0x7d2c5
movq %rax, %r15
incq %r15
movq %r15, %rdi
movl $0x2c, %esi
callq 0x26800
testq %rax, %rax
je 0x7d2c5
movq %rax, %r12
movb $0x0, (%rax)
incq %r12
movq %r12, %rdi
movl $0x2c, %esi
callq 0x26800
testq %rax, %rax
je 0x7d2c5
movb $0x0, (%rax)
movq %r12, %rdi
callq 0x26770
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x7b70f
testq %rax, %rax
jne 0x7cf32
movq %r12, %rdi
callq 0x26770
movl 0x90(%rbx), %r8d
xorl %edi, %edi
movl $0x2, %esi
movq %r15, %rdx
movl %eax, %ecx
movq %rbx, %r9
callq 0x7b48e
testq %rax, %rax
je 0x7cf32
movl $0x2, %edi
leaq 0x524e7(%rip), %rsi     # 0xcf403
movq %rax, %rdx
leaq 0x524da(%rip), %rcx     # 0xcf400
xorl %eax, %eax
callq 0x7a50c
callq 0x7a33b
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7cf6c
leaq 0x52109(%rip), %rdx     # 0xcf050
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7cf6e
movq -0x11(%rbp), %rax
jmp 0x7cf6e
movzwl -0x5(%rbp), %eax
jmp 0x7cf6e
movl -0x9(%rbp), %eax
jmp 0x7cf6e
movzbl -0x3(%rbp), %eax
jmp 0x7cf6e
xorl %eax, %eax
cmpq $0x20, %rax
jb 0x7cfbb
movdqu (%rbp), %xmm0
pcmpeqb 0x5217f(%rip), %xmm0    # 0xcf100
movdqu 0xe(%rbp), %xmm1
pcmpeqb 0x52162(%rip), %xmm1    # 0xcf0f0
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x7cfbb
leaq 0x1f(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x26b00
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, 0xa0(%rbx)
movq (%rbp), %rax
movabsq $0x73616d3a656c6f72, %rcx # imm = 0x73616D3A656C6F72
xorq %rcx, %rax
movq 0x3(%rbp), %rcx
movabsq $0x72657473616d3a65, %rdx # imm = 0x72657473616D3A65
xorq %rdx, %rcx
orq %rax, %rcx
je 0x7d00c
movq (%rbp), %rax
movabsq $0x616c733a656c6f72, %rcx # imm = 0x616C733A656C6F72
xorq %rcx, %rax
movzwl 0x8(%rbp), %ecx
xorq $0x6576, %rcx           # imm = 0x6576
orq %rax, %rcx
movl $0x2, %eax
cmovel %eax, %r13d
jmp 0x7d012
movl $0x1, %r13d
cmpl $0x2, %r13d
jne 0x7d2c5
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7d056
leaq 0x52033(%rip), %rdx     # 0xcf064
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7d058
movq -0x11(%rbp), %rax
jmp 0x7d058
movzwl -0x5(%rbp), %eax
jmp 0x7d058
movl -0x9(%rbp), %eax
jmp 0x7d058
movzbl -0x3(%rbp), %eax
jmp 0x7d058
xorl %eax, %eax
cmpq $0xc, %rax
jb 0x7d0bb
movq (%rbp), %rax
movabsq $0x685f72657473616d, %rcx # imm = 0x685F72657473616D
xorq %rcx, %rax
movl 0x8(%rbp), %ecx
xorq $0x3a74736f, %rcx       # imm = 0x3A74736F
orq %rax, %rcx
jne 0x7d0bb
movq 0xc0(%rbx), %r15
testq %r15, %r15
je 0x7d09a
leaq 0xc(%rbp), %rdi
movq %r15, %rsi
callq 0x26300
testl %eax, %eax
je 0x7d0bb
movq %r15, %rdi
callq 0x392b6
leaq 0xc(%rbp), %rdi
callq 0x39245
movq %rax, 0xc0(%rbx)
callq 0x330c8
movq %rax, 0x78(%rbx)
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7d0f5
leaq 0x51fa8(%rip), %rdx     # 0xcf078
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7d0f7
movq -0x11(%rbp), %rax
jmp 0x7d0f7
movzwl -0x5(%rbp), %eax
jmp 0x7d0f7
movl -0x9(%rbp), %eax
jmp 0x7d0f7
movzbl -0x3(%rbp), %eax
jmp 0x7d0f7
xorl %eax, %eax
cmpq $0xc, %rax
jb 0x7d13d
movq (%rbp), %rax
movabsq $0x705f72657473616d, %rcx # imm = 0x705F72657473616D
xorq %rcx, %rax
movl 0x8(%rbp), %ecx
xorq $0x3a74726f, %rcx       # imm = 0x3A74726F
orq %rax, %rcx
jne 0x7d13d
leaq 0xc(%rbp), %rdi
callq 0x26770
cmpl %eax, 0xc8(%rbx)
je 0x7d13d
movl %eax, 0xc8(%rbx)
callq 0x330c8
movq %rax, 0x78(%rbx)
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7d177
leaq 0x51f3a(%rip), %rdx     # 0xcf08c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7d179
movq -0x11(%rbp), %rax
jmp 0x7d179
movzwl -0x5(%rbp), %eax
jmp 0x7d179
movl -0x9(%rbp), %eax
jmp 0x7d179
movzbl -0x3(%rbp), %eax
jmp 0x7d179
xorl %eax, %eax
cmpq $0x13, %rax
jb 0x7d1c5
movdqu (%rbp), %xmm0
pcmpeqb 0x51f94(%rip), %xmm0    # 0xcf120
movdqu 0x3(%rbp), %xmm1
pcmpeqb 0x51f77(%rip), %xmm1    # 0xcf110
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x7d1c5
leaq 0x13(%rbp), %rdi
leaq 0x4df4a(%rip), %rsi     # 0xcb0fd
callq 0x26300
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0xcc(%rbx)
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7d1ff
leaq 0x51ec6(%rip), %rdx     # 0xcf0a0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7d201
movq -0x11(%rbp), %rax
jmp 0x7d201
movzwl -0x5(%rbp), %eax
jmp 0x7d201
movl -0x9(%rbp), %eax
jmp 0x7d201
movzbl -0x3(%rbp), %eax
jmp 0x7d201
xorl %eax, %eax
cmpq $0xf, %rax
jb 0x7d23d
movq (%rbp), %rax
movabsq $0x72705f6576616c73, %rcx # imm = 0x72705F6576616C73
xorq %rcx, %rax
movq 0x7(%rbp), %rcx
movabsq $0x3a797469726f6972, %rdx # imm = 0x3A797469726F6972
xorq %rdx, %rcx
orq %rax, %rcx
jne 0x7d23d
leaq 0xf(%rbp), %rdi
callq 0x26770
movl %eax, 0xa8(%rbx)
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7d277
leaq 0x51e62(%rip), %rdx     # 0xcf0b4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7d279
movq -0x11(%rbp), %rax
jmp 0x7d279
movzwl -0x5(%rbp), %eax
jmp 0x7d279
movl -0x9(%rbp), %eax
jmp 0x7d279
movzbl -0x3(%rbp), %eax
jmp 0x7d279
xorl %eax, %eax
cmpq $0x12, %rax
jb 0x7d2c5
movdqu (%rbp), %xmm0
pcmpeqb 0x51ea4(%rip), %xmm0    # 0xcf130
movzwl 0x10(%rbp), %eax
movd %eax, %xmm1
pcmpeqb 0x51ea4(%rip), %xmm1    # 0xcf140
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x7d2c5
addq $0x12, %rbp
movq %rbp, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x26a80
movq %rax, 0xd0(%rbx)
incq %r14
movslq 0xc(%rsp), %rax
cmpq %rax, %r14
jl 0x7ccdf
jmp 0x7d2db
xorl %r13d, %r13d
callq 0x330c8
movq %rax, 0x60(%rbx)
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x3ab7f
cmpl 0x68(%rbx), %r13d
je 0x7d365
callq 0x330c8
movq %rax, 0x70(%rbx)
movl %r13d, 0x68(%rbx)
cmpl $0x2, %r13d
jne 0x7d314
callq 0x330c8
movq %rax, 0x78(%rbx)
movl (%rbx), %eax
movl %eax, %ecx
andl $0x3, %ecx
cmpl %r13d, %ecx
leaq 0x52680(%rip), %rcx     # 0xcf9a5
leaq 0x52686(%rip), %rsi     # 0xcf9b2
cmoveq %rcx, %rsi
cmpl $0x1, %r13d
leaq 0x4e8e0(%rip), %r9      # 0xcbc1b
leaq 0x4e92b(%rip), %rcx     # 0xcbc6d
movq %rcx, %r8
cmoveq %r9, %r8
testb $0x1, %al
cmoveq %rcx, %r9
leaq 0x52669(%rip), %rcx     # 0xcf9bf
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
cmpl $0x0, 0x9e34c(%rip)     # 0x11b6b8
je 0x7d37d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rbx), %eax
testb $0x2, %al
je 0x7d4e2
cmpl $0x1, %r13d
jne 0x7d4e2
testb %al, %al
jns 0x7d463
movq 0xb8(%rbx), %rcx
testb $0x40, (%rcx)
je 0x7d45f
cmpl $0x4, 0xf0(%rcx)
jne 0x7d45f
movq 0xe8(%rcx), %rax
movq %rax, 0x18(%rcx)
movl $0x5, 0xf0(%rcx)
callq 0x330c8
movq 0xb8(%rbx), %rcx
movq %rax, 0xf8(%rcx)
callq 0x7a33b
leaq 0x525f0(%rip), %rsi     # 0xcf9da
leaq 0x5200f(%rip), %rcx     # 0xcf400
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
testb $0x2, 0x9e2e1(%rip)     # 0x11b6e8
jne 0x7d66b
movq 0xb8(%rbx), %rdx
leaq 0x525cf(%rip), %rsi     # 0xcf9ea
leaq 0x51fde(%rip), %rcx     # 0xcf400
movl $0x3, %edi
xorl %eax, %eax
callq 0x7a50c
movq 0x20(%rbx), %r8
movq 0xb8(%rbx), %rdi
movq 0x20(%rdi), %rcx
leaq 0x526fc(%rip), %rdx     # 0xcfb40
movl $0x20000, %esi          # imm = 0x20000
callq 0x7af3c
movq 0xb8(%rbx), %rdi
callq 0x7d68e
jmp 0x7d4e2
testb %al, %al
js 0x7d4e2
movq 0xb8(%rbx), %rdi
callq 0x7cc38
testl %eax, %eax
je 0x7d4e2
movq 0x48(%rbx), %r14
movq 0x50(%rbx), %rax
cmpq %r14, %rax
cmovgq %rax, %r14
testq %r14, %r14
je 0x7d497
callq 0x330c8
subq %r14, %rax
cmpq $0x1f41, %rax           # imm = 0x1F41
jl 0x7d4e2
callq 0x330c8
subq 0x70(%rbx), %rax
cmpq $0x1f41, %rax           # imm = 0x1F41
jl 0x7d4e2
movq 0xb8(%rbx), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
callq 0x7d6ce
testl %eax, %eax
jne 0x7d4e2
leaq 0x5253c(%rip), %rsi     # 0xcfa08
leaq 0x51f2d(%rip), %rcx     # 0xcf400
movl $0x2, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
testb $0x2, (%rbx)
je 0x7d59a
cmpl $0x2, %r13d
jne 0x7d59a
movl 0xc8(%rbx), %ecx
movq 0xb8(%rbx), %r14
movq 0x20(%r14), %rax
cmpl 0x8(%rax), %ecx
jne 0x7d51e
movq 0xc0(%rbx), %rdi
movq (%rax), %rsi
callq 0x26300
testl %eax, %eax
je 0x7d59a
movq 0x108(%r14), %r15
movq %r14, %rdi
callq 0x7cc38
testl %eax, %eax
je 0x7d59a
movq 0x48(%rbx), %r14
movq 0x50(%rbx), %rax
cmpq %r14, %rax
cmovgq %rax, %r14
testq %r14, %r14
je 0x7d552
callq 0x330c8
subq %r14, %rax
cmpq %r15, %rax
jle 0x7d59a
callq 0x330c8
subq 0x78(%rbx), %rax
cmpq %r15, %rax
jle 0x7d59a
movq 0xb8(%rbx), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
callq 0x7d6ce
testl %eax, %eax
jne 0x7d59a
leaq 0x52496(%rip), %rsi     # 0xcfa1a
leaq 0x51e75(%rip), %rcx     # 0xcf400
movl $0x2, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
movl (%rbx), %ebp
testl $0x300, %ebp            # imm = 0x300
je 0x7d36e
movl %ebp, %eax
andl $0x2, %eax
je 0x7d36e
cmpl $0x2, %r13d
jne 0x7d36e
btl $0x8, %ebp
jae 0x7d624
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x7d624
movq 0xb8(%rbx), %rax
movq 0x118(%rax), %rax
movq 0x20(%rax), %r14
movq (%r14), %rsi
callq 0x26900
testl %eax, %eax
jne 0x7d624
movl 0xc8(%rbx), %eax
cmpl 0x8(%r14), %eax
jne 0x7d624
andl $0xfffffcff, %ebp       # imm = 0xFFFFFCFF
orl $0x200, %ebp            # imm = 0x200
movl %ebp, (%rbx)
leaq 0x5241e(%rip), %rsi     # 0xcfa2c
leaq 0x51deb(%rip), %rcx     # 0xcf400
movl $0x2, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
movl (%rbx), %eax
btl $0x9, %eax
jae 0x7d36e
cmpl $0x0, 0xcc(%rbx)
jne 0x7d36e
andl $0xfffff9ff, %eax       # imm = 0xFFFFF9FF
orl $0x400, %eax            # imm = 0x400
movl %eax, (%rbx)
leaq 0x523f1(%rip), %rsi     # 0xcfa41
leaq 0x51da9(%rip), %rcx     # 0xcf400
movl $0x2, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7a50c
jmp 0x7d36e
callq 0x7d670