// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: createSharedObjects
void createSharedObjects(void) {
    int j;

    // 常用回复
    shared.crlf = createObject(REDIS_STRING,sdsnew("\r\n"));
    shared.ok = createObject(REDIS_STRING,sdsnew("+OK\r\n"));
    shared.err = createObject(REDIS_STRING,sdsnew("-ERR\r\n"));
    shared.emptybulk = createObject(REDIS_STRING,sdsnew("$0\r\n\r\n"));
    shared.czero = createObject(REDIS_STRING,sdsnew(":0\r\n"));
    shared.cone = createObject(REDIS_STRING,sdsnew(":1\r\n"));
    shared.cnegone = createObject(REDIS_STRING,sdsnew(":-1\r\n"));
    shared.nullbulk = createObject(REDIS_STRING,sdsnew("$-1\r\n"));
    shared.nullmultibulk = createObject(REDIS_STRING,sdsnew("*-1\r\n"));
    shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n"));
    shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
    shared.queued = createObject(REDIS_STRING,sdsnew("+QUEUED\r\n"));
    shared.emptyscan = createObject(REDIS_STRING,sdsnew("*2\r\n$1\r\n0\r\n*0\r\n"));
    // 常用错误回复
    shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
        "-WRONGTYPE Operation against a key holding the wrong kind of value\r\n"));
    shared.nokeyerr = createObject(REDIS_STRING,sdsnew(
        "-ERR no such key\r\n"));
    shared.syntaxerr = createObject(REDIS_STRING,sdsnew(
        "-ERR syntax error\r\n"));
    shared.sameobjecterr = createObject(REDIS_STRING,sdsnew(
        "-ERR source and destination objects are the same\r\n"));
    shared.outofrangeerr = createObject(REDIS_STRING,sdsnew(
        "-ERR index out of range\r\n"));
    shared.noscripterr = createObject(REDIS_STRING,sdsnew(
        "-NOSCRIPT No matching script. Please use EVAL.\r\n"));
    shared.loadingerr = createObject(REDIS_STRING,sdsnew(
        "-LOADING Redis is loading the dataset in memory\r\n"));
    shared.slowscripterr = createObject(REDIS_STRING,sdsnew(
        "-BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.\r\n"));
    shared.masterdownerr = createObject(REDIS_STRING,sdsnew(
        "-MASTERDOWN Link with MASTER is down and slave-serve-stale-data is set to 'no'.\r\n"));
    shared.bgsaveerr = createObject(REDIS_STRING,sdsnew(
        "-MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.\r\n"));
    shared.roslaveerr = createObject(REDIS_STRING,sdsnew(
        "-READONLY You can't write against a read only slave.\r\n"));
    shared.noautherr = createObject(REDIS_STRING,sdsnew(
        "-NOAUTH Authentication required.\r\n"));
    shared.oomerr = createObject(REDIS_STRING,sdsnew(
        "-OOM command not allowed when used memory > 'maxmemory'.\r\n"));
    shared.execaborterr = createObject(REDIS_STRING,sdsnew(
        "-EXECABORT Transaction discarded because of previous errors.\r\n"));
    shared.noreplicaserr = createObject(REDIS_STRING,sdsnew(
        "-NOREPLICAS Not enough good slaves to write.\r\n"));
    shared.busykeyerr = createObject(REDIS_STRING,sdsnew(
        "-BUSYKEY Target key name already exists.\r\n"));

    // 常用字符
    shared.space = createObject(REDIS_STRING,sdsnew(" "));
    shared.colon = createObject(REDIS_STRING,sdsnew(":"));
    shared.plus = createObject(REDIS_STRING,sdsnew("+"));

    // 常用 SELECT 命令
    for (j = 0; j < REDIS_SHARED_SELECT_CMDS; j++) {
        char dictid_str[64];
        int dictid_len;

        dictid_len = ll2string(dictid_str,sizeof(dictid_str),j);
        shared.select[j] = createObject(REDIS_STRING,
            sdscatprintf(sdsempty(),
                "*2\r\n$6\r\nSELECT\r\n$%d\r\n%s\r\n",
                dictid_len, dictid_str));
    }

    // 发布与订阅的有关回复
    shared.messagebulk = createStringObject("$7\r\nmessage\r\n",13);
    shared.pmessagebulk = createStringObject("$8\r\npmessage\r\n",14);
    shared.subscribebulk = createStringObject("$9\r\nsubscribe\r\n",15);
    shared.unsubscribebulk = createStringObject("$11\r\nunsubscribe\r\n",18);
    shared.psubscribebulk = createStringObject("$10\r\npsubscribe\r\n",17);
    shared.punsubscribebulk = createStringObject("$12\r\npunsubscribe\r\n",19);

    // 常用命令
    shared.del = createStringObject("DEL",3);
    shared.rpop = createStringObject("RPOP",4);
    shared.lpop = createStringObject("LPOP",4);
    shared.lpush = createStringObject("LPUSH",5);

    // 常用整数
    for (j = 0; j < REDIS_SHARED_INTEGERS; j++) {
        shared.integers[j] = createObject(REDIS_STRING,(void*)(long)j);
        shared.integers[j]->encoding = REDIS_ENCODING_INT;
    }

    // 常用长度 bulk 或者 multi bulk 回复
    for (j = 0; j < REDIS_SHARED_BULKHDR_LEN; j++) {
        shared.mbulkhdr[j] = createObject(REDIS_STRING,
            sdscatprintf(sdsempty(),"*%d\r\n",j));
        shared.bulkhdr[j] = createObject(REDIS_STRING,
            sdscatprintf(sdsempty(),"$%d\r\n",j));
    }
    /* The following two shared objects, minstring and maxstrings, are not
     * actually used for their value but as a special object meaning
     * respectively the minimum possible string and the maximum possible
     * string in string comparisons for the ZRANGEBYLEX command. */
    shared.minstring = createStringObject("minstring",9);
    shared.maxstring = createStringObject("maxstring",9);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq 0x753b4(%rip), %rdi     # 0x996c7
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa64d7(%rip)     # 0xca800
leaq 0x70506(%rip), %rdi     # 0x94836
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa64c2(%rip)     # 0xca808
leaq 0x704ef(%rip), %rdi     # 0x9483c
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa64ad(%rip)     # 0xca810
leaq 0x704d9(%rip), %rdi     # 0x94843
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6498(%rip)     # 0xca818
leaq 0x704c3(%rip), %rdi     # 0x9484a
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6483(%rip)     # 0xca820
leaq 0x704ab(%rip), %rdi     # 0x9484f
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa646e(%rip)     # 0xca828
leaq 0x70493(%rip), %rdi     # 0x94854
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6459(%rip)     # 0xca830
leaq 0x7047c(%rip), %rdi     # 0x9485a
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa645c(%rip)     # 0xca850
leaq 0x70465(%rip), %rdi     # 0x94860
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6447(%rip)     # 0xca858
leaq 0x7046b(%rip), %rdi     # 0x94883
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa643a(%rip)     # 0xca868
leaq 0x70431(%rip), %rdi     # 0x94866
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa63ed(%rip)     # 0xca838
leaq 0x7041c(%rip), %rdi     # 0x9486e
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa63f8(%rip)     # 0xca860
leaq 0x70409(%rip), %rdi     # 0x94878
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa64c3(%rip)     # 0xca948
leaq 0x703fc(%rip), %rdi     # 0x94888
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa63ce(%rip)     # 0xca870
leaq 0x70424(%rip), %rdi     # 0x948cd
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa63b9(%rip)     # 0xca878
leaq 0x7041a(%rip), %rdi     # 0x948e0
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa63a4(%rip)     # 0xca880
leaq 0x70411(%rip), %rdi     # 0x948f4
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa638f(%rip)     # 0xca888
leaq 0x70427(%rip), %rdi     # 0x94927
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa637a(%rip)     # 0xca890
leaq 0x70424(%rip), %rdi     # 0x94941
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6365(%rip)     # 0xca898
leaq 0x70438(%rip), %rdi     # 0x94972
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6350(%rip)     # 0xca8a0
leaq 0x7044d(%rip), %rdi     # 0x949a4
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa633b(%rip)     # 0xca8a8
leaq 0x7048a(%rip), %rdi     # 0x949fe
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa632e(%rip)     # 0xca8b8
leaq 0x704bf(%rip), %rdi     # 0x94a50
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6309(%rip)     # 0xca8b0
leaq 0x7056f(%rip), %rdi     # 0x94b1d
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa62fc(%rip)     # 0xca8c0
leaq 0x70589(%rip), %rdi     # 0x94b54
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa62ef(%rip)     # 0xca8d0
leaq 0x7058f(%rip), %rdi     # 0x94b77
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa62ea(%rip)     # 0xca8e8
leaq 0x705ad(%rip), %rdi     # 0x94bb2
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa62ad(%rip)     # 0xca8c8
leaq 0x705cf(%rip), %rdi     # 0x94bf1
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa62a0(%rip)     # 0xca8d8
leaq 0x705e1(%rip), %rdi     # 0x94c20
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa628b(%rip)     # 0xca8e0
leaq 0x75d6b(%rip), %rdi     # 0x9a3c7
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa61ce(%rip)     # 0xca840
leaq 0x773be(%rip), %rdi     # 0x9ba37
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa61b9(%rip)     # 0xca848
leaq 0x705b5(%rip), %rdi     # 0x94c4b
callq 0x281da
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0xa6244(%rip)     # 0xca8f0
movq %rsp, %rbx
leaq 0x70597(%rip), %r14     # 0x94c4d
leaq 0xa6143(%rip), %r12     # 0xca800
xorl %r15d, %r15d
movl $0x40, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2fe12
movl %eax, %ebp
callq 0x281b2
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x28760
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0x160(%r12,%r15,8)
incq %r15
cmpq $0xa, %r15
jne 0x246c0
leaq 0x7055c(%rip), %rdi     # 0x94c67
movl $0xd, %esi
callq 0x303b7
movq %rax, 0xa61dc(%rip)     # 0xca8f8
leaq 0x70552(%rip), %rdi     # 0x94c75
movl $0xe, %esi
callq 0x303b7
movq %rax, 0xa61cc(%rip)     # 0xca900
leaq 0x70549(%rip), %rdi     # 0x94c84
movl $0xf, %esi
callq 0x303b7
movq %rax, 0xa61bc(%rip)     # 0xca908
leaq 0x70541(%rip), %rdi     # 0x94c94
movl $0x12, %esi
callq 0x303b7
movq %rax, 0xa61ac(%rip)     # 0xca910
leaq 0x7053c(%rip), %rdi     # 0x94ca7
movl $0x11, %esi
callq 0x303b7
movq %rax, 0xa619c(%rip)     # 0xca918
leaq 0x70536(%rip), %rdi     # 0x94cb9
movl $0x13, %esi
callq 0x303b7
movq %rax, 0xa618c(%rip)     # 0xca920
leaq 0x70532(%rip), %rdi     # 0x94ccd
movl $0x3, %esi
callq 0x303b7
movq %rax, 0xa617c(%rip)     # 0xca928
leaq 0x7051e(%rip), %rdi     # 0x94cd1
movl $0x4, %esi
callq 0x303b7
movq %rax, 0xa616c(%rip)     # 0xca930
leaq 0x7050b(%rip), %rdi     # 0x94cd6
movl $0x4, %esi
callq 0x303b7
movq %rax, 0xa615c(%rip)     # 0xca938
leaq 0x704f8(%rip), %rdi     # 0x94cdb
movl $0x5, %esi
callq 0x303b7
movq %rax, 0xa614c(%rip)     # 0xca940
xorl %ebx, %ebx
movl $0xffffff0f, %ebp       # imm = 0xFFFFFF0F
xorl %edi, %edi
movq %rbx, %rsi
callq 0x302c4
movq %rax, 0x1b0(%r12,%rbx,8)
movl (%rax), %ecx
andl %ebp, %ecx
orl $0x10, %ecx
movl %ecx, (%rax)
incq %rbx
cmpq $0x2710, %rbx           # imm = 0x2710
jne 0x247fb
leaq 0x704b8(%rip), %rbx     # 0x94ce1
leaq 0x704b7(%rip), %r14     # 0x94ce7
xorl %r15d, %r15d
callq 0x281b2
movq %rax, %rdi
movq %rbx, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x28760
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0x13a30(%r12,%r15,8)
callq 0x281b2
movq %rax, %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x28760
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
movq %rax, 0x13b30(%r12,%r15,8)
incq %r15
cmpq $0x20, %r15
jne 0x24833
leaq 0x7045c(%rip), %rdi     # 0x94ced
movl $0x9, %esi
callq 0x303b7
movq %rax, 0xa60ae(%rip)     # 0xca950
leaq 0x7044e(%rip), %rdi     # 0x94cf7
movl $0x9, %esi
callq 0x303b7
movq %rax, 0xa609e(%rip)     # 0xca958
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq