LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: maximize_sndbuf
void maximize_sndbuf(int sfd) {
    socklen_t intsize = sizeof(int);
    int last_good = 0;
    int min, max, avg;
    int old_size;

    /* Start with the default size. */
    if (getsockopt(sfd, SOL_SOCKET, SO_SNDBUF, &old_size, &intsize)) {
        if (settings.verbose > 0)
            perror("getsockopt(SO_SNDBUF)");
        return;
    }

    /* Binary-search for the real maximum. */
    min = old_size;
    max = MAX_SENDBUF_SIZE;

    while (min <= max) {
        avg = ((unsigned int) min + max) / 2;
        if (setsockopt(sfd, SOL_SOCKET, SO_SNDBUF, &avg, intsize) == 0) {
            last_good = avg;
            min = avg + 1;
        } else {
            max = avg - 1;
        }
    }

    LOG_DEBUG_F3("<%d send buffer was %d, now %d\n", sfd, old_size, last_good);
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movl $0x4, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x24(%rsp), %edi
movl $0x1, %esi
movl $0x7, %edx
leaq 0xc(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x2230
cmpl $0x0, %eax
je 0x9db8
leaq 0x74f7(%rip), %rax      # 0x11298
cmpl $0x0, 0x18(%rax)
jle 0x9db3
leaq 0x2c0d(%rip), %rdi      # 0xc9bb
callq 0x23d0
jmp 0x9e5a
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
movl $0x10000000, 0x14(%rsp) # imm = 0x10000000
movl 0x18(%rsp), %eax
cmpl 0x14(%rsp), %eax
jg 0x9e24
movl 0x18(%rsp), %eax
addl 0x14(%rsp), %eax
shrl %eax
movl %eax, 0x10(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %r8d
movl $0x1, %esi
movl $0x7, %edx
leaq 0x10(%rsp), %rcx
callq 0x20c0
cmpl $0x0, %eax
jne 0x9e17
movl 0x10(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x9e22
movl 0x10(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x9dc8
jmp 0x9e26
leaq 0x746b(%rip), %rax      # 0x11298
cmpl $0x1, 0x18(%rax)
jle 0x9e58
movq 0x71be(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movl 0x24(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x1c(%rsp), %r8d
leaq 0x2b80(%rip), %rsi      # 0xc9d1
movb $0x0, %al
callq 0x2280
jmp 0x9e5a
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: server_socket
int server_socket(int port, int is_udp) {
    int sfd;
    struct linger ling = {0, 0};
    struct sockaddr_in addr;
    int flags =1;

    if ((sfd = new_socket(is_udp)) == -1) {
        return -1;
    }

    setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
    if (is_udp) {
        maximize_sndbuf(sfd);
    } else {
        setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags));
        setsockopt(sfd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
        setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
    }

    /*
     * the memset call clears nonstandard fields in some impementations
     * that otherwise mess things up.
     */
    memset(&addr, 0, sizeof(addr));

    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr = settings.interface;
    if (bind(sfd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
        perror("bind()");
        close(sfd);
        return -1;
    }
    if (! is_udp && listen(sfd, 1024) == -1) {
        perror("listen()");
        close(sfd);
        return -1;
    }
    return sfd;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x21b0
movl $0x1, 0xc(%rsp)
movl 0x2c(%rsp), %edi
callq 0x9ca0
movl %eax, 0x28(%rsp)
cmpl $-0x1, %eax
jne 0x9ea4
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x9fdd
movl 0x28(%rsp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq 0xc(%rsp), %rcx
movl $0x4, %r8d
callq 0x20c0
cmpl $0x0, 0x2c(%rsp)
je 0x9ed4
movl 0x28(%rsp), %edi
callq 0x9d60
jmp 0x9f2e
movl 0x28(%rsp), %edi
movl $0x1, %esi
movl $0x9, %edx
leaq 0xc(%rsp), %rcx
movl $0x4, %r8d
callq 0x20c0
movl 0x28(%rsp), %edi
movl $0x1, %esi
movl $0xd, %edx
leaq 0x20(%rsp), %rcx
movl $0x8, %r8d
callq 0x20c0
movl 0x28(%rsp), %edi
movl $0x6, %esi
movl $0x1, %edx
leaq 0xc(%rsp), %rcx
movl $0x4, %r8d
callq 0x20c0
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21b0
movw $0x2, 0x10(%rsp)
movl 0x30(%rsp), %eax
movzwl %ax, %edi
callq 0x2150
movw %ax, 0x12(%rsp)
leaq 0x733a(%rip), %rax      # 0x11298
movl 0x14(%rax), %eax
movl %eax, 0x14(%rsp)
movl 0x28(%rsp), %edi
leaq 0x10(%rsp), %rsi
movl $0x10, %edx
callq 0x2370
cmpl $-0x1, %eax
jne 0x9f9c
leaq 0x2a6d(%rip), %rdi      # 0xc9f1
callq 0x23d0
movl 0x28(%rsp), %edi
callq 0x21d0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x9fdd
cmpl $0x0, 0x2c(%rsp)
jne 0x9fd5
movl 0x28(%rsp), %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2300
cmpl $-0x1, %eax
jne 0x9fd5
leaq 0x2a3b(%rip), %rdi      # 0xc9f8
callq 0x23d0
movl 0x28(%rsp), %edi
callq 0x21d0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x9fdd
movl 0x28(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: new_socket_unix
int new_socket_unix(void) {
    int sfd;
    int flags;

    if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
        perror("socket()");
        return -1;
    }

    if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 ||
        fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) {
        perror("setting O_NONBLOCK");
        close(sfd);
        return -1;
    }
    return sfd;
}

// Assembly:
subq $0x18, %rsp
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x2470
movl %eax, 0x10(%rsp)
cmpl $-0x1, %eax
jne 0xa021
leaq 0x29a0(%rip), %rdi      # 0xc9b2
callq 0x23d0
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0xa082
movl 0x10(%rsp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x20e0
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jl 0xa05b
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x20e0
cmpl $0x0, %eax
jge 0xa07a
leaq 0x2897(%rip), %rdi      # 0xc8f9
callq 0x23d0
movl 0x10(%rsp), %edi
callq 0x21d0
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0xa082
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: server_socket_unix
int server_socket_unix(char *path) {
    int sfd;
    struct linger ling = {0, 0};
    struct sockaddr_un addr;
    struct stat tstat;
    int flags =1;

    if (!path) {
        return -1;
    }

    if ((sfd = new_socket_unix()) == -1) {
        return -1;
    }

    /*
     * Clean up a previous socket file if we left it around
     */
    if (!lstat(path, &tstat)) {
        if (S_ISSOCK(tstat.st_mode))
            unlink(path);
    }

    setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
    setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags));
    setsockopt(sfd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));

    /*
     * the memset call clears nonstandard fields in some impementations
     * that otherwise mess things up.
     */
    memset(&addr, 0, sizeof(addr));

    addr.sun_family = AF_UNIX;
    strcpy(addr.sun_path, path);
    if (bind(sfd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
        perror("bind()");
        close(sfd);
        return -1;
    }
    if (listen(sfd, 1024) == -1) {
        perror("listen()");
        close(sfd);
        return -1;
    }
    return sfd;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x118(%rsp)
leaq 0x10c(%rsp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x21b0
movl $0x1, 0x4(%rsp)
cmpq $0x0, 0x118(%rsp)
jne 0xa0d6
movl $0xffffffff, 0x124(%rsp) # imm = 0xFFFFFFFF
jmp 0xa256
callq 0x9ff0
movl %eax, 0x114(%rsp)
cmpl $-0x1, %eax
jne 0xa0f7
movl $0xffffffff, 0x124(%rsp) # imm = 0xFFFFFFFF
jmp 0xa256
movq 0x118(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2220
cmpl $0x0, %eax
jne 0xa12d
movl 0x20(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xc000, %eax           # imm = 0xC000
jne 0xa12b
movq 0x118(%rsp), %rdi
callq 0x2050
jmp 0xa12d
movl 0x114(%rsp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq 0x4(%rsp), %rcx
movl $0x4, %r8d
callq 0x20c0
movl 0x114(%rsp), %edi
movl $0x1, %esi
movl $0x9, %edx
leaq 0x4(%rsp), %rcx
movl $0x4, %r8d
callq 0x20c0
movl 0x114(%rsp), %edi
movl $0x1, %esi
movl $0xd, %edx
leaq 0x10c(%rsp), %rcx
movl $0x8, %r8d
callq 0x20c0
leaq 0x9e(%rsp), %rdi
xorl %esi, %esi
movl $0x6e, %edx
callq 0x21b0
movw $0x1, 0x9e(%rsp)
leaq 0x9e(%rsp), %rdi
addq $0x2, %rdi
movq 0x118(%rsp), %rsi
callq 0x2090
movl 0x114(%rsp), %edi
leaq 0x9e(%rsp), %rsi
movl $0x6e, %edx
callq 0x2370
cmpl $-0x1, %eax
jne 0xa20d
leaq 0x2802(%rip), %rdi      # 0xc9f1
callq 0x23d0
movl 0x114(%rsp), %edi
callq 0x21d0
movl $0xffffffff, 0x124(%rsp) # imm = 0xFFFFFFFF
jmp 0xa256
movl 0x114(%rsp), %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2300
cmpl $-0x1, %eax
jne 0xa248
leaq 0x27ce(%rip), %rdi      # 0xc9f8
callq 0x23d0
movl 0x114(%rsp), %edi
callq 0x21d0
movl $0xffffffff, 0x124(%rsp) # imm = 0xFFFFFFFF
jmp 0xa256
movl 0x114(%rsp), %eax
movl %eax, 0x124(%rsp)
movl 0x124(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: pre_gdb
void pre_gdb () {
    int i = 0;
    if(l_socket) close(l_socket);
    if(u_socket > -1) close(u_socket);
    for (i=3; i<=500; i++) close(i); /* so lame */
    kill(getpid(), SIGABRT);
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
leaq 0x7000(%rip), %rax      # 0x11280
cmpl $0x0, (%rax)
je 0xa293
leaq 0x6ff4(%rip), %rax      # 0x11280
movl (%rax), %edi
callq 0x21d0
leaq 0x6fb6(%rip), %rax      # 0x11250
cmpl $-0x1, (%rax)
jle 0xa2ad
leaq 0x6faa(%rip), %rax      # 0x11250
movl (%rax), %edi
callq 0x21d0
movl $0x3, 0x4(%rsp)
cmpl $0x1f4, 0x4(%rsp)       # imm = 0x1F4
jg 0xa2d5
movl 0x4(%rsp), %edi
callq 0x21d0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xa2b5
callq 0x20f0
movl %eax, %edi
movl $0x6, %esi
callq 0x22c0
popq %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: timer_delete_handler
int timer_delete_handler(struct aeEventLoop *eventLoop, long long id, void *clientData) {
    AE_NOTUSED(eventLoop);
    AE_NOTUSED(id);
    AE_NOTUSED(clientData);
    
    int i, j=0;
    for (i=0; i<delcurr; i++) {
        item *it = todelete[i];
        if (item_delete_lock_over(it)) {
            assert(it->refcount > 0);
            it->it_flags &= ~ITEM_DELETED;
            item_unlink(it);
            item_remove(it);
        } else {
            todelete[j++] = it;
        }
    }
    delcurr = j;
    return 1000;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x841b(%rip), %eax      # 0x12768
jge 0xa3c1
movq 0x841a(%rip), %rax      # 0x12770
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
callq 0x66c0
cmpl $0x0, %eax
je 0xa393
movq (%rsp), %rax
movzbl 0x27(%rax), %ecx
andl $-0x3, %ecx
movb %cl, 0x27(%rax)
movq (%rsp), %rdi
callq 0x58a0
movq (%rsp), %rdi
callq 0x5c80
jmp 0xa3b2
movq (%rsp), %rdx
movq 0x83d2(%rip), %rax      # 0x12770
movl 0x8(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x8(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xa3b4
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xa343
movl 0x8(%rsp), %eax
movl %eax, 0x839d(%rip)      # 0x12768
movl $0x3e8, %eax            # imm = 0x3E8
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached_time.c
// Function: realtime
rel_time_t realtime(time_t exptime, struct stats *stats) {
    /* no. of seconds in 30 days - largest possible delta exptime */
    if (exptime == 0) return 0; /* 0 means never expire */

    if (exptime > REALTIME_MAXDELTA)
        return (rel_time_t) (exptime - stats->started);
    else {
        return (rel_time_t) (exptime + current_time);
    }
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
cmpq $0x0, -0x10(%rsp)
jne 0xaf8c
movl $0x0, -0x4(%rsp)
jmp 0xafc2
cmpq $0x278d00, -0x10(%rsp)  # imm = 0x278D00
jle 0xafab
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
subq 0x40(%rcx), %rax
movl %eax, -0x4(%rsp)
jmp 0xafc2
movq -0x10(%rsp), %rax
leaq 0x6399(%rip), %rcx      # 0x11350
movl (%rcx), %ecx
movl %ecx, %ecx
addq %rcx, %rax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/settings.c
// Function: settings_init
void settings_init(struct settings *settings) {
    settings->port = 11211;
    settings->udpport = 0;
    settings->interface.s_addr = htonl(INADDR_ANY);
    settings->maxbytes = 64*1024*1024; /* default is 64MB */
    settings->maxconns = 1024;         /* to limit connections-related memory to about 5MB */
    settings->verbose = 0;
    settings->oldest_live = 0;
    settings->evict_to_free = 1;       /* push old items out of cache when memory runs out */
    settings->socketpath = NULL;       /* by default, not using a unix socket */
    settings->managed = 0;
    settings->factor = 1.25;
    settings->chunk_size = 48;         /* space for a modest key and value */
    settings->lock_memory = 0;
    settings->daemonize = 0;
    settings->maxcore = 0;
    settings->username = NULL;
    settings->pid_file = NULL;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movl $0x2bcb, 0xc(%rax)      # imm = 0x2BCB
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
xorl %edi, %edi
callq 0x21a0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x14(%rax)
movq (%rsp), %rax
movq $0x4000000, (%rax)      # imm = 0x4000000
movq (%rsp), %rax
movl $0x400, 0x8(%rax)       # imm = 0x400
movq (%rsp), %rax
movl $0x0, 0x18(%rax)
movq (%rsp), %rax
movl $0x0, 0x1c(%rax)
movq (%rsp), %rax
movl $0x1, 0x24(%rax)
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
movq (%rsp), %rax
movl $0x0, 0x20(%rax)
movq (%rsp), %rax
movsd 0x12e3(%rip), %xmm0     # 0xc338
movsd %xmm0, 0x30(%rax)
movq (%rsp), %rax
movl $0x30, 0x38(%rax)
movq (%rsp), %rax
movl $0x0, 0x3c(%rax)
movq (%rsp), %rax
movl $0x0, 0x40(%rax)
movq (%rsp), %rax
movl $0x0, 0x44(%rax)
movq (%rsp), %rax
movq $0x0, 0x48(%rax)
movq (%rsp), %rax
movq $0x0, 0x50(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/settings.c
// Function: usage
void usage(void) {
    printf(PACKAGE " " VERSION "\n");
    printf("-p <num>      port number to listen on\n");
    printf("-s <file>     unix socket path to listen on (disables network support)\n");
    printf("-l <ip_addr>  interface to listen on, default is INDRR_ANY\n");
    printf("-d            run as a daemon\n");
    printf("-r            maximize core file limit\n");
    printf("-u <username> assume identity of <username> (only when run as root)\n");
    printf("-m <num>      max memory to use for items in megabytes, default is 64 MB\n");
    printf("-M            return error on memory exhausted (rather than removing items)\n");
    printf("-c <num>      max simultaneous connections, default is 1024\n");
    printf("-k            lock down all paged memory\n");
    printf("-v            verbose (print errors/warnings while in event loop)\n");
    printf("-vv           very verbose (also print client commands/reponses)\n");
    printf("-h            print this help and exit\n");
    printf("-i            print memcached and libevent license\n");
    printf("-b            run a managed instanced (mnemonic: buckets)\n");
    printf("-P <file>     save PID in <file>, only used with -d option\n");
    printf("-f <factor>   chunk size growth factor, default 1.25\n");
    printf("-n <bytes>    minimum space allocated for key+value+flags, default 48\n");
    return;
}

// Assembly:
pushq %rax
leaq 0x1b23(%rip), %rdi      # 0xceab
movb $0x0, %al
callq 0x2170
leaq 0x1b28(%rip), %rdi      # 0xcebe
movb $0x0, %al
callq 0x2170
leaq 0x1b42(%rip), %rdi      # 0xcee6
movb $0x0, %al
callq 0x2170
leaq 0x1b7c(%rip), %rdi      # 0xcf2e
movb $0x0, %al
callq 0x2170
leaq 0x1baa(%rip), %rdi      # 0xcf6a
movb $0x0, %al
callq 0x2170
leaq 0x1bbb(%rip), %rdi      # 0xcf89
movb $0x0, %al
callq 0x2170
leaq 0x1bd5(%rip), %rdi      # 0xcfb1
movb $0x0, %al
callq 0x2170
leaq 0x1c0c(%rip), %rdi      # 0xcff6
movb $0x0, %al
callq 0x2170
leaq 0x1c48(%rip), %rdi      # 0xd040
movb $0x0, %al
callq 0x2170
leaq 0x1c87(%rip), %rdi      # 0xd08d
movb $0x0, %al
callq 0x2170
leaq 0x1cb6(%rip), %rdi      # 0xd0ca
movb $0x0, %al
callq 0x2170
leaq 0x1cd2(%rip), %rdi      # 0xd0f4
movb $0x0, %al
callq 0x2170
leaq 0x1d07(%rip), %rdi      # 0xd137
movb $0x0, %al
callq 0x2170
leaq 0x1d3b(%rip), %rdi      # 0xd179
movb $0x0, %al
callq 0x2170
leaq 0x1d55(%rip), %rdi      # 0xd1a1
movb $0x0, %al
callq 0x2170
leaq 0x1d7b(%rip), %rdi      # 0xd1d5
movb $0x0, %al
callq 0x2170
leaq 0x1da8(%rip), %rdi      # 0xd210
movb $0x0, %al
callq 0x2170
leaq 0x1dd6(%rip), %rdi      # 0xd24c
movb $0x0, %al
callq 0x2170
leaq 0x1dfe(%rip), %rdi      # 0xd282
movb $0x0, %al
callq 0x2170
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/slab.c
// Function: slab_create
slab_ptr slab_create(size_t chunk_size, size_t page_size, int pre_alloc) {
    slab_ptr slab;
    slab = (slab_ptr)calloc(1, sizeof(*slab));
    if (NULL == slab) {
        return NULL;
    }

    /* Make sure chunk are always n-byte aligned */
    if (chunk_size % CHUNK_ALIGN_BYTES) {
        chunk_size += CHUNK_ALIGN_BYTES - (chunk_size % CHUNK_ALIGN_BYTES);
    }
    
    /* Make sure page are always n-byte aligned */
    if (page_size % PAGE_ALIGN_BYTES) {
        page_size += PAGE_ALIGN_BYTES - (page_size % PAGE_ALIGN_BYTES);
    }

    slab->chunk_size = chunk_size;
    slab->page_size = page_size;
    slab->chunk_number_per_page = page_size / chunk_size;
    slab->page_total = 0;
    slab->magic_number = SLAB_MAGIC_NUMBER;
    /* Preallocate as many slab pages as possible (called from mem_cache_init)
       on start-up, so users don't get confused out-of-memory errors when
       they do have free (in-slab) space, but no space to make new mem_cache.
       if maxmem_cache is 18 (POWER_LARGEST - POWER_SMALLEST + 1), then all
       slab types can be made.  if max memory is less than 18 MB, only the
       smaller ones will be made.  */
    if (pre_alloc) {
        /* pre-allocate a 1MB slab in every size class so people don't get
           confused by non-intuitive "SERVER_ERROR out of memory"
           messages.  this is the most common question on the mailing
           list.  if you really don't want this, you can rebuild without
           these three lines.  */
       slab_new_page(slab);

    }
    return slab;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl $0x1, %edi
movl $0x50, %esi
callq 0x2240
movq %rax, (%rsp)
xorl %eax, %eax
cmpq (%rsp), %rax
jne 0xb4eb
movq $0x0, 0x20(%rsp)
jmp 0xb5a4
movq 0x18(%rsp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0xb515
movq 0x18(%rsp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
andq $0xfffff, %rax          # imm = 0xFFFFF
cmpq $0x0, %rax
je 0xb544
movq 0x10(%rsp), %rcx
andq $0xfffff, %rcx          # imm = 0xFFFFF
movl $0x100000, %eax         # imm = 0x100000
subq %rcx, %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x18(%rsp)
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x10(%rax)
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
movq (%rsp), %rax
movl $0xabcdefaa, 0x48(%rax) # imm = 0xABCDEFAA
cmpl $0x0, 0xc(%rsp)
je 0xb59b
movq (%rsp), %rdi
callq 0xb5b0
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/slab.c
// Function: slab_new_page
int slab_new_page(slab_ptr slab) {
    char *ptr;
    if (NULL == slab) {
        return 0;
    }

    if (slab->end_page_ptr != NULL || slab->end_page_free > 0) {
        return 0;
    }

    ptr = calloc(1, slab->page_size);
    if (NULL == ptr) {
        return 0;
    }
    slab->end_page_ptr = ptr;
    slab->end_page_free = slab->chunk_number_per_page;

    ++ slab->page_total;
    return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
jne 0xb5cf
movl $0x0, 0x14(%rsp)
jmp 0xb653
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0xb5e7
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jbe 0xb5f1
movl $0x0, 0x14(%rsp)
jmp 0xb653
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edi
callq 0x2240
movq %rax, (%rsp)
xorl %eax, %eax
cmpq (%rsp), %rax
jne 0xb61a
movl $0x0, 0x14(%rsp)
jmp 0xb653
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/slab.c
// Function: slab_alloc_chunk
void *slab_alloc_chunk(slab_ptr slab) {
    if (NULL == slab) {
        return NULL;
    }

    /* fail unless we have space at the end of a recently allocated page,
       we have something on our freelist, or we could allocate a new page */
    if (! (slab->end_page_ptr || slab->free_chunk_end || slab_new_page(slab))) {
        return 0;
    }

    /* return off our freelist, if we have one */
    if (0 != slab->free_chunk_end) {
        return slab->free_chunk_list[ -- slab->free_chunk_end];
    }
    /* if we recently allocated a whole page, return from that */
    if (slab->end_page_ptr) {
        void *ptr = slab->end_page_ptr;
        if (-- slab->end_page_free) {
            slab->end_page_ptr += slab->chunk_size;
        } else {
            slab->end_page_ptr = 0;
        }
        return ptr;
    }
    
    return 0;  /* shouldn't ever get here */
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
jne 0xb680
movq $0x0, 0x10(%rsp)
jmp 0xb753
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0xb6b5
movq 0x8(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0xb6b5
movq 0x8(%rsp), %rdi
callq 0xb5b0
cmpl $0x0, %eax
jne 0xb6b5
movq $0x0, 0x10(%rsp)
jmp 0xb753
movq 0x8(%rsp), %rcx
xorl %eax, %eax
cmpq 0x40(%rcx), %rax
je 0xb6eb
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rdx
movq 0x40(%rdx), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, 0x40(%rdx)
movq -0x8(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0xb753
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb74a
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rcx)
cmpq $0x0, %rax
je 0xb732
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
jmp 0xb73f
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0xb753
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/slab.c
// Function: slab_free_chunk
void slab_free_chunk(slab_ptr slab, void *ptr) {
    if (NULL == slab || NULL == ptr) {
        return ;
    }
    if (slab->free_chunk_end == slab->free_chunk_list_length) { /* need more space on the free list */
        size_t new_size = slab->free_chunk_list_length ? slab->free_chunk_list_length*2 : 16;  /* 16 is arbitrary */
        void **new_list = realloc(slab->free_chunk_list, new_size * sizeof(void *));
        if (NULL == new_list) {
            return;
        }
        slab->free_chunk_list = new_list;
        slab->free_chunk_list_length = new_size;
    }
    slab->free_chunk_list[slab->free_chunk_end ++] = ptr;
    return;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
xorl %eax, %eax
cmpq 0x20(%rsp), %rax
je 0xb780
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
jne 0xb785
jmp 0xb834
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x20(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jne 0xb80e
movq 0x20(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0xb7b7
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
shlq %rax
movq %rax, (%rsp)
jmp 0xb7c2
movl $0x10, %eax
movq %rax, (%rsp)
jmp 0xb7c2
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x10(%rsp), %rsi
shlq $0x3, %rsi
callq 0x2330
movq %rax, 0x8(%rsp)
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
jne 0xb7f2
jmp 0xb834
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rsp), %rsi
movq 0x40(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x40(%rsi)
movq %rdx, (%rax,%rcx,8)
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/stats.c
// Function: stats_init
void stats_init(struct stats *stats) {
    stats->curr_items = 0;
    stats->total_items = 0;
    stats->curr_conns = 0;
    stats->total_conns = 0;
    stats->conn_structs = 0;
    stats->get_cmds = 0;
    stats->set_cmds = 0;
    stats->get_hits = 0;
    stats->get_misses = 0;
    stats->curr_bytes = 0;
    stats->bytes_read = 0;
    stats->bytes_written = 0;

    /* make the time we started always be 1 second before we really
       did, so time(0) - time.started is never zero.  if so, things
       like 'settings.oldest_live' which act as booleans as well as
       values are now false in boolean context... */
    stats->started = time(0) - 1;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movl $0x0, (%rax)
movq (%rsp), %rax
movl $0x0, 0x4(%rax)
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
movq (%rsp), %rax
movl $0x0, 0x14(%rax)
movq (%rsp), %rax
movl $0x0, 0x18(%rax)
movq (%rsp), %rax
movq $0x0, 0x20(%rax)
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
movq (%rsp), %rax
movq $0x0, 0x30(%rax)
movq (%rsp), %rax
movq $0x0, 0x38(%rax)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movq $0x0, 0x48(%rax)
movq (%rsp), %rax
movq $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x22d0
movq %rax, %rcx
subq $0x1, %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/stats.c
// Function: stats_reset
void stats_reset(struct stats *stats) {
    stats->total_items = 0;
    stats->total_conns = 0;
    stats->get_cmds = 0;
    stats->set_cmds = 0;
    stats->get_hits = 0;
    stats->get_misses = 0;
    stats->bytes_read = 0;
    stats->bytes_written = 0;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0x14(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x50(%rax)
retq
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgprimsize
int cgprimsize(int type) {
  if (ptrtype(type))
    return (8);
  switch (type) {
  case P_CHAR:
    return (1);
  case P_INT:
    return (4);
  case P_LONG:
    return (8);
  default:
    fatald("Bad type in cgprimsize:", type);
  }
  return (0);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0xb720
cmpl $0x0, %eax
je 0x2301
movl $0x8, -0x4(%rbp)
jmp 0x2353
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
subl $0x20, %eax
je 0x2322
jmp 0x230e
movl -0xc(%rbp), %eax
subl $0x30, %eax
je 0x232b
jmp 0x2318
movl -0xc(%rbp), %eax
subl $0x40, %eax
je 0x2334
jmp 0x233d
movl $0x1, -0x4(%rbp)
jmp 0x2353
movl $0x4, -0x4(%rbp)
jmp 0x2353
movl $0x8, -0x4(%rbp)
jmp 0x2353
movl -0x8(%rbp), %esi
leaq 0x9ccd(%rip), %rdi      # 0xc014
callq 0x8180
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgalign
int cgalign(int type, int offset, int direction) {
  int alignment;

  // 虽然x86-64不要求对齐，但是也尝试下把
  // 字符的不用对情，其他类型就按四字节对齐
  switch (type) {
  case P_CHAR:
    break;
  default:
    // 四字节对齐
    alignment = 4;
    offset = (offset + direction * (alignment - 1)) & ~(alignment - 1);
  }
  return (offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x4(%rbp), %eax
subl $0x20, %eax
jne 0x2379
jmp 0x2377
jmp 0x239f
movl $0x4, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
addl %ecx, %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgfreeallregs
void cgfreeallregs(int keepreg) {
  int i;
  // fprintf(Outfile, "# freeing all registers\n");
  for (i = 0; i < NUMFREEREGS; i++)
    if (i != keepreg)
      freereg[i] = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x4, -0x8(%rbp)
jge 0x23eb
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x23de
movslq -0x8(%rbp), %rcx
leaq 0x100e9(%rip), %rax     # 0x124c0
movl $0x1, (%rax,%rcx,4)
jmp 0x23e0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x23be
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgallocreg
int cgallocreg(void) {
  int reg;

  for (reg = 0; reg < NUMFREEREGS; reg++) {
    if (freereg[reg]) {
      freereg[reg] = 0;
      // fprintf(Outfile, "# allocated register %s\n", reglist[reg]);
      return (reg);
    }
  }

  // 没有可用寄存器,溢出一个
  reg = (spillreg % NUMFREEREGS);
  spillreg++;
  // fprintf(Outfile, "# spilling reg %s\n", reglist[reg]);
  pushreg(reg);
  return (reg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x8(%rbp)
cmpl $0x4, -0x8(%rbp)
jge 0x243d
movslq -0x8(%rbp), %rcx
leaq 0x100b0(%rip), %rax     # 0x124c0
cmpl $0x0, (%rax,%rcx,4)
je 0x2430
movslq -0x8(%rbp), %rcx
leaq 0x1009f(%rip), %rax     # 0x124c0
movl $0x0, (%rax,%rcx,4)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x246b
jmp 0x2432
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x23ff
movl 0x1008d(%rip), %eax     # 0x124d0
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x8(%rbp)
movl 0x1007c(%rip), %eax     # 0x124d0
addl $0x1, %eax
movl %eax, 0x10073(%rip)     # 0x124d0
movl -0x8(%rbp), %edi
callq 0x2480
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgfreereg
void cgfreereg(int reg) {
  if (freereg[reg] != 0) {
    // fprintf(Outfile, "# error trying to free register %s\n", reglist[reg]);
    fatald("Error trying to free register", reg);
  }
  // 如果这个是溢出来的, 从栈中恢复
  if (spillreg > 0) {
    spillreg--;
    reg = (spillreg % NUMFREEREGS);
    // fprintf(Outfile, "# unspilling reg %s\n", reglist[reg]);
    popreg(reg);
  } else {
    // fprintf(Outfile, "# freeing reg %s\n", reglist[reg]);
    freereg[reg] = 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xffea(%rip), %rax      # 0x124c0
cmpl $0x0, (%rax,%rcx,4)
je 0x24eb
movl -0x4(%rbp), %esi
leaq 0x9b46(%rip), %rdi      # 0xc02c
callq 0x8180
cmpl $0x0, 0xffde(%rip)      # 0x124d0
jle 0x251e
movl 0xffd6(%rip), %eax      # 0x124d0
addl $-0x1, %eax
movl %eax, 0xffcd(%rip)      # 0x124d0
movl 0xffc7(%rip), %eax      # 0x124d0
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x2540
jmp 0x2530
movslq -0x4(%rbp), %rcx
leaq 0xff97(%rip), %rax      # 0x124c0
movl $0x1, (%rax,%rcx,4)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgpreamble
void cgpreamble(char *filename) {
  cgfreeallregs(NOREG);
  cgtextseg();
  fprintf(Outfile, "\t.file 1 ");
  fputc('"', Outfile);
  fprintf(Outfile, "%s", filename);
  fputc('"', Outfile);
  fputc('\n', Outfile);
  fprintf(Outfile,
	  "# internal switch(expr) routine\n"
	  "# %%rsi = switch table, %%rax = expr\n"
	  "# from SubC: http://www.t3x.org/subc/\n"
	  "\n"
	  "__switch:\n"
	  "        pushq   %%rsi\n"
	  "        movq    %%rdx, %%rsi\n"
	  "        movq    %%rax, %%rbx\n"
	  "        cld\n"
	  "        lodsq\n"
	  "        movq    %%rax, %%rcx\n"
	  "__next:\n"
	  "        lodsq\n"
	  "        movq    %%rax, %%rdx\n"
	  "        lodsq\n"
	  "        cmpq    %%rdx, %%rbx\n"
	  "        jnz     __no\n"
	  "        popq    %%rsi\n"
	  "        jmp     *%%rax\n"
	  "__no:\n"
	  "        loop    __next\n"
	  "        lodsq\n"
	  "        popq    %%rsi\n" "        jmp     *%%rax\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x23b0
callq 0x2280
leaq 0xff46(%rip), %rax      # 0x12518
movq (%rax), %rdi
leaq 0x9a6e(%rip), %rsi      # 0xc04a
movb $0x0, %al
callq 0x20e0
leaq 0xff2e(%rip), %rax      # 0x12518
movq (%rax), %rsi
movl $0x22, %edi
callq 0x20c0
leaq 0xff1a(%rip), %rax      # 0x12518
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0xaea2(%rip), %rsi      # 0xd4ae
movb $0x0, %al
callq 0x20e0
leaq 0xfefe(%rip), %rax      # 0x12518
movq (%rax), %rsi
movl $0x22, %edi
callq 0x20c0
leaq 0xfeea(%rip), %rax      # 0x12518
movq (%rax), %rsi
movl $0xa, %edi
callq 0x20c0
leaq 0xfed6(%rip), %rax      # 0x12518
movq (%rax), %rdi
leaq 0x9a08(%rip), %rsi      # 0xc054
movb $0x0, %al
callq 0x20e0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgfuncpreamble
void cgfuncpreamble(struct symtable *sym) {
  char *name = sym->name;
  struct symtable *parm, *locvar;
  int cnt;
  int paramOffset = 16;		// 超过6个的那部分参数所在栈的开始位置
  int paramReg = FIRSTPARAMREG;	// 上面参数寄存器列表的索引

  // 输出text段，重设本地变量位移
  cgtextseg();
  localOffset = 0;

  // 输出函数开始标签，保存%rbp 和 %rsp
  if (sym->class == C_GLOBAL)
    fprintf(Outfile, "\t.globl\t%s\n" "\t.type\t%s, @function\n", name, name);
  fprintf(Outfile, "%s:\n" "\tpushq\t%%rbp\n" "\tmovq\t%%rsp, %%rbp\n", name);

  // 拷贝在寄存器里面的参数到栈
  // 如果大于6个参数都已经在栈了
  for (parm = sym->member, cnt = 1; parm != NULL; parm = parm->next, cnt++) {
    if (cnt > 6) {
      parm->stu.st_posn = paramOffset;
      paramOffset += 8;
    } else {
      parm->stu.st_posn = newlocaloffset(parm->size);
      cgstorlocal(paramReg--, parm);
    }
  }

  // 计算本地变量的栈位置
  for (locvar = Loclhead; locvar != NULL; locvar = locvar->next) {
    locvar->stu.st_posn = newlocaloffset(locvar->size);
  }

  // 对齐栈指针到16的倍数
  stackOffset = (localOffset + 15) & ~15;
  fprintf(Outfile, "\taddq\t$%d,%%rsp\n", -stackOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x10, -0x28(%rbp)
movl $0x9, -0x2c(%rbp)
callq 0x2280
movl $0x0, 0xfe2f(%rip)      # 0x124d4
movq -0x8(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0x26cf
leaq 0xfe62(%rip), %rax      # 0x12518
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0x9b83(%rip), %rsi      # 0xc24b
movb $0x0, %al
callq 0x20e0
leaq 0xfe42(%rip), %rax      # 0x12518
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x9b88(%rip), %rsi      # 0xc26c
movb $0x0, %al
callq 0x20e0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x1, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2760
cmpl $0x6, -0x24(%rbp)
jle 0x271f
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x28(%rbp)
jmp 0x2747
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x27d0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x2c(%rbp), %edi
movl %edi, %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rsi
callq 0x2810
jmp 0x2749
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x26fe
leaq 0x10019(%rip), %rax     # 0x12780
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2797
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x27d0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x276e
movl 0xfd37(%rip), %eax      # 0x124d4
addl $0xf, %eax
andl $-0x10, %eax
movl %eax, 0xfd2f(%rip)      # 0x124d8
leaq 0xfd68(%rip), %rax      # 0x12518
movq (%rax), %rdi
xorl %edx, %edx
subl 0xfd1d(%rip), %edx      # 0x124d8
leaq 0x9acf(%rip), %rsi      # 0xc291
movb $0x0, %al
callq 0x20e0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgstorlocal
int cgstorlocal(int r, struct symtable *sym) {

  if (cgprimsize(sym->type) == 8) {
    fprintf(Outfile, "\tmovq\t%s, %d(%%rbp)\n", reglist[r], sym->stu.st_posn);
  } else
    switch (sym->type) {
    case P_CHAR:
      fprintf(Outfile, "\tmovb\t%s, %d(%%rbp)\n", breglist[r], sym->stu.st_posn);
      break;
    case P_INT:
      fprintf(Outfile, "\tmovl\t%s, %d(%%rbp)\n", dreglist[r], sym->stu.st_posn);
      break;
    default:
      fatald("Bad type in cgstorlocal:", sym->type);
    }
  return (r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x22e0
cmpl $0x8, %eax
jne 0x2862
leaq 0xfce1(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf88b(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
leaq 0x9d31(%rip), %rsi      # 0xc587
movb $0x0, %al
callq 0x20e0
jmp 0x28f0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x20, %eax
je 0x287d
jmp 0x2873
movl -0x14(%rbp), %eax
subl $0x30, %eax
je 0x28ac
jmp 0x28db
leaq 0xfc94(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf88e(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
leaq 0x9cf9(%rip), %rsi      # 0xc59c
movb $0x0, %al
callq 0x20e0
jmp 0x28ee
leaq 0xfc65(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf8af(%rip), %rax      # 0x12170
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
leaq 0x9cdf(%rip), %rsi      # 0xc5b1
movb $0x0, %al
callq 0x20e0
jmp 0x28ee
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x9cdd(%rip), %rdi      # 0xc5c6
callq 0x8180
jmp 0x28f0
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgfuncpostamble
void cgfuncpostamble(struct symtable *sym) {
  cglabel(sym->stu.st_endlabel);
  fprintf(Outfile, "\taddq\t$%d,%%rsp\n", stackOffset);
  fputs("\tpopq	%rbp\n" "\tret\n", Outfile);
  cgfreeallregs(NOREG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x2960
leaq 0xfbfa(%rip), %rax      # 0x12518
movq (%rax), %rdi
movl 0xfbb1(%rip), %edx      # 0x124d8
leaq 0x9963(%rip), %rsi      # 0xc291
movb $0x0, %al
callq 0x20e0
leaq 0xfbdc(%rip), %rax      # 0x12518
movq (%rax), %rsi
leaq 0x995c(%rip), %rdi      # 0xc2a2
callq 0x20a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x23b0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgloadint
int cgloadint(int value, int type) {
  // 分配一个新的寄存器
  int r = cgallocreg();

  fprintf(Outfile, "\tmovq\t$%d, %s\n", value, reglist[r]);
  return (r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
callq 0x23f0
movl %eax, -0xc(%rbp)
leaq 0xfb6b(%rip), %rax      # 0x12518
movq (%rax), %rdi
movl -0x4(%rbp), %edx
movslq -0xc(%rbp), %rcx
leaq 0xf712(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x98ea(%rip), %rsi      # 0xc2b3
movb $0x0, %al
callq 0x20e0
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgloadglobstr
int cgloadglobstr(int label) {
  // 分配一个新的寄存器
  int r = cgallocreg();
  fprintf(Outfile, "\tleaq\tL%d(%%rip), %s\n", label, reglist[r]);
  return (r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
callq 0x23f0
movl %eax, -0x8(%rbp)
leaq 0xf6be(%rip), %rax      # 0x12518
movq (%rax), %rdi
movl -0x4(%rbp), %edx
movslq -0x8(%rbp), %rcx
leaq 0xf265(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x952c(%rip), %rsi      # 0xc3a2
movb $0x0, %al
callq 0x20e0
movl -0x8(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgdivmod
int cgdivmod(int r1, int r2, int op) {
  fprintf(Outfile, "\tmovq\t%s,%%rax\n", reglist[r1]);
  fprintf(Outfile, "\tcqo\n");
  fprintf(Outfile, "\tidivq\t%s\n", reglist[r2]);
  if (op == A_DIVIDE)
    fprintf(Outfile, "\tmovq\t%%rax,%s\n", reglist[r1]);
  else
    fprintf(Outfile, "\tmovq\t%%rdx,%s\n", reglist[r1]);
  cgfreereg(r2);
  return (r1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
leaq 0xf550(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf0fa(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x9402(%rip), %rsi      # 0xc3e3
movb $0x0, %al
callq 0x20e0
leaq 0xf529(%rip), %rax      # 0x12518
movq (%rax), %rdi
leaq 0x93fa(%rip), %rsi      # 0xc3f3
movb $0x0, %al
callq 0x20e0
leaq 0xf511(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x8(%rbp), %rcx
leaq 0xf0bb(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x93d9(%rip), %rsi      # 0xc3f9
movb $0x0, %al
callq 0x20e0
cmpl $0x18, -0xc(%rbp)
jne 0x3056
leaq 0xf4e4(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf08e(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x93b7(%rip), %rsi      # 0xc404
movb $0x0, %al
callq 0x20e0
jmp 0x307d
leaq 0xf4bb(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xf065(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x939e(%rip), %rsi      # 0xc414
movb $0x0, %al
callq 0x20e0
movl -0x8(%rbp), %edi
callq 0x24c0
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgshl
int cgshl(int r1, int r2) {
  fprintf(Outfile, "\tmovb\t%s, %%cl\n", breglist[r2]);
  fprintf(Outfile, "\tshlq\t%%cl, %s\n", reglist[r1]);
  cgfreereg(r2);
  return (r1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0xf353(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x8(%rbp), %rcx
leaq 0xef4d(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
leaq 0x926f(%rip), %rsi      # 0xc44d
movb $0x0, %al
callq 0x20e0
leaq 0xf32c(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xeed6(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x9258(%rip), %rsi      # 0xc45d
movb $0x0, %al
callq 0x20e0
movl -0x8(%rbp), %edi
callq 0x24c0
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgshr
int cgshr(int r1, int r2) {
  fprintf(Outfile, "\tmovb\t%s, %%cl\n", breglist[r2]);
  fprintf(Outfile, "\tshrq\t%%cl, %s\n", reglist[r1]);
  cgfreereg(r2);
  return (r1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0xf2e3(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x8(%rbp), %rcx
leaq 0xeedd(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
leaq 0x91ff(%rip), %rsi      # 0xc44d
movb $0x0, %al
callq 0x20e0
leaq 0xf2bc(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xee66(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
leaq 0x91f8(%rip), %rsi      # 0xc46d
movb $0x0, %al
callq 0x20e0
movl -0x8(%rbp), %edi
callq 0x24c0
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cglognot
int cglognot(int r) {
  fprintf(Outfile, "\ttest\t%s, %s\n", reglist[r], reglist[r]);
  fprintf(Outfile, "\tsete\t%s\n", breglist[r]);
  fprintf(Outfile, "\tmovzbq\t%s, %s\n", breglist[r], reglist[r]);
  return (r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0xf1f6(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xeda0(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xed91(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x9147(%rip), %rsi      # 0xc491
movb $0x0, %al
callq 0x20e0
leaq 0xf1c0(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xedba(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
leaq 0x912e(%rip), %rsi      # 0xc49f
movb $0x0, %al
callq 0x20e0
leaq 0xf199(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xed93(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xed34(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x9102(%rip), %rsi      # 0xc4a9
movb $0x0, %al
callq 0x20e0
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ejunjsh[P]mycc/cg.c
// Function: cgboolean
int cgboolean(int r, int op, int label) {
  fprintf(Outfile, "\ttest\t%s, %s\n", reglist[r], reglist[r]);
  switch (op) {
  case A_IF:
  case A_WHILE:
  case A_LOGAND:
    fprintf(Outfile, "\tje\tL%d\n", label);
    break;
  case A_LOGOR:
    fprintf(Outfile, "\tjne\tL%d\n", label);
    break;
  default:
    fprintf(Outfile, "\tsetnz\t%s\n", breglist[r]);
    fprintf(Outfile, "\tmovzbq\t%s, %s\n", breglist[r], reglist[r]);
  }
  return (r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
leaq 0xf100(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xecaa(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x9060(%rip), %rsi      # 0xc491
xorl %eax, %eax
movq %rcx, %rdx
callq 0x20e0
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x8, %eax
je 0x347c
jmp 0x3448
movl -0x10(%rbp), %eax
subl $0x9, %eax
je 0x345f
jmp 0x3452
movl -0x10(%rbp), %eax
addl $-0x1e, %eax
subl $0x1, %eax
ja 0x3499
jmp 0x345f
leaq 0xf0b2(%rip), %rax      # 0x12518
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0x9046(%rip), %rsi      # 0xc4b9
movb $0x0, %al
callq 0x20e0
jmp 0x34f6
leaq 0xf095(%rip), %rax      # 0x12518
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0x9032(%rip), %rsi      # 0xc4c2
movb $0x0, %al
callq 0x20e0
jmp 0x34f6
leaq 0xf078(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xec72(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
leaq 0x9013(%rip), %rsi      # 0xc4cc
movb $0x0, %al
callq 0x20e0
leaq 0xf051(%rip), %rax      # 0x12518
movq (%rax), %rdi
movslq -0x4(%rbp), %rcx
leaq 0xec4b(%rip), %rax      # 0x12120
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xebec(%rip), %rax      # 0x120d0
movq (%rax,%rcx,8), %rcx
leaq 0x8fba(%rip), %rsi      # 0xc4a9
movb $0x0, %al
callq 0x20e0
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop