// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/server.c
// Function: initServerConfig
void initServerConfig(void) {
    int j;

    getRandomHexChars(server.runid,CONFIG_RUN_ID_SIZE);
    server.configfile = NULL;
    server.executable = NULL;
    server.hz = CONFIG_DEFAULT_HZ;
    server.runid[CONFIG_RUN_ID_SIZE] = '\0';
    server.arch_bits = (sizeof(long) == 8) ? 64 : 32;
    server.port = CONFIG_DEFAULT_SERVER_PORT;
    server.tcp_backlog = CONFIG_DEFAULT_TCP_BACKLOG;
    server.bindaddr_count = 0;
    server.unixsocket = NULL;
    server.unixsocketperm = CONFIG_DEFAULT_UNIX_SOCKET_PERM;
    server.ipfd_count = 0;
    server.sofd = -1;
    server.protected_mode = CONFIG_DEFAULT_PROTECTED_MODE;
    server.dbnum = CONFIG_DEFAULT_DBNUM;
    server.verbosity = CONFIG_DEFAULT_VERBOSITY;
    server.maxidletime = CONFIG_DEFAULT_CLIENT_TIMEOUT;
    server.tcpkeepalive = CONFIG_DEFAULT_TCP_KEEPALIVE;
    server.active_expire_enabled = 1;
    server.client_max_querybuf_len = PROTO_MAX_QUERYBUF_LEN;
    server.saveparams = NULL;
    server.loading = 0;
    server.logfile = zstrdup(CONFIG_DEFAULT_LOGFILE);
    server.syslog_enabled = CONFIG_DEFAULT_SYSLOG_ENABLED;
    server.syslog_ident = zstrdup(CONFIG_DEFAULT_SYSLOG_IDENT);
    server.syslog_facility = LOG_LOCAL0;
    server.daemonize = CONFIG_DEFAULT_DAEMONIZE;
    server.supervised = 0;
    server.supervised_mode = SUPERVISED_NONE;
    server.aof_state = AOF_OFF;
    server.aof_fsync = CONFIG_DEFAULT_AOF_FSYNC;
    server.aof_no_fsync_on_rewrite = CONFIG_DEFAULT_AOF_NO_FSYNC_ON_REWRITE;
    server.aof_rewrite_perc = AOF_REWRITE_PERC;
    server.aof_rewrite_min_size = AOF_REWRITE_MIN_SIZE;
    server.aof_rewrite_base_size = 0;
    server.aof_rewrite_scheduled = 0;
    server.aof_last_fsync = time(NULL);
    server.aof_rewrite_time_last = -1;
    server.aof_rewrite_time_start = -1;
    server.aof_lastbgrewrite_status = C_OK;
    server.aof_delayed_fsync = 0;
    server.aof_fd = -1;
    server.aof_selected_db = -1; /* Make sure the first time will not match */
    server.aof_flush_postponed_start = 0;
    server.aof_rewrite_incremental_fsync = CONFIG_DEFAULT_AOF_REWRITE_INCREMENTAL_FSYNC;
    server.aof_load_truncated = CONFIG_DEFAULT_AOF_LOAD_TRUNCATED;

#ifdef AOF_NO_COW
    server.aof_no_cow.enable = 0;
    server.aof_no_cow.version = 0;
    server.aof_no_cow.pipe_warning_len = AOF_PIPE_WARNING_LEN;
    server.aof_no_cow.pipe_max_len = AOF_PIPE_MAX_LEN;
#endif

    server.pidfile = NULL;
    server.rdb_filename = zstrdup(CONFIG_DEFAULT_RDB_FILENAME);
    server.aof_filename = zstrdup(CONFIG_DEFAULT_AOF_FILENAME);
    server.requirepass = NULL;
    server.rdb_compression = CONFIG_DEFAULT_RDB_COMPRESSION;
    server.rdb_checksum = CONFIG_DEFAULT_RDB_CHECKSUM;
    server.stop_writes_on_bgsave_err = CONFIG_DEFAULT_STOP_WRITES_ON_BGSAVE_ERROR;
    server.activerehashing = CONFIG_DEFAULT_ACTIVE_REHASHING;
    server.notify_keyspace_events = 0;
    server.maxclients = CONFIG_DEFAULT_MAX_CLIENTS;
    server.bpop_blocked_clients = 0;
    server.maxmemory = CONFIG_DEFAULT_MAXMEMORY;
    server.maxmemory_policy = CONFIG_DEFAULT_MAXMEMORY_POLICY;
    server.maxmemory_samples = CONFIG_DEFAULT_MAXMEMORY_SAMPLES;
    server.hash_max_ziplist_entries = OBJ_HASH_MAX_ZIPLIST_ENTRIES;
    server.hash_max_ziplist_value = OBJ_HASH_MAX_ZIPLIST_VALUE;
    server.list_max_ziplist_size = OBJ_LIST_MAX_ZIPLIST_SIZE;
    server.list_compress_depth = OBJ_LIST_COMPRESS_DEPTH;
    server.set_max_intset_entries = OBJ_SET_MAX_INTSET_ENTRIES;
    server.zset_max_ziplist_entries = OBJ_ZSET_MAX_ZIPLIST_ENTRIES;
    server.zset_max_ziplist_value = OBJ_ZSET_MAX_ZIPLIST_VALUE;
    server.hll_sparse_max_bytes = CONFIG_DEFAULT_HLL_SPARSE_MAX_BYTES;
    server.shutdown_asap = 0;
    server.repl_ping_slave_period = CONFIG_DEFAULT_REPL_PING_SLAVE_PERIOD;
    server.repl_timeout = CONFIG_DEFAULT_REPL_TIMEOUT;
    server.repl_min_slaves_to_write = CONFIG_DEFAULT_MIN_SLAVES_TO_WRITE;
    server.repl_min_slaves_max_lag = CONFIG_DEFAULT_MIN_SLAVES_MAX_LAG;
    server.cluster_enabled = 0;
    server.cluster_node_timeout = CLUSTER_DEFAULT_NODE_TIMEOUT;
    server.cluster_migration_barrier = CLUSTER_DEFAULT_MIGRATION_BARRIER;
    server.cluster_slave_validity_factor = CLUSTER_DEFAULT_SLAVE_VALIDITY;
    server.cluster_require_full_coverage = CLUSTER_DEFAULT_REQUIRE_FULL_COVERAGE;
    server.cluster_configfile = zstrdup(CONFIG_DEFAULT_CLUSTER_CONFIG_FILE);
    server.migrate_cached_sockets = dictCreate(&migrateCacheDictType,NULL);
    server.next_client_id = 1; /* Client IDs, start from 1 .*/
    server.loading_process_events_interval_bytes = (1024*1024*2);

    server.lruclock = getLRUClock();
    resetServerSaveParams();

    appendServerSaveParams(60*60,1);  /* save after 1 hour and 1 change */
    appendServerSaveParams(300,100);  /* save after 5 minutes and 100 changes */
    appendServerSaveParams(60,10000); /* save after 1 minute and 10000 changes */
    /* Replication related */
    server.masterauth = NULL;
    server.masterhost = NULL;
    server.masterport = 6379;
    server.master = NULL;
    server.cached_master = NULL;
    server.repl_master_initial_offset = -1;
    server.repl_state = REPL_STATE_NONE;
    server.repl_syncio_timeout = CONFIG_REPL_SYNCIO_TIMEOUT;
    server.repl_serve_stale_data = CONFIG_DEFAULT_SLAVE_SERVE_STALE_DATA;
    server.repl_slave_ro = CONFIG_DEFAULT_SLAVE_READ_ONLY;
    server.repl_down_since = 0; /* Never connected, repl is down since EVER. */
    server.repl_disable_tcp_nodelay = CONFIG_DEFAULT_REPL_DISABLE_TCP_NODELAY;
    server.repl_diskless_sync = CONFIG_DEFAULT_REPL_DISKLESS_SYNC;
    server.repl_diskless_sync_delay = CONFIG_DEFAULT_REPL_DISKLESS_SYNC_DELAY;
    server.slave_priority = CONFIG_DEFAULT_SLAVE_PRIORITY;
    server.slave_announce_ip = CONFIG_DEFAULT_SLAVE_ANNOUNCE_IP;
    server.slave_announce_port = CONFIG_DEFAULT_SLAVE_ANNOUNCE_PORT;
    server.master_repl_offset = 0;

    /* Replication partial resync backlog */
    server.repl_backlog = NULL;
    server.repl_backlog_size = CONFIG_DEFAULT_REPL_BACKLOG_SIZE;
    server.repl_backlog_histlen = 0;
    server.repl_backlog_idx = 0;
    server.repl_backlog_off = 0;
    server.repl_backlog_time_limit = CONFIG_DEFAULT_REPL_BACKLOG_TIME_LIMIT;
    server.repl_no_slaves_since = time(NULL);

    /* Client output buffer limits */
    for (j = 0; j < CLIENT_TYPE_OBUF_COUNT; j++)
        server.client_obuf_limits[j] = clientBufferLimitsDefaults[j];

    /* Double constants initialization */
    R_Zero = 0.0;
    R_PosInf = 1.0/R_Zero;
    R_NegInf = -1.0/R_Zero;
    R_Nan = R_Zero/R_Zero;

    /* Command table -- we initiialize it here as it is part of the
     * initial configuration, since command names may be changed via
     * redis.conf using the rename-command directive. */
    server.commands = dictCreate(&commandTableDictType,NULL);
    server.orig_commands = dictCreate(&commandTableDictType,NULL);
    populateCommandTable();
    server.delCommand = lookupCommandByCString("del");
    server.multiCommand = lookupCommandByCString("multi");
    server.lpushCommand = lookupCommandByCString("lpush");
    server.lpopCommand = lookupCommandByCString("lpop");
    server.rpopCommand = lookupCommandByCString("rpop");
    server.sremCommand = lookupCommandByCString("srem");
    server.execCommand = lookupCommandByCString("exec");

    /* Slow log */
    server.slowlog_log_slower_than = CONFIG_DEFAULT_SLOWLOG_LOG_SLOWER_THAN;
    server.slowlog_max_len = CONFIG_DEFAULT_SLOWLOG_MAX_LEN;

    /* Latency monitor */
    server.latency_monitor_threshold = CONFIG_DEFAULT_LATENCY_MONITOR_THRESHOLD;

    /* Debugging */
    server.assert_failed = "<no assertion failed>";
    server.assert_file = "<no file>";
    server.assert_line = 0;
    server.bug_report_start = 0;
    server.watchdog_period = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xd1e48(%rip), %rdi     # 0x1068c8
movl $0x28, %esi
callq 0x43699
xorps %xmm0, %xmm0
movups %xmm0, 0xd1dcc(%rip)    # 0x106860
movl $0xa, %ebp
movl %ebp, 0xd1dd9(%rip)     # 0x106878
movb $0x0, 0xd1e4a(%rip)     # 0x1068f0
movl $0x40, 0xd1e10(%rip)    # 0x1068c0
movabsq $0x1ff000018eb, %rax    # imm = 0x1FF000018EB
movq %rax, 0xd1e37(%rip)     # 0x1068f8
xorl %r14d, %r14d
movl %r14d, 0xd1eb5(%rip)    # 0x106980
movq %r14, 0xd1eb6(%rip)     # 0x106988
movl %r14d, 0xd1eb7(%rip)    # 0x106990
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0xd1eea(%rip)     # 0x1069d4
movl $0x1, %ebx
movq %rbx, 0xd207a(%rip)     # 0x106b70
movl $0x10, 0xd2358(%rip)    # 0x106e58
movdqa 0x8a9b8(%rip), %xmm0    # 0xbf4c0
movdqu %xmm0, 0xd2330(%rip)    # 0x106e40
movq $0x40000000, 0xd2335(%rip) # imm = 0x40000000
movq %r14, 0xd245e(%rip)     # 0x106f80
leaq 0x8ef44(%rip), %rdi     # 0xc3a6d
callq 0x3b419
movq %rax, 0xd24b3(%rip)     # 0x106fe8
movl %r14d, 0xd24b4(%rip)    # 0x106ff0
leaq 0x8b513(%rip), %rdi     # 0xc0056
callq 0x3b419
movq %rax, 0xd24a9(%rip)     # 0x106ff8
movl $0x80, 0xd24a7(%rip)    # 0x107000
movl %r14d, 0xd2304(%rip)    # 0x106e64
movq %r14, 0xd22f5(%rip)     # 0x106e5c
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, 0xd2338(%rip)     # 0x106eb0
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, 0xd2337(%rip)     # 0x106ec0
movq $0x4000000, 0xd2334(%rip) # imm = 0x4000000
movq %r14, 0xd2335(%rip)     # 0x106ed0
movl %r14d, 0xd233e(%rip)    # 0x106ee0
xorl %edi, %edi
callq 0x26ce0
movq %rax, 0xd2358(%rip)     # 0x106f08
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xd2354(%rip)    # 0x106f10
movl %r14d, 0xd235d(%rip)    # 0x106f20
movq %r14, 0xd235e(%rip)     # 0x106f28
movq $-0x1, %r12
movq %r12, 0xd2320(%rip)     # 0x106ef8
movq %r14, 0xd2321(%rip)     # 0x106f00
movl $0x1, %r15d
movl %r15d, 0xd2344(%rip)    # 0x106f30
movl %r15d, 0xd2349(%rip)    # 0x106f3c
movq %r14, 0xd1cbe(%rip)     # 0x1068b8
leaq 0x8b45b(%rip), %rdi     # 0xc005c
callq 0x3b419
movq %rax, 0xd2383(%rip)     # 0x106f90
leaq 0x8b451(%rip), %rdi     # 0xc0065
callq 0x3b419
movq %rax, 0xd2298(%rip)     # 0x106eb8
movq %r14, 0xd1c89(%rip)     # 0x1068b0
movabsq $0x100000001, %r13      # imm = 0x100000001
movq %r13, 0xd2360(%rip)     # 0x106f98
movl %r15d, 0xd238d(%rip)    # 0x106fcc
movl %r15d, 0xd1c62(%rip)    # 0x1068a8
movl %r14d, 0xd2593(%rip)    # 0x1071e0
movl $0x2710, 0xd24f5(%rip)  # imm = 0x2710
movl %r14d, 0xd2502(%rip)    # 0x107160
movq %r14, 0xd24eb(%rip)     # 0x107150
movabsq $0x500000005, %rax      # imm = 0x500000005
movq %rax, 0xd24e2(%rip)     # 0x107158
movl $0x200, %eax            # imm = 0x200
movq %rax, 0xd2506(%rip)     # 0x107188
movl $0x40, %ecx
movq %rcx, 0xd2502(%rip)     # 0x107190
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movq %rdx, 0xd251e(%rip)     # 0x1071b8
movq %rax, 0xd24f7(%rip)     # 0x107198
movl $0x80, %eax
movq %rax, 0xd24f3(%rip)     # 0x1071a0
movq %rcx, 0xd24f4(%rip)     # 0x1071a8
movq $0xbb8, 0xd24f1(%rip) # imm = 0xBB8
movl %r14d, 0xd1bde(%rip)    # 0x1068a4
movl %ebp, 0xd2344(%rip)     # 0x107010
movl $0x3c, 0xd23a6(%rip)    # 0x10707c
movabsq $0xa00000000, %rax      # imm = 0xA00000000
movq %rax, 0xd2369(%rip)     # 0x107050
movl %r14d, 0xd24f6(%rip)    # 0x1071e4
movq $0x3a98, 0xd24ef(%rip) # imm = 0x3A98
movabsq $0xa00000001, %rax      # imm = 0xA00000001
movq %rax, 0xd24f6(%rip)     # 0x107200
movl %r15d, 0xd24f7(%rip)    # 0x107208
leaq 0x8b35c(%rip), %rdi     # 0xc0074
callq 0x3b419
movq %rax, 0xd24cc(%rip)     # 0x1071f0
leaq 0xd11c5(%rip), %rdi     # 0x105ef0
xorl %esi, %esi
callq 0x31774
movq %rax, 0xd1e27(%rip)     # 0x106b60
movq %rbx, 0xd1e28(%rip)     # 0x106b68
movq $0x200000, 0xd1e45(%rip) # imm = 0x200000
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x26310
imulq $0xf4240, (%rbx), %rax  # imm = 0xF4240
addq 0x8(%rbx), %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x12, %rdx
addl %eax, %edx
andl $0xffffff, %edx         # imm = 0xFFFFFF
movzbl 0xd1b17(%rip), %eax     # 0x1068a3
shll $0x18, %eax
orl %edx, %eax
movl %eax, 0xd1b09(%rip)     # 0x1068a0
callq 0x5a848
movl $0xe10, %edi            # imm = 0xE10
movl $0x1, %esi
callq 0x5a7f2
movl $0x12c, %edi            # imm = 0x12C
movl $0x64, %esi
callq 0x5a7f2
movl $0x3c, %edi
movl $0x2710, %esi           # imm = 0x2710
callq 0x5a7f2
pxor %xmm0, %xmm0
movdqu %xmm0, 0xd2293(%rip)    # 0x107068
movl $0x18eb, 0xd2299(%rip)  # imm = 0x18EB
movdqu %xmm0, 0xd2299(%rip)    # 0x107080
movq %r12, 0xd2332(%rip)     # 0x107120
movq $0x5, 0xd2297(%rip) # 0x107090
movq %r13, 0xd22c8(%rip)     # 0x1070c8
movq %r14, 0xd22c9(%rip)     # 0x1070d0
movl %r14d, 0xd22ca(%rip)    # 0x1070d8
movabsq $0x500000000, %rax      # imm = 0x500000000
movq %rax, 0xd223d(%rip)     # 0x10705c
movq $0x64, 0xd22b2(%rip) # 0x1070dc
movq %r14, 0xd22b7(%rip)     # 0x1070e8
movq %r14, 0xd21d0(%rip)     # 0x107008
movq %r14, 0xd21d9(%rip)     # 0x107018
movq $0x100000, 0xd21d6(%rip) # imm = 0x100000
movdqu %xmm0, 0xd21d6(%rip)    # 0x107028
movq %r14, 0xd21df(%rip)     # 0x107038
movq $0xe10, 0xd21dc(%rip) # imm = 0xE10
xorl %edi, %edi
callq 0x26ce0
movq %rax, 0xd21d6(%rip)     # 0x107048
leaq 0xd1fef(%rip), %rdi     # 0x106e68
leaq 0xd12d0(%rip), %rsi     # 0x106150
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq %r14, 0xe6051(%rip)     # 0x11aee0
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, 0xe6048(%rip)     # 0x11aee8
movabsq $-0x10000000000000, %rax # imm = 0xFFF0000000000000
movq %rax, 0xe603f(%rip)     # 0x11aef0
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0xe6036(%rip)     # 0x11aef8
leaq 0xd0f37(%rip), %rbx     # 0x105e00
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31774
movq %rax, 0xd19ae(%rip)     # 0x106888
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31774
movq %rax, 0xd19a5(%rip)     # 0x106890
callq 0x34fcc
leaq 0x8c5bf(%rip), %rdi     # 0xc14b6
callq 0x3513c
movq %rax, 0xd1c95(%rip)     # 0x106b98
leaq 0x8a8f1(%rip), %rdi     # 0xbf7fb
callq 0x3513c
movq %rax, 0xd1c8a(%rip)     # 0x106ba0
leaq 0x8a675(%rip), %rdi     # 0xbf592
callq 0x3513c
movq %rax, 0xd1c7f(%rip)     # 0x106ba8
leaq 0x8a66d(%rip), %rdi     # 0xbf59d
callq 0x3513c
movq %rax, 0xd1c74(%rip)     # 0x106bb0
leaq 0x8a642(%rip), %rdi     # 0xbf585
callq 0x3513c
movq %rax, 0xd1c69(%rip)     # 0x106bb8
leaq 0x8a674(%rip), %rdi     # 0xbf5ca
callq 0x3513c
movq %rax, 0xd1c5e(%rip)     # 0x106bc0
leaq 0x8a89b(%rip), %rdi     # 0xbf804
callq 0x3513c
movq %rax, 0xd1c53(%rip)     # 0x106bc8
movq $0x2710, 0xd1cd0(%rip) # imm = 0x2710
movl $0x80, %eax
movq %rax, 0xd1ccc(%rip)     # 0x106c58
movq %r14, 0xd22cd(%rip)     # 0x107260
leaq 0x8b0e5(%rip), %rax     # 0xc007f
movq %rax, 0xd22cf(%rip)     # 0x107270
leaq 0x8b0ed(%rip), %rax     # 0xc0095
movq %rax, 0xd22c9(%rip)     # 0x107278
movq %r14, 0xd22ca(%rip)     # 0x107280
movl %r14d, 0xd22cb(%rip)    # 0x107288
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq