// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/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 0x311c8
movq %r14, %rdi
callq 0x3115a
movq %rax, 0x130(%rbx)
andq $0x0, 0xa0(%rbx)
movq %r14, %rdi
callq 0x26500
leaq 0x48576(%rip), %rdx     # 0xb5190
pushq $0x2
popq %rcx
leaq 0xc(%rsp), %r8
movq %r14, %rdi
movl %eax, %esi
callq 0x32003
movq %rax, 0x10(%rsp)
pushq $0x2c
popq %r15
xorl %ebp, %ebp
xorl %r12d, %r12d
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jge 0x6d029
movq 0x10(%rsp), %rax
movq (%rax,%rbp,8), %r13
movq %r13, %rdi
callq 0x6c6ff
cmpq $0x2f, %rax
jb 0x6ccc4
movq %r13, %rdi
leaq 0x509e7(%rip), %rsi     # 0xbd650
pushq $0x7
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6ccc4
movq 0x10(%rbx), %rdi
leaq 0x7(%r13), %r14
testq %rdi, %rdi
je 0x6ccb5
movq %r14, %rsi
pushq $0x28
popq %rdx
callq 0x26350
testl %eax, %eax
je 0x6ccc4
pushq $0x2
popq %rdi
leaq 0x509bd(%rip), %rsi     # 0xbd658
movq %rbx, %rdx
leaq 0x504a7(%rip), %rcx     # 0xbd14c
xorl %eax, %eax
callq 0x6a7bb
movq 0x10(%rbx), %rdi
callq 0x311c8
movq %r14, %rdi
pushq $0x28
popq %rsi
callq 0x31018
movq %rax, 0x10(%rbx)
testb $0x1, (%rbx)
je 0x6ce32
movq %r13, %rdi
callq 0x6c6ff
cmpq $0x7, %rax
jb 0x6ce32
movq %r13, %rdi
leaq 0x4cff4(%rip), %rsi     # 0xb9cdd
pushq $0x5
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6ce32
callq 0x26560
movq (%rax), %rax
movsbq 0x5(%r13), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x6ce32
movq %r13, %rdi
leaq 0x50945(%rip), %rsi     # 0xbd660
callq 0x266b0
testq %rax, %rax
je 0x6cd7a
movq %rax, %r14
movq %r13, %rdi
leaq 0x50932(%rip), %rsi     # 0xbd664
callq 0x266b0
testq %rax, %rax
je 0x6d01b
movq %rax, (%rsp)
addq $0x3, %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0x267f0
testq %rax, %rax
je 0x6cd5b
movb $0x0, (%rax)
movq (%rsp), %rdi
addq $0x5, %rdi
movq %rdi, (%rsp)
movl %r15d, %esi
callq 0x267f0
testq %rax, %rax
jne 0x6cdc6
movq (%rsp), %rcx
jmp 0x6cdcd
movq %r13, %rdi
pushq $0x3a
popq %rsi
callq 0x267f0
testq %rax, %rax
je 0x6d01b
movq %rax, %r14
incq %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0x267f0
testq %rax, %rax
je 0x6d01b
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
movq %rax, %rdi
pushq $0x2c
popq %rsi
callq 0x267f0
testq %rax, %rax
je 0x6d01b
movq (%rsp), %rcx
movb $0x0, (%rax)
movq %rcx, %rdi
movq %rcx, (%rsp)
callq 0x26760
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x6b7cb
testq %rax, %rax
jne 0x6ce32
movq (%rsp), %rdi
callq 0x26760
movl 0x90(%rbx), %r8d
xorl %edi, %edi
pushq $0x2
popq %rsi
movq %r14, %rdx
movl %eax, %ecx
movq %rbx, %r9
callq 0x6b555
testq %rax, %rax
je 0x6ce32
pushq $0x2
popq %rdi
leaq 0x50333(%rip), %rsi     # 0xbd14f
movq %rax, %rdx
leaq 0x50326(%rip), %rcx     # 0xbd14c
xorl %eax, %eax
callq 0x6a7bb
callq 0x6a604
movq %r13, %rdi
callq 0x6c6ff
cmpq $0x20, %rax
jb 0x6ce72
movq %r13, %rdi
leaq 0x50820(%rip), %rsi     # 0xbd66a
pushq $0x1e
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6ce72
leaq 0x1f(%r13), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x26af0
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, 0xa0(%rbx)
movq %r13, %rdi
leaq 0x5080d(%rip), %rsi     # 0xbd689
pushq $0xb
popq %rdx
callq 0x266f0
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x6d01e
movq %r13, %rdi
leaq 0x507fc(%rip), %rsi     # 0xbd695
pushq $0xa
popq %rdx
callq 0x266f0
testl %eax, %eax
sete %al
cmpl $0x2, %r12d
sete %dl
orb %al, %dl
movl %r12d, %ecx
cmpb $0x1, %dl
jne 0x6d01e
movq %r13, %rdi
callq 0x6c6ff
cmpq $0xc, %rax
jb 0x6cf1c
movq %r13, %rdi
leaq 0x507cd(%rip), %rsi     # 0xbd6a0
pushq $0xc
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6cf1c
movq 0xc0(%rbx), %r14
testq %r14, %r14
je 0x6cefb
leaq 0xc(%r13), %rdi
movq %r14, %rsi
callq 0x262f0
testl %eax, %eax
je 0x6cf1c
movq %r14, %rdi
callq 0x311c8
leaq 0xc(%r13), %rdi
callq 0x3115a
movq %rax, 0xc0(%rbx)
callq 0x2b8ae
movq %rax, 0x78(%rbx)
movq %r13, %rdi
callq 0x6c6ff
cmpq $0xc, %rax
jb 0x6cf60
movq %r13, %rdi
leaq 0x50779(%rip), %rsi     # 0xbd6ad
pushq $0xc
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6cf60
leaq 0xc(%r13), %rdi
callq 0x26760
cmpl %eax, 0xc8(%rbx)
je 0x6cf60
movl %eax, 0xc8(%rbx)
callq 0x2b8ae
movq %rax, 0x78(%rbx)
movq %r13, %rdi
callq 0x6c6ff
cmpq $0x13, %rax
jb 0x6cfa1
movq %r13, %rdi
leaq 0x50742(%rip), %rsi     # 0xbd6ba
pushq $0x13
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6cfa1
leaq 0x13(%r13), %rdi
leaq 0x4c1de(%rip), %rsi     # 0xb916d
callq 0x262f0
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0xcc(%rbx)
movq %r13, %rdi
callq 0x6c6ff
cmpq $0xf, %rax
jb 0x6cfd4
movq %r13, %rdi
leaq 0x50715(%rip), %rsi     # 0xbd6ce
pushq $0xf
popq %rdx
callq 0x266f0
testl %eax, %eax
jne 0x6cfd4
leaq 0xf(%r13), %rdi
callq 0x26760
movl %eax, 0xa8(%rbx)
movq %r13, %rdi
callq 0x6c6ff
pushq $0x2
popq %rcx
cmpq $0x12, %rax
jb 0x6d01e
movq %r13, %rdi
leaq 0x506ef(%rip), %rsi     # 0xbd6de
pushq $0x12
popq %rdx
callq 0x266f0
pushq $0x2
popq %rcx
testl %eax, %eax
jne 0x6d01e
addq $0x12, %r13
movq %r13, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x26a70
movq %rax, 0xd0(%rbx)
pushq $0x2
popq %rcx
jmp 0x6d01e
movl %r12d, %ecx
incq %rbp
movl %ecx, %r12d
jmp 0x6cc3a
callq 0x2b8ae
movq %rax, 0x60(%rbx)
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x321be
cmpl 0x68(%rbx), %r12d
je 0x6d0b1
callq 0x2b8ae
movq %rax, 0x70(%rbx)
movl %r12d, 0x68(%rbx)
cmpl $0x2, %r12d
jne 0x6d062
callq 0x2b8ae
movq %rax, 0x78(%rbx)
movl (%rbx), %eax
movl %eax, %ecx
andl $0x3, %ecx
cmpl %r12d, %ecx
leaq 0x5067e(%rip), %rcx     # 0xbd6f1
leaq 0x50684(%rip), %rsi     # 0xbd6fe
cmoveq %rcx, %rsi
cmpl $0x1, %r12d
leaq 0x4cc02(%rip), %r9      # 0xb9c8b
leaq 0x4cc4d(%rip), %rcx     # 0xb9cdd
movq %rcx, %r8
cmoveq %r9, %r8
testb $0x1, %al
cmoveq %rcx, %r9
leaq 0x50667(%rip), %rcx     # 0xbd70b
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
cmpl $0x0, 0xa1660(%rip)     # 0x10e718
je 0x6d0c9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rbx), %eax
movl %eax, %ecx
shrb %cl
cmpl $0x1, %r12d
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x6d21a
movq 0xb8(%rbx), %rdi
testb %al, %al
js 0x6d164
callq 0x6cba2
testl %eax, %eax
je 0x6d21a
movl $0x1f40, %esi           # imm = 0x1F40
movq %rbx, %rdi
callq 0x6bc85
testl %eax, %eax
je 0x6d21a
callq 0x2b8ae
subq 0x70(%rbx), %rax
cmpq $0x1f41, %rax           # imm = 0x1F41
jl 0x6d21a
movq 0xb8(%rbx), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
callq 0x6d3ed
testl %eax, %eax
jne 0x6d21a
leaq 0x50609(%rip), %rsi     # 0xbd754
leaq 0x4fffa(%rip), %rcx     # 0xbd14c
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
jmp 0x6d21a
testb $0x40, (%rdi)
je 0x6d21a
cmpl $0x4, 0xf0(%rdi)
jne 0x6d21a
movq 0xe8(%rdi), %rax
movq %rax, 0x18(%rdi)
movl $0x5, 0xf0(%rdi)
callq 0x2b8ae
movq 0xb8(%rbx), %rcx
movq %rax, 0xf8(%rcx)
callq 0x6a604
leaq 0x50578(%rip), %rsi     # 0xbd726
leaq 0x4ff97(%rip), %rcx     # 0xbd14c
pushq $0x3
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
testb $0x2, 0xa157f(%rip)     # 0x10e748
jne 0x6d38f
movq 0xb8(%rbx), %rdx
leaq 0x50559(%rip), %rsi     # 0xbd736
leaq 0x4ff68(%rip), %rcx     # 0xbd14c
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x6a7bb
movq 0x20(%rbx), %r8
movq 0xb8(%rbx), %rdi
movq 0x20(%rdi), %rcx
leaq 0x50688(%rip), %rdx     # 0xbd88c
movl $0x20000, %esi          # imm = 0x20000
callq 0x6b0e1
movq 0xb8(%rbx), %rdi
callq 0x6d3ae
cmpl $0x2, %r12d
sete %al
movb (%rbx), %cl
shrb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6d2c1
movl 0xc8(%rbx), %ecx
movq 0xb8(%rbx), %r15
movq 0x20(%r15), %rax
cmpl 0x8(%rax), %ecx
jne 0x6d259
movq 0xc0(%rbx), %rdi
movq (%rax), %rsi
callq 0x262f0
testl %eax, %eax
je 0x6d2c1
movq 0x108(%r15), %r14
movq %r15, %rdi
callq 0x6cba2
testl %eax, %eax
je 0x6d2c1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6bc85
testl %eax, %eax
je 0x6d2c1
callq 0x2b8ae
subq 0x78(%rbx), %rax
cmpq %r14, %rax
jle 0x6d2c1
movq 0xb8(%rbx), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
callq 0x6d3ed
testl %eax, %eax
jne 0x6d2c1
leaq 0x504b9(%rip), %rsi     # 0xbd766
leaq 0x4fe98(%rip), %rcx     # 0xbd14c
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
movl (%rbx), %ebp
testw $0x300, %bp             # imm = 0x300
je 0x6d0ba
movl %ebp, %eax
andl $0x2, %eax
je 0x6d0ba
cmpl $0x2, %r12d
jne 0x6d0ba
btl $0x8, %ebp
jae 0x6d34a
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x6d34a
movq 0xb8(%rbx), %rax
movq 0x118(%rax), %rax
movq 0x20(%rax), %r14
movq (%r14), %rsi
callq 0x268f0
testl %eax, %eax
jne 0x6d34a
movl 0xc8(%rbx), %eax
cmpl 0x8(%r14), %eax
jne 0x6d34a
andl $0xfffffcff, %ebp       # imm = 0xFFFFFCFF
orl $0x200, %ebp            # imm = 0x200
movl %ebp, (%rbx)
leaq 0x50444(%rip), %rsi     # 0xbd778
leaq 0x4fe11(%rip), %rcx     # 0xbd14c
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
movl (%rbx), %ebp
btl $0x9, %ebp
jae 0x6d0ba
cmpl $0x0, 0xcc(%rbx)
jne 0x6d0ba
andl $0xfffff9ff, %ebp       # imm = 0xFFFFF9FF
orl $0x400, %ebp            # imm = 0x400
movl %ebp, (%rbx)
leaq 0x50417(%rip), %rsi     # 0xbd78d
leaq 0x4fdcf(%rip), %rcx     # 0xbd14c
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a7bb
jmp 0x6d0ba
callq 0x6d394