LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: init_msg_list
MsgList init_msg_list() {
    if(msgQ_singleton)
        return 0;
    struct msg_list * new_list;
    CALLEXIT(!(new_list = calloc(1, sizeof *new_list)))
    msgQ_singleton++;
    return new_list;
}

// Assembly:
pushq %rax
cmpb $0x0, 0x12665(%rip)     # 0x1f2c8
je 0xcc69
xorl %eax, %eax
jmp 0xcc84
movl $0x1, %edi
movl $0x20, %esi
callq 0x2110
testq %rax, %rax
je 0xcc86
movb $0x1, 0x12644(%rip)     # 0x1f2c8
popq %rcx
retq
callq 0x2d59
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: init_msg_hist_list
MsgHistoryList init_msg_hist_list() {
    if(msgHQ_singleton)
        return 0;
    struct msg_hist_list * new_list;
    CALLEXIT(!(new_list = calloc(1, sizeof *new_list)))
    msgHQ_singleton++;
    return new_list;
}

// Assembly:
pushq %rax
cmpb $0x0, 0x12631(%rip)     # 0x1f2c4
je 0xcc99
xorl %eax, %eax
jmp 0xccb4
movl $0x1, %edi
movl $0x20, %esi
callq 0x2110
testq %rax, %rax
je 0xccb6
movb $0x1, 0x12610(%rip)     # 0x1f2c4
popq %rcx
retq
callq 0x2d6e
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: init_connect_server
int init_connect_server (const char *ip_addr, const char *port) {
    errno = 0;
    struct addrinfo destination, *res;
    memset(&destination, 0, sizeof destination);
    destination.ai_family = AF_INET;
    destination.ai_socktype = SOCK_STREAM;
    getaddrinfo(ip_addr, port, &destination, &res);
    CALLEXIT((con_socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1)
    printf(INFO "Trying to connect to %s:%s\n", ip_addr, port);
    CALLEXIT(connect(con_socket, res->ai_addr, res->ai_addrlen) == -1)
    printf(INFO "Connected to %s:%s\n", ip_addr, port);
    freeaddrinfo(res);
    return errno;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %r15
callq 0x2030
movq %rax, %rbx
movl $0x0, (%rax)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x2280
movq (%r12), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2070
movl %eax, 0x1259a(%rip)     # 0x1f2c0
cmpl $-0x1, %eax
je 0xcd87
leaq 0xa1e9(%rip), %rdi      # 0x16f1b
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2040
movl 0x1257b(%rip), %edi     # 0x1f2c0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x2180
cmpl $-0x1, %eax
je 0xcd8c
leaq 0xa246(%rip), %rdi      # 0x16fa8
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2040
movq 0x8(%rsp), %rdi
callq 0x22a0
movl (%rbx), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x2d98
callq 0x2d83
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: free_msg_hist_list
void free_msg_hist_list() {
    if(!msgHQ_singleton || !mhlist)
        return;
    struct msg_hist_list * cmhlist = mhlist;
    struct msg_hist_node * tmp = cmhlist->head;
    while(tmp) {
        struct msg_hist_node * next = tmp->next;
        free(tmp);
        tmp = next;
    }
    free(cmhlist);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x124f8(%rip), %rbx     # 0x1f2b8
testq %rbx, %rbx
setne %al
andb 0x124f8(%rip), %al      # 0x1f2c4
cmpb $0x1, %al
jne 0xcdf8
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xcde9
movq 0x10(%rdi), %r14
callq 0x2240
movq %r14, %rdi
testq %r14, %r14
jne 0xcdd8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: add_hist_msg
void add_hist_msg(size_t len) {
    if(mhlist == 0)
        return;
    struct msg_hist_list * cmhlist = mhlist;

    time_t cur_time = time(0);
    if(cmhlist->head == 0) {
        add_event(MSGSEND, 0, SENDQ_INTERVAL, NORMAL); //should be unique, though there should also never be multiple MSGSEND events in the queue
        CALLEXIT(!(cmhlist->head = cmhlist->tail = calloc(1, sizeof *cmhlist->head)))
    } else {
        CALLEXIT(!(cmhlist->tail->next = calloc(1, sizeof *cmhlist->tail)))
        cmhlist->tail = cmhlist->tail->next;
    }
    cmhlist->tail->date = cur_time;
    cmhlist->tail->len = len;

    cmhlist->byte_size += len;
    cmhlist->msgs++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x124ac(%rip), %r15     # 0x1f2b8
testq %r15, %r15
je 0xce9d
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21b0
movq %rax, %r14
cmpq $0x0, (%r15)
je 0xce4a
movl $0x1, %edi
movl $0x18, %esi
callq 0x2110
movq 0x8(%r15), %rcx
movq %rax, 0x10(%rcx)
testq %rax, %rax
je 0xcea3
movq %rax, 0x8(%r15)
jmp 0xce78
movl $0x4, %edi
xorl %esi, %esi
movl $0x5, %edx
xorl %ecx, %ecx
callq 0xf887
movl $0x1, %edi
movl $0x18, %esi
callq 0x2110
movq %rax, 0x8(%r15)
movq %rax, (%r15)
testq %rax, %rax
je 0xcea8
movq %r14, 0x8(%rax)
movq %rbx, (%rax)
movq %rbx, %xmm0
movdqu 0x10(%r15), %xmm1
shufpd $0x2, 0x440d(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
paddq %xmm1, %xmm0
movdqu %xmm0, 0x10(%r15)
popq %rbx
popq %r14
popq %r15
retq
callq 0x2dc2
callq 0x2dd7
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: free_msg_list
void free_msg_list() {
    if(!mlist || !msgQ_singleton)
        return;
    struct msg_list * cmlist = mlist;
    struct msg_node * tmp = cmlist->head;
    while(tmp) {
        struct msg_node * next = tmp->next;
        free(tmp->msg);
        free(tmp);
        tmp = next;
    }
    free(cmlist);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x123f7(%rip), %rbx     # 0x1f2b0
testq %rbx, %rbx
je 0xcef8
testb $0x1, 0x12403(%rip)     # 0x1f2c8
je 0xcef8
movq (%rbx), %r14
testq %r14, %r14
je 0xceeb
movq (%r14), %rdi
movq 0x10(%r14), %r15
callq 0x2240
movq %r14, %rdi
callq 0x2240
movq %r15, %r14
testq %r15, %r15
jne 0xcecf
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2240
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: add_msg
void add_msg(char * msg, size_t len) {
    if(mlist == 0)
        return;
    struct msg_list * cmlist = mlist;

    if(cmlist->head == 0) {
        CALLEXIT(!(cmlist->head = cmlist->tail = calloc(1, sizeof *cmlist->head)))
    } else {
        CALLEXIT(!(cmlist->tail->next = calloc(1, sizeof *cmlist->tail)))
        cmlist->tail = cmlist->tail->next;
    }
    CALLEXIT(!(cmlist->tail->msg = malloc(len+1)))
    strcpy(cmlist->tail->msg, msg);
    cmlist->tail->len = len;
    cmlist->byte_size += len;
    cmlist->msgs++;
    process_messages();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x123a2(%rip), %r12     # 0x1f2b0
testq %r12, %r12
je 0xcf49
movq %rsi, %rbx
movq %rdi, %r14
movq (%r12), %r13
movl $0x1, %edi
movl $0x18, %esi
callq 0x2110
movq %rax, %r15
testq %r13, %r13
je 0xcf53
movq 0x8(%r12), %rax
movq %r15, 0x10(%rax)
testq %r15, %r15
je 0xcfb4
movq %r15, 0x8(%r12)
jmp 0xcf61
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, 0x8(%r12)
movq %r15, (%r12)
testq %r15, %r15
je 0xcfb9
leaq 0x1(%rbx), %rdi
callq 0x22b0
movq %rax, (%r15)
testq %rax, %rax
je 0xcfaf
movq %rax, %rdi
movq %r14, %rsi
callq 0x21c0
movq %rbx, 0x8(%r15)
movq %rbx, %xmm0
movdqu 0x10(%r12), %xmm1
shufpd $0x2, 0x430a(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
paddq %xmm1, %xmm0
movdqu %xmm0, 0x10(%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcfbe
callq 0x2e01
callq 0x2dec
callq 0x2e16
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: process_messages
void process_messages() {
    if(mlist == 0 || mhlist == 0)
        return;
    struct msg_list * csrc = mlist;
    struct msg_hist_list * cdest = mhlist;

    size_t len;
    while(csrc->head != 0 && cdest->msgs < MAX_MSGS_IN_INTERVAL && cdest->byte_size + (len = peek_msg_size()) < MAX_SENDQ_SIZE) {
        if(len > MAX_MESSAGE_BUFFER) {
            PRINTERR("Message too long")
        }
        char * msg = retr_msg();
        send_socket(msg, len);
        free(msg);
        add_hist_msg(len);
        //printf("MQueue: %zu of %d (PUSH)\n", cdest->byte_size, MAX_SENDQ_SIZE);

    }
    if(cdest->msgs >= MAX_MSGS_IN_INTERVAL || cdest->byte_size + peek_msg_size() >= MAX_SENDQ_SIZE) {
        printf(INFO "Send queue full\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x122e0(%rip), %r13     # 0x1f2b0
testq %r13, %r13
sete %al
movq 0x122db(%rip), %r12     # 0x1f2b8
testq %r12, %r12
sete %cl
orb %al, %cl
je 0xcff6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, (%r13)
je 0xd0b5
cmpq $0x9, 0x18(%r12)
ja 0xd0ee
movq 0x1229c(%rip), %rbp     # 0x1f2b0
testq %rbp, %rbp
je 0xd028
movq (%rbp), %rax
testq %rax, %rax
je 0xd028
movq 0x8(%rax), %r14
jmp 0xd02b
xorl %r14d, %r14d
movq 0x10(%r12), %rax
addq %r14, %rax
cmpq $0x1f3, %rax            # imm = 0x1F3
ja 0xd0b5
cmpq $0x191, %r14            # imm = 0x191
jae 0xd0a0
testq %rbp, %rbp
je 0xd07d
movq (%rbp), %rdi
testq %rdi, %rdi
je 0xd07d
movq (%rdi), %r15
movq 0x8(%rdi), %rax
subq %rax, 0x10(%rbp)
decq 0x18(%rbp)
movq 0x10(%rdi), %rbx
callq 0x2240
movq %rbx, (%rbp)
testq %rbx, %rbx
jne 0xd080
movq $0x0, 0x8(%rbp)
jmp 0xd080
xorl %r15d, %r15d
movq %r15, %rdi
movq %r14, %rsi
callq 0xcd96
movq %r15, %rdi
callq 0x2240
movq %r14, %rdi
callq 0xce00
jmp 0xcff6
leaq 0xa1ec(%rip), %rdi      # 0x17293
callq 0x2190
movq 0x121fd(%rip), %rbp     # 0x1f2b0
jmp 0xd044
cmpq $0x9, 0x18(%r12)
ja 0xd0ee
movq 0x10(%r12), %rax
movq 0x121e7(%rip), %rcx     # 0x1f2b0
testq %rcx, %rcx
je 0xd0dc
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xd0dc
movq 0x8(%rcx), %rcx
jmp 0xd0de
xorl %ecx, %ecx
addq %rax, %rcx
cmpq $0x1f4, %rcx            # imm = 0x1F4
jb 0xcfe7
leaq 0xa1e3(%rip), %rdi      # 0x172d8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2330
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: pop_hist_msg
void pop_hist_msg() {
    if(mhlist == 0)
        return;
    struct msg_hist_list * cmhlist = mhlist;
    if(cmhlist->head == 0)
        return;
    time_t cur_time = time(0);
    while(cmhlist->head != 0 && cur_time - SENDQ_INTERVAL >= cmhlist->head->date) {
        cmhlist->byte_size -= cmhlist->head->len;
        //printf("MQueue: %zu of %d (POP)\n", cmhlist->byte_size, MAX_SENDQ_SIZE);
        cmhlist->msgs--;
        struct msg_hist_node * new_head = cmhlist->head->next;
        free(cmhlist->head);
        cmhlist->head = new_head;
    }
    if(cmhlist->head != 0) {
        add_event(MSGSEND, 1, (unsigned int)(SENDQ_INTERVAL - (cur_time - cmhlist->head->date)), NORMAL);
    }
    process_messages();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x121a1(%rip), %r14     # 0x1f2b8
testq %r14, %r14
je 0xd165
cmpq $0x0, (%r14)
je 0xd165
xorl %edi, %edi
callq 0x21b0
movq (%r14), %rdi
testq %rdi, %rdi
je 0xd187
movq %rax, %rbx
movq %rax, %r15
addq $-0x5, %r15
movq 0x8(%rdi), %rdx
cmpq %rdx, %r15
jl 0xd171
movq (%rdi), %rax
subq %rax, 0x10(%r14)
decq 0x18(%r14)
movq 0x10(%rdi), %r12
callq 0x2240
movq %r12, (%r14)
movq %r12, %rdi
testq %r12, %r12
jne 0xd13b
jmp 0xd187
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
subl %ebx, %edx
addl $0x5, %edx
movl $0x4, %edi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xf887
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xcfbe
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/network.c
// Function: hostname_to_ip
int hostname_to_ip(char *hostname , char *ip) {
    struct hostent *he;
    struct in_addr **addr_list;
    int i;
         
    if ((he = gethostbyname(hostname)) == NULL) {
        herror("gethostbyname");
        return 1;
    }
 
    addr_list = (struct in_addr **) he->h_addr_list;
     
    for(i=0; addr_list[i] != NULL; i++) {
        strcpy(ip , inet_ntoa(*addr_list[i]));
        return 0;
    }

    return 1;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x2220
testq %rax, %rax
je 0xd1e3
movq 0x18(%rax), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xd1ef
movl (%rax), %edi
callq 0x20d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x21c0
xorl %eax, %eax
jmp 0xd1f4
leaq 0xa0e0(%rip), %rdi      # 0x172ca
callq 0x2250
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: to_lower
char *to_lower (char *str) {
    for (size_t i=0; i<strlen(str); i++) {
        if (str[i] >= 'A' && str[i] <= 'Z') {
            str[i] += 32;
        }
    }
    return str;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0xd229
xorl %r14d, %r14d
movb (%rbx,%r14), %al
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0xd219
orb $0x20, %al
movb %al, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x20c0
cmpq %rax, %r14
jb 0xd207
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: xor_flip
char *xor_flip (char * password) { //password -> 64
    unsigned int key = 0xDEADBEBE;
    for (size_t i=0; i<strlen(password); i++)
        password[i] ^= key;
    return password;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0xd258
xorl %r14d, %r14d
xorb $-0x42, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x20c0
cmpq %rax, %r14
jb 0xd243
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: gen_salt
void gen_salt(char * salt, size_t len) {
    size_t pos;
    for(pos = 0; pos < len-1; pos++) {
        do {
            salt[pos] = (char)(rand() % 256 - 128); //char -> (-128...127); mod 2^x does not skew random distribution
        } while(salt[pos] != 0);
    }
    salt[pos] = '\0';
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
decq %rbx
je 0xd28e
xorl %r15d, %r15d
callq 0x2080
leal -0x80(%rax), %ecx
movb %cl, (%r14,%r15)
cmpb $-0x80, %al
jne 0xd276
incq %r15
cmpq %rbx, %r15
jne 0xd276
movb $0x0, (%r14,%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: hash_pwd
void hash_pwd(unsigned char * digest, char const * salt, char const * password) {
    size_t concatlen = strnlen(salt, 16) + strnlen(password, 64) + 2;
    char *concat;
    unsigned int outLen;

    CALLEXIT(!(concat = malloc(concatlen)))
    snprintf(concat, concatlen, "!%s%s", password, salt);

    EVP_MD_CTX *ctx;
    ctx = EVP_MD_CTX_new();

    EVP_DigestInit(ctx, EVP_sha256());
    EVP_DigestUpdate(ctx, concat, concatlen);
    EVP_DigestFinal(ctx, digest, &outLen);

    printf("concat %s - concatlen: %zu - salt: %s - pass: %s - digest: %s\n", concat, concatlen, salt, password, digest);

	free(concat);
    EVP_MD_CTX_free(ctx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x10, %esi
movq %r15, %rdi
callq 0x2350
movq %rax, %r12
movl $0x40, %esi
movq %rbx, %rdi
callq 0x2350
leaq (%r12,%rax), %r13
addq $0x2, %r13
movq %r13, %rdi
callq 0x22b0
testq %rax, %rax
je 0xd372
movq %rax, %r12
leaq 0xa04f(%rip), %rdx      # 0x1733c
movq %rax, %rdi
movq %r13, %rsi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2390
callq 0x2210
movq %rax, %rbp
callq 0x2400
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2460
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2470
leaq 0x4(%rsp), %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22f0
leaq 0xa005(%rip), %rdi      # 0x17342
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x2040
movq %r12, %rdi
callq 0x2240
movq %rbp, %rdi
callq 0x2420
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2e2b
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: hash_cmp
int hash_cmp(unsigned char const * s1, unsigned char const * s2) {
    int i;
    for(i = 0; i < SHA256_DIGEST_LENGTH && s1 && *s1 && s2 && *s2 && *s1 == *s2; i++) {
        s1++;
        s2++;
    }
    return i == SHA256_DIGEST_LENGTH;
}

// Assembly:
testq %rdi, %rdi
je 0xd3a7
xorl %ecx, %ecx
movb (%rdi,%rcx), %al
testb %al, %al
je 0xd39e
movq %rsi, %rdx
addq %rcx, %rdx
je 0xd39e
cmpb (%rdx), %al
jne 0xd39e
incq %rcx
cmpl $0x20, %ecx
jne 0xd37e
movl $0x20, %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: matches_regex
int matches_regex (char *buf, const char *regular_expression) {
    pcre *regex_compiled;
    pcre_extra *pcre_optimized;
    int pcre_return;
    int pcre_error_offset;
    int substring_vec[30];
    const char *p_sub_str_match_str;
    const char *pcre_error;

    regex_compiled = pcre_compile(regular_expression, PCRE_MULTILINE,
                                  &pcre_error, &pcre_error_offset, NULL);

    if (regex_compiled == NULL) {
        fprintf(stderr, ERR "parse/matches_regex: Could not compile regular expression: %s (%s)\n",
                regular_expression, pcre_error);
        exit(1);
    }

    pcre_optimized = pcre_study(regex_compiled, 0, &pcre_error);

    if (pcre_error != NULL) {
        fprintf(stderr, ERR "parse/matches_regex: Could not optimize regular expression: %s (%s)\n", regular_expression, pcre_error);
        exit(1);
    }

    pcre_return = pcre_exec(regex_compiled, pcre_optimized, buf,
                            (int)strlen(buf), 0, PCRE_NOTEOL, substring_vec, 30);
    pcre_free(regex_compiled);
    pcre_free(pcre_optimized);

    if (pcre_return > 0) {
        int j;
        for (j=0; j<pcre_return; j++) {
            pcre_get_substring(buf, substring_vec, pcre_return, j, &(p_sub_str_match_str));
            strcpy(regex_group[j], p_sub_str_match_str);
            pcre_free_substring(p_sub_str_match_str);
        }
        //We've found a match
        return 1;
    } else {
        //We've not found a match
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %rsi, %rdi
movl $0x2, %esi
xorl %r8d, %r8d
callq 0x23c0
testq %rax, %rax
je 0xd4bd
movq %rax, %r14
xorl %ebp, %ebp
leaq 0x8(%rsp), %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x23e0
movq (%r13), %rsi
testq %rsi, %rsi
jne 0xd4ca
movq %rax, %r12
movq %rbx, %rdi
callq 0x20c0
leaq 0x20(%rsp), %r10
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %r13
movq %rbx, %rdx
movl %eax, %ecx
xorl %r8d, %r8d
movl $0x100, %r9d            # imm = 0x100
pushq $0x1e
pushq %r10
callq 0x2300
addq $0x10, %rsp
movl %eax, %r15d
movq 0x11b8a(%rip), %rbx     # 0x1efd0
movq %r14, %rdi
callq *(%rbx)
movq %r12, %rdi
callq *(%rbx)
testl %r15d, %r15d
jle 0xd4a9
movl %r15d, %r14d
leaq 0x12e81(%rip), %r15     # 0x202e0
xorl %r12d, %r12d
leaq 0x10(%rsp), %rbp
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
movl %r14d, %edx
movl %r12d, %ecx
movq %rbp, %r8
callq 0x2130
movq 0x10(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x21a0
incq %r12
addq $0x190, %r15            # imm = 0x190
cmpq %r12, %r14
jne 0xd467
movl $0x1, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x2e67
movq %r15, %rdi
callq 0x2e40
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: handle_login
void handle_login (char *nick, char *pass __attribute__((unused)), char *real, char *ident) {
    char out[MAX_MESSAGE_BUFFER];
    sprintf(out, "NICK %s\r\n", nick);
    add_msg(out, strlen(out));
    sprintf(out, "USER %s * * :%s\r\n", ident, real);
    add_msg(out, strlen(out));
    //printf(INFO "Using password '%s'\n", pass); //TODO:quieting down warnings for now but this will be nickserv
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rdx
leaq 0x9f42(%rip), %rsi      # 0x17430
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcefe
leaq 0x9f25(%rip), %rsi      # 0x1743a
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcefe
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/parse.c
// Function: command_allowed
int command_allowed(char *command, int pindex) { //command -> 16
    if (dawn->players[pindex].travel_timer.active) {
        char disallowed[2][16] = {"melee", "gmelee"}; //remember to change array limits
        for (int i=0; i<2; i++) {
            printf("recv '%s' iter '%s'\n", command, disallowed[i]);
            if (strcmp(command, disallowed[i]) == 0) return 0;
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x14295(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
cmpl $0x0, 0x12ec(%rax,%rcx)
movl $0x1, %ebx
je 0xd865
movq %rdi, %r14
leaq 0x10(%rsp), %r13
movaps 0x9e9a(%rip), %xmm0     # 0x176b0
movaps %xmm0, (%r13)
movaps 0x9e7e(%rip), %xmm0     # 0x176a0
movaps %xmm0, -0x10(%r13)
movq %rsp, %r12
movb $0x1, %bpl
leaq 0x9d48(%rip), %r15      # 0x1757c
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
movq %r12, %rsi
callq 0x22d0
testl %eax, %eax
je 0xd863
movq %r13, %r12
testb $0x1, %bpl
movl $0x0, %ebp
jne 0xd834
jmp 0xd865
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: get_pindex
int get_pindex(char const *username) { //username -> MAX_NICK_LENGTH
    for (int i = 0; i < dawn->player_count; i++) {
        if (strcasecmp(dawn->players[i].username, username) == 0)
            return i;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x14004(%rip), %rax     # 0x21a80
movq (%rax), %r15
movslq 0x148(%r15), %r12
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
jle 0xdac0
movq %rdi, %r14
addq $0x1a0, %r15            # imm = 0x1A0
xorl %r13d, %r13d
movq %r15, %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
je 0xdabd
incq %r13
addq $0x26a8, %r15           # imm = 0x26A8
cmpq %r13, %r12
jne 0xda9d
jmp 0xdac0
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: get_bindex
int get_bindex (struct Bot *b, char const * username, char const * location) { //username -> MAX_NICK_LENGTH, location -> 64
    int pindex = get_pindex(username);
    for (int i=0; i<MAX_BUILDINGS; i++) {
        if (strcmp(location, dawn->players[pindex].current_map.buildings[i].name) == 0) {
            return i;
        }
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rdi
callq 0xda6c
leaq 0x13f9d(%rip), %rcx     # 0x21a80
movq (%rcx), %rcx
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
leaq (%rcx,%rax), %r15
addq $0x133c, %r15           # imm = 0x133C
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22d0
testl %eax, %eax
je 0xdb1f
incq %r14
addq $0x50, %r15
cmpq $0x40, %r14
jne 0xdafd
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: save_players
void save_players(void) {
    if (dawn == 0)
        return;
    FILE *file = fopen("players.bin", "wb");
    if(!file) {
        PRINTWARN("Could not save players")
        return;
    }
    size_t len;
    CALLEXIT(!(len = fwrite(dawn, sizeof *dawn, 1, file)))
    fclose(file);
    printf(INFO "Saved players (%zu bytes)\n", len * (sizeof *dawn));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x13c5d(%rip), %r14     # 0x21a80
cmpq $0x0, (%r14)
je 0xde85
leaq 0x9979(%rip), %rdi      # 0x177a9
leaq 0x78ab(%rip), %rsi      # 0x156e2
callq 0x2230
testq %rax, %rax
je 0xde8d
movq %rax, %rbx
movq (%r14), %rdi
movl $0xf2eb8, %esi          # imm = 0xF2EB8
movl $0x1, %edx
movq %rax, %rcx
callq 0x2480
testq %rax, %rax
je 0xdea0
movq %rax, %r14
movq %rbx, %rdi
callq 0x21f0
imulq $0xf2eb8, %r14, %rsi    # imm = 0xF2EB8
leaq 0x99cc(%rip), %rdi      # 0x17843
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9921(%rip), %rdi      # 0x177b5
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
callq 0x2e91
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: load_players
void load_players(void) {
    FILE *file = fopen("players.bin", "rb");

    if (!file) {
        fprintf(stderr, WARN "Could not load players\n");
        return;
    }

    CALLEXIT(!(fread(dawn, sizeof *dawn, 1, file)))
    fclose(file);
    printf(INFO "Players loaded (%zu bytes)\n", sizeof *dawn);
}

// Assembly:
pushq %rbx
leaq 0x98fc(%rip), %rdi      # 0x177a9
leaq 0x723b(%rip), %rsi      # 0x150ef
callq 0x2230
testq %rax, %rax
je 0xdefe
movq %rax, %rbx
leaq 0x13bb8(%rip), %rax     # 0x21a80
movq (%rax), %rdi
movl $0xf2eb8, %esi          # imm = 0xF2EB8
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2320
testq %rax, %rax
je 0xdf05
movq %rbx, %rdi
callq 0x21f0
leaq 0x99f6(%rip), %rdi      # 0x178e7
movl $0xf2eb8, %esi          # imm = 0xF2EB8
xorl %eax, %eax
popq %rbx
jmp 0x2040
callq 0x2ebb
popq %rbx
retq
callq 0x2ea6
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: get_nextlvl_exp
unsigned long long get_nextlvl_exp(char const *username) { //username -> MAX_NICK_LENGTH
    unsigned long long curr_level = (unsigned long long) dawn->players[get_pindex(username)].level;
    if (curr_level > 10) {
        return (500ULL * curr_level * curr_level * curr_level - 500ULL * curr_level);
    } else {
        return (100ULL * curr_level *curr_level * curr_level - 100ULL * curr_level);
    }
}

// Assembly:
pushq %rbx
leaq 0x13b6e(%rip), %rax     # 0x21a80
movq (%rax), %rbx
callq 0xda6c
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
movslq 0x2808(%rbx,%rax), %rcx
movq %rcx, %rdx
imulq %rcx, %rdx
cmpq $0xb, %rcx
movl $0x1f4, %esi            # imm = 0x1F4
movl $0x64, %eax
cmovaeq %rsi, %rax
imulq %rdx, %rax
leaq -0x1f4(%rax), %rdx
addq $-0x64, %rax
cmpq $0xb, %rcx
cmovaeq %rdx, %rax
imulq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: assign_attr_points
void assign_attr_points(struct Message *message, char *which, int amount) {
    int pindex = get_pindex(message->sender_nick);
    int attr_pts = dawn->players[pindex].attr_pts;
    char out[MAX_MESSAGE_BUFFER];

    if (strcmp(which, "str") == 0 && attr_pts >= amount) {
        dawn->players[pindex].strength += amount;
    } else if (strcmp(which, "def") == 0 && attr_pts >= amount) {
        dawn->players[pindex].defense += amount;
    } else if (strcmp(which, "int") == 0 && attr_pts >= amount) {
        dawn->players[pindex].intelligence += amount;
    } else if (strcmp(which, "mdef") == 0 && attr_pts >= amount) {
        dawn->players[pindex].m_def += amount;
    } else {
        sprintf(out, "PRIVMSG %s :%s, you have chosen an invalid attribute to increase or do not have the amount "
                "of attribute points required: (%d points available)\r\n", message->receiver, message->sender_nick, attr_pts);
        add_msg(out, strlen(out));
        return;
    }
    dawn->players[pindex].attr_pts -= amount;
    sprintf(out, "PRIVMSG %s :%s has increased %s by %d, you have %d attribute points available\r\n", message->receiver,
            message->sender_nick, which, amount, attr_pts - amount);
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
callq 0xda6c
leaq 0x13578(%rip), %rcx     # 0x21a80
movq (%rcx), %r12
leaq 0x1a0(%r12), %rbx
cltq
imulq $0x26a8, %rax, %r13     # imm = 0x26A8
movl 0x2838(%r12,%r13), %r15d
leaq 0x9539(%rip), %rsi      # 0x17a64
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
setne %al
movl %r15d, 0xc(%rsp)
subl %ebp, %r15d
setl %cl
orb %al, %cl
je 0xe5d3
movq %rbx, 0x10(%rsp)
cmpl %ebp, 0xc(%rsp)
setl %bl
leaq 0x950f(%rip), %rsi      # 0x17a6d
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
setne %al
orb %bl, %al
je 0xe5dd
cmpl %ebp, 0xc(%rsp)
setl %bl
leaq 0x94eb(%rip), %rsi      # 0x17a68
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
setne %al
orb %bl, %al
je 0xe5ec
cmpl %ebp, 0xc(%rsp)
setl %bl
leaq 0x94d0(%rip), %rsi      # 0x17a6c
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
setne %al
orb %bl, %al
je 0xe5fb
movq 0x18(%rsp), %rcx
leaq 0xc0(%rcx), %rdx
leaq 0x94b1(%rip), %rsi      # 0x17a71
leaq 0x20(%rsp), %rdi
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x2050
jmp 0xe63e
addl %ebp, 0x2684(%rbx,%r13)
jmp 0xe608
movq 0x10(%rsp), %rax
addl %ebp, 0x268c(%rax,%r13)
jmp 0xe608
movq 0x10(%rsp), %rax
addl %ebp, 0x2688(%rax,%r13)
jmp 0xe608
movq 0x10(%rsp), %rax
addl %ebp, 0x2690(%rax,%r13)
leaq (%r12,%r13), %rax
addq $0x2838, %rax           # imm = 0x2838
movl %r15d, (%rax)
movq 0x18(%rsp), %rcx
leaq 0xc0(%rcx), %rdx
movl %r15d, (%rsp)
leaq 0x94d6(%rip), %rsi      # 0x17b02
leaq 0x20(%rsp), %rdi
movq %r14, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0x2050
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcefe
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: revive
void revive(struct Message *message) {
    char out[MAX_MESSAGE_BUFFER];
    int pindex = get_pindex(message->sender_nick);
    int cur_x = dawn->players[pindex].pos_x;
    int cur_y = dawn->players[pindex].pos_y;

    if (cur_x == 7 && cur_y == 4) {
        if (!dawn->players[pindex].alive) {
            dawn->players[pindex].health = dawn->players[pindex].max_health;
            dawn->players[pindex].mana = dawn->players[pindex].max_mana;
            dawn->players[pindex].alive = 1;
            dawn->players[pindex].fullness = 100;
            sprintf(out, "PRIVMSG %s :%s, you have been revived!\r\n", message->receiver, message->sender_nick);
        } else {
            sprintf(out, "PRIVMSG %s :%s, you are not dead\r\n", message->receiver, message->sender_nick);
        }
    } else {
        sprintf(out, "PRIVMSG %s :%s, you must be at a shrine to revive!\r\n", message->receiver, message->sender_nick);
    }
    add_msg(out, strlen(out));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
callq 0xda6c
leaq 0x133ff(%rip), %rcx     # 0x21a80
movq (%rcx), %rcx
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
cmpl $0x7, 0x278c(%rcx,%rax)
leaq 0x9502(%rip), %rsi      # 0x17b9e
jne 0xe702
cmpl $0x4, 0x2790(%rcx,%rax)
jne 0xe702
leaq (%rcx,%rax), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
cmpl $0x0, 0x2660(%rdx)
je 0xe6c5
leaq 0x94b8(%rip), %rsi      # 0x17b7b
jmp 0xe702
addq $0x1a0, %rcx            # imm = 0x1A0
movslq 0x2670(%rdx), %rsi
movq %rsi, 0x2650(%rdx)
movl 0x2674(%rdx), %esi
movl %esi, 0x2680(%rdx)
movl $0x1, 0x2660(%rcx,%rax)
movw $0x64, 0x26a2(%rcx,%rax)
leaq 0x9450(%rip), %rsi      # 0x17b52
leaq 0xc0(%rbx), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcefe
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/player.c
// Function: str_to_auth_level
enum auth_level str_to_auth_level(char * al) {
    if(strcasecmp(al, "USER") == 0) {
        return AL_USER;
    } else if(strcasecmp(al, "REG") == 0) {
        return AL_REG;
    } else if(strcasecmp(al, "ADMIN") == 0) {
        return AL_ADMIN;
    } else if(strcasecmp(al, "ROOT") == 0) {
        return AL_ROOT;
    }
    return AL_NOAUTH;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x946a(%rip), %rsi      # 0x17bdb
callq 0x2200
testl %eax, %eax
je 0xe7bd
leaq 0x945f(%rip), %rsi      # 0x17be0
movq %rbx, %rdi
callq 0x2200
testl %eax, %eax
je 0xe7c4
leaq 0x9450(%rip), %rsi      # 0x17be4
movq %rbx, %rdi
callq 0x2200
testl %eax, %eax
je 0xe7cb
leaq 0x9443(%rip), %rsi      # 0x17bea
movq %rbx, %rdi
callq 0x2200
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
shll $0x2, %eax
jmp 0xe7d0
movl $0x1, %eax
jmp 0xe7d0
movl $0x2, %eax
jmp 0xe7d0
movl $0x3, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/spells.c
// Function: cast_teleport
void cast_teleport(const char *username, int x, int y) {
    struct Message temp;
    strcpy(temp.sender_nick, username);
    strcpy(temp.receiver, dawn->active_room);
    move_player(&temp, x, y, 1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x900, %rsp            # imm = 0x900
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x21c0
leaq 0xc0(%rsp), %rdi
leaq 0x12ba0(%rip), %rax     # 0x21a80
movl $0x100, %esi            # imm = 0x100
addq (%rax), %rsi
callq 0x21c0
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movl $0x1, %ecx
callq 0xb0bd
addq $0x900, %rsp            # imm = 0x900
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/spells.c
// Function: cast_rain
void cast_rain(const char *username) {
    int pindex = get_pindex(username);
    char out[MAX_MESSAGE_BUFFER];

    if (!dawn->players[pindex].spellbook.rain.learned) {
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you do not know this spell\r\n",
                 dawn->active_room, username);
        add_msg(out, strlen(out));
        return;
    }

    int rain_cost = 1 + dawn->players[pindex].spellbook.rain.level * 6;
    int rain_amount = 1 + rand() % (dawn->players[pindex].spellbook.rain.level * 6);

    if (dawn->players[pindex].mana >= rain_cost) {
        dawn->players[pindex].mana -= rain_cost;

        for (int i = 0; i < dawn->player_count; i++) {
            dawn->players[i].fullness += rain_amount;
            if (dawn->players[i].fullness >= 100) dawn->players[i].fullness = 100;
        }

        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has conjured up a storm. Rain pours down "
                "upon the town, allowing the crops to flourish! Everyone's fullness +%d!\r\n",
                 dawn->active_room, username, rain_amount);
    } else {
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you do not have enough mana to cast this spell\r\n",
                 dawn->active_room, username);
    }
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
callq 0xda6c
leaq 0x12b5a(%rip), %r15     # 0x21a80
movq (%r15), %rcx
cltq
imulq $0x26a8, %rax, %r14     # imm = 0x26A8
cmpl $0x0, 0x1304(%rcx,%r14)
je 0xeff4
leaq (%rcx,%r14), %rax
addq $0x12fc, %rax           # imm = 0x12FC
movl (%rax), %eax
addl %eax, %eax
leal (%rax,%rax,2), %ebp
callq 0x2080
movq (%r15), %rcx
movl 0x12fc(%rcx,%r14), %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %esi
cltd
idivl %esi
movl 0x2820(%rcx,%r14), %eax
cmpl %ebp, %eax
jle 0xf004
movl %edx, %r9d
leaq (%rcx,%r14), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
incl %r9d
notl %ebp
addl %ebp, %eax
movl %eax, 0x2680(%rdx)
movslq 0x148(%rcx), %rax
testq %rax, %rax
jle 0xefd2
leaq 0x2842(%rcx), %rdx
xorl %esi, %esi
movzwl (%rdx), %edi
addw %r9w, %di
cmpw $0x64, %di
movl $0x64, %r8d
cmovll %edi, %r8d
movw %r8w, (%rdx)
incq %rsi
addq $0x26a8, %rdx           # imm = 0x26A8
cmpq %rax, %rsi
jb 0xefaa
addq $0x100, %rcx            # imm = 0x100
leaq 0x916d(%rip), %rdx      # 0x1814d
movq %rsp, %rdi
movl $0x190, %esi            # imm = 0x190
movq %rbx, %r8
xorl %eax, %eax
callq 0x2390
jmp 0xf024
addq $0x100, %rcx            # imm = 0x100
leaq 0x8de1(%rip), %rdx      # 0x17de3
jmp 0xf012
addq $0x100, %rcx            # imm = 0x100
leaq 0x91bd(%rip), %rdx      # 0x181cf
movq %rsp, %rdi
movl $0x190, %esi            # imm = 0x190
movq %rbx, %r8
xorl %eax, %eax
callq 0x2390
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcefe
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/stats.c
// Function: get_stat
void get_stat(struct Message *m, int stats[7]) {
    int i = get_pindex(m->sender_nick);
    if (i == -1) {
        return;
    }
    for (int j = 0; j < (MAX_INVENTORY_SLOTS - dawn->players[i].available_slots); j++) {
        if (is_equipped(i, j)) {
            stats[0] += dawn->players[i].inventory[j].attr_health;
            stats[1] += dawn->players[i].inventory[j].attr_mana;
            stats[2] += dawn->players[i].inventory[j].attr_strength;
            stats[3] += dawn->players[i].inventory[j].attr_intelligence;
            stats[4] += dawn->players[i].inventory[j].attr_mdef;
            stats[5] += dawn->players[i].inventory[j].attr_defense;
        }
    }
    stats[6] = dawn->players[i].alignment;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0xda6c
cmpl $-0x1, %eax
je 0xf27d
movl %eax, %ebp
cltq
leaq 0x1288d(%rip), %r12     # 0x21a80
movq (%r12), %rcx
imulq $0x26a8, %rax, %r15     # imm = 0x26A8
cmpl $0x18, 0x2818(%rcx,%r15)
jg 0xf272
leaq 0x394(%r15), %r13
xorl %r14d, %r14d
movl %ebp, %edi
movl %r14d, %esi
callq 0x7aa0
movq (%r12), %rcx
testl %eax, %eax
je 0xf253
movl (%rcx,%r13), %eax
addl %eax, (%rbx)
movl 0x2c(%rcx,%r13), %eax
addl %eax, 0x4(%rbx)
movl 0xc(%rcx,%r13), %eax
addl %eax, 0x8(%rbx)
movl 0x8(%rcx,%r13), %eax
addl %eax, 0xc(%rbx)
movl 0x10(%rcx,%r13), %eax
addl %eax, 0x10(%rbx)
movl 0x4(%rcx,%r13), %eax
addl %eax, 0x14(%rbx)
incq %r14
movslq 0x2818(%rcx,%r15), %rax
movl $0x19, %edx
subq %rax, %rdx
addq $0x9c, %r13
cmpq %rdx, %r14
jl 0xf213
movl 0x2834(%rcx,%r15), %eax
movl %eax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: init_timers
void init_timers (struct Bot *b, char const * fn) {
    //Times are defined in limits.h and are in seconds
    struct sigaction act;
    memset(&act, '\0', sizeof act);

    act.sa_handler = event_handler; //use simple signal handler
    act.sa_flags = SA_RESTART; //use SA_SIGINFO for more advanced handler

    CALLEXIT(sigaction(SIGALRM, &act, NULL) < 0) //hook SIGALRM to call our message_handler function

    load_events(fn);
    dawn = b;
    add_event(HEALING,         0, HEALING_INTERVAL,         UNIQUE | KEEP);
    add_event(SAVING,          0, SAVING_INTERVAL,          UNIQUE | KEEP);
    add_event(HOURLY,          0, 3600,                     UNIQUE | KEEP);
    add_event(LOTTERY_COLLECT, 0, LOTTERY_COLLECT_INTERVAL, UNIQUE | KEEP);
    add_event(LOTTERY_REWARD,  0, LOTTERY_REWARD_INTERVAL,  UNIQUE | KEEP);
    add_event(BOUNTY_RESET,    0, BOUNTY_RESET_INTERVAL,    UNIQUE | KEEP);
    add_event(BOUNTY_INIT,     0, 15,                       UNIQUE | KEEP);
    printf(INFO "Timers started\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20f0
leaq 0xec(%rip), %rax        # 0xf3a5
movq %rax, -0x8(%r15)
movl $0x10000000, 0x80(%r15) # imm = 0x10000000
leaq 0x8(%rsp), %rsi
movl $0xe, %edi
xorl %edx, %edx
callq 0x2270
testl %eax, %eax
js 0xf3a0
movq %r14, %rdi
callq 0xf5d1
movq %rbx, 0x12790(%rip)     # 0x21a80
xorl %edi, %edi
xorl %esi, %esi
movl $0x708, %edx            # imm = 0x708
movl $0x3, %ecx
callq 0xf887
movl $0x1, %edi
xorl %esi, %esi
movl $0x384, %edx            # imm = 0x384
movl $0x3, %ecx
callq 0xf887
movl $0x2, %edi
xorl %esi, %esi
movl $0xe10, %edx            # imm = 0xE10
movl $0x3, %ecx
callq 0xf887
movl $0x5, %edi
xorl %esi, %esi
movl $0x708, %edx            # imm = 0x708
movl $0x3, %ecx
callq 0xf887
movl $0x6, %edi
xorl %esi, %esi
movl $0xa8c0, %edx           # imm = 0xA8C0
movl $0x3, %ecx
callq 0xf887
movl $0x7, %edi
xorl %esi, %esi
movl $0x15180, %edx          # imm = 0x15180
movl $0x3, %ecx
callq 0xf887
movl $0x8, %edi
xorl %esi, %esi
movl $0xf, %edx
movl $0x3, %ecx
callq 0xf887
leaq 0x9581(%rip), %rdi      # 0x1890f
callq 0x2330
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x2ed7
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: init_event_list
EventList init_event_list() {
    if(eventQ_singleton) //if an instance already exists do not create a new one
        return 0;
    eventQ_singleton++;
    struct event_list * newlist;
    CALLEXIT(!(newlist = calloc(1, sizeof *newlist)))
    return newlist;
}

// Assembly:
pushq %rax
cmpl $0x0, 0x12056(%rip)     # 0x21a88
je 0xfa38
xorl %eax, %eax
jmp 0xfa56
movl $0x1, 0x12046(%rip)     # 0x21a88
movl $0x1, %edi
movl $0x10, %esi
callq 0x2110
testq %rax, %rax
je 0xfa58
popq %rcx
retq
callq 0x2fd3
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: free_event_list
void free_event_list() {
    if(elist == 0)
        return;
    struct event_list * celist = (struct event_list *)elist;

    struct event_node * tmp = celist->head;
    while(tmp != 0) {
        struct event_node * next = tmp->next;
        free(tmp->elem);
        free(tmp);
        tmp = next;
    }
    free(elist);
    eventQ_singleton--;
    elist = 0;
}

// Assembly:
movq 0x1202c(%rip), %rdi     # 0x21a90
testq %rdi, %rdi
je 0xfab5
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0xfa98
movq (%rbx), %r14
movq 0x8(%rbx), %rdi
callq 0x2240
movq %rbx, %rdi
callq 0x2240
movq %r14, %rbx
testq %r14, %r14
jne 0xfa75
movq 0x11ff8(%rip), %rdi     # 0x21a90
callq 0x2240
decl 0x11fe5(%rip)           # 0x21a88
movq $0x0, 0x11fe2(%rip) # 0x21a90
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: update_alarm
void update_alarm() {
    if(elist == 0)
        return;
    struct event_list* celist = (struct event_list *)elist;
    if(celist->head == 0)
        return;

    time_t curtime = time(0);
    time_t event = celist->head->event_time;
    if(event < curtime)
        event_handler(SIGALRM);
    else
        alarm((unsigned int)(event - curtime));
}

// Assembly:
pushq %rbx
movq 0x11fd2(%rip), %rbx     # 0x21a90
testq %rbx, %rbx
je 0xfae7
cmpq $0x0, (%rbx)
je 0xfae7
xorl %edi, %edi
callq 0x21b0
movq (%rbx), %rcx
movq 0x10(%rcx), %rdi
cmpq %rax, %rdi
jge 0xfae9
movl $0xe, %edi
popq %rbx
jmp 0xf3a5
popq %rbx
retq
subl %eax, %edi
popq %rbx
jmp 0x2440
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: remove_event
void remove_event(struct event_node * prev) { //requires the /PREVIOUS/ node or 0 for head
    struct event_list * celist = (struct event_list *)elist;
    if(elist == 0)
        return;
    if(prev == 0) {
        struct event_node * next = celist->head->next;
        free(celist->head->elem);
        free(celist->head);
        celist->head = next;
    } else {
        struct event_node * to_free = prev->next;
        prev->next = prev->next->next;
        free(to_free->elem);
        free(to_free);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x11f8c(%rip), %rbx     # 0x21a90
testq %rbx, %rbx
je 0xfb49
testq %rdi, %rdi
je 0xfb2f
movq (%rdi), %rbx
movq (%rbx), %rax
movq %rax, (%rdi)
movq 0x8(%rbx), %rdi
callq 0x2240
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
movq (%rbx), %rax
movq (%rax), %r14
movq 0x8(%rax), %rdi
callq 0x2240
movq (%rbx), %rdi
callq 0x2240
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: retr_event
struct event * retr_event() { //callee must free the data himself
    if(elist == 0)
        return 0;
    struct event_list * celist = (struct event_list *)elist;
    if(celist->head == 0)
        return 0;

    struct event * ret = celist->head->elem;
    struct event_node * to_free = celist->head;
    celist->head = celist->head->next;
    free(to_free);
    celist->len--;
    update_alarm();
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x11f34(%rip), %r14     # 0x21a90
testq %r14, %r14
je 0xfb83
movq (%r14), %rdi
testq %rdi, %rdi
je 0xfb83
movq (%rdi), %rax
movq 0x8(%rdi), %rbx
movq %rax, (%r14)
callq 0x2240
decq 0x8(%r14)
callq 0xfab6
jmp 0xfb85
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/status.c
// Function: save_events
void save_events(char const * fn) {
    FILE * file;
    size_t len = 0, ret;
    if(!(file = fopen(fn, "wb"))) {
        PRINTWARN("Could not save events")
    } else {
        if(elist == 0) {
            fprintf(stderr, WARN "status/save_events: tried to save but there was no event list\n");
            return;
        }
        struct event_list * celist = elist;
        struct event_node * tmp = celist->head;
        while(tmp != 0) {
            if(!(ret = fwrite(&tmp->event_time, sizeof tmp->event_time, 1, file))) {
                PRINTERR("fwrite")
                fprintf(stderr, ERR "status/save_events: event file corrupted while saving - continuing");
                break;
            }
            len += ret * sizeof tmp->event_time;
            if(!(ret = fwrite(&tmp->elem->event, sizeof tmp->elem->event, 1, file))) {
                PRINTERR("fwrite")
                fprintf(stderr, ERR "status/save_events: event file corrupted while saving - continuing");
                break;
            }
            len += ret * sizeof tmp->elem->event;
            if(!(ret = fwrite(&tmp->elem->data, sizeof tmp->elem->data, 1, file))) {
                PRINTERR("fwrite")
                fprintf(stderr, ERR "status/save_events: event file corrupted while saving - continuing");
                break;
            }
            len += ret * sizeof tmp->elem->data;
            tmp = tmp->next;
        }
        fclose(file);
    }
    printf(INFO "Saved events (%zu bytes)\n", len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5af3(%rip), %rsi      # 0x156e2
callq 0x2230
testq %rax, %rax
je 0xfcc0
movq %rax, %rbx
movq 0x11e89(%rip), %rax     # 0x21a90
testq %rax, %rax
je 0xfcd1
movq (%rax), %r13
xorl %r14d, %r14d
testq %r13, %r13
je 0xfc99
leaq 0x8954(%rip), %r15      # 0x18576
leaq 0x89cf(%rip), %rbp      # 0x185f8
leaq 0x10(%r13), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2480
testq %rax, %rax
je 0xfcf5
leaq (%r14,%rax,8), %r14
movq 0x8(%r13), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2480
testq %rax, %rax
je 0xfce5
movq %rax, %r12
movq 0x8(%r13), %rdi
addq $0x4, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2480
testq %rax, %rax
je 0xfcea
addq %rax, %r12
leaq (%r14,%r12,4), %r14
movq (%r13), %r13
testq %r13, %r13
jne 0xfc29
movq %rbx, %rdi
callq 0x21f0
leaq 0x89a8(%rip), %rdi      # 0x18650
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
leaq 0x8822(%rip), %rdi      # 0x184e9
callq 0x2190
xorl %r14d, %r14d
jmp 0xfca1
callq 0x2fe8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %r15
jmp 0xfcf5
leaq (%r14,%r12,4), %r14
leaq 0x892f(%rip), %r15      # 0x18624
movq %r15, %rdi
callq 0x2190
movq 0xf2d4(%rip), %rax      # 0x1efd8
movq (%rax), %rcx
leaq 0x8894(%rip), %rdi      # 0x185a2
movl $0x55, %esi
movl $0x1, %edx
callq 0x2480
jmp 0xfc99
nop