LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/analyzer.c
// Function: init_analyzer
Analyzer init_analyzer(size_t markov_tier) {
    if(markov_tier == 0)
        return 0;
    struct analyzer * a;
    CALLEXIT(!(a = malloc(sizeof *a)))

    a->tlists = 0;
    a->markov_tier = markov_tier;
    a->tokens = 0;
    a->start = 0;
    return a;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x3208
movq %rdi, %rbx
movl $0x20, %edi
callq 0x22b0
testq %rax, %rax
je 0x320c
movq $0x0, 0x8(%rax)
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
jmp 0x320a
xorl %eax, %eax
popq %rbx
retq
callq 0x24b0
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/analyzer.c
// Function: free_analyzer
void free_analyzer(Analyzer a) {
    if(!a)
        return;
    struct analyzer * ca = a;
    if(ca->tlists) {
        for(size_t i = 0; i < CHAR_LEN; i++) {
            free_token_list(ca->tlists[i]);
        }
    }
    free(ca->tlists);
    free_token_list(ca->start);
    free(ca);
}

// Assembly:
testq %rdi, %rdi
je 0x3261
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3240
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xfa91
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x3227
movq 0x8(%rbx), %rdi
callq 0x2240
movq 0x10(%rbx), %rdi
callq 0xfa91
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
retq
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/analyzer.c
// Function: gen_token
char * gen_token(Analyzer a, char src, int end) {
    if(!a) {
        return 0;
    }

    struct analyzer * ca = a;
    if(!ca->tlists || ca->tokens == 0) {
        return 0;
    }

    if(get_len(ca->tlists[(unsigned char)src]) == 0) {
        return 0;
    }

    double prob = randd();
    TokenIterator it = get_iterator(ca->tlists[(unsigned char)src]);

    while(has_elem(it) && (prob > ((double)(get_num_consumed(it)))/get_num_total(ca->tlists[(unsigned char)src]) || end ? !get_is_end(it) : 0)) {
        next(it);
    }

    if(!has_elem(it) || (end && !get_is_end(it))) {
        free_iterator(it);
        return 0;
    }

    char * res = get_str(it);
    free_iterator(it);

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x35d3
movq %rdi, %r15
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x35d3
cmpq $0x0, 0x18(%r15)
je 0x35d3
movl %edx, %ebx
movzbl %sil, %r13d
movq (%rax,%r13,8), %rdi
callq 0xfc8b
testq %rax, %rax
je 0x35d3
callq 0xfd28
movsd %xmm0, 0x8(%rsp)
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rdi
callq 0xfca5
movq %rax, %r14
movq %rax, %rdi
callq 0xfce3
testl %eax, %eax
je 0x35e6
movq %r14, %rdi
callq 0xfd22
movq %rax, %r12
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rdi
callq 0xfc98
testl %ebx, %ebx
jne 0x35b7
movq %r12, %xmm0
movq 0xda9e(%rip), %xmm2     # 0x11010
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xdaa2(%rip), %xmm3     # 0x11020
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x35e6
movq %r14, %rdi
callq 0xfd1b
testl %eax, %eax
jne 0x35e6
movq %r14, %rdi
callq 0xfcf2
movq %r14, %rdi
jmp 0x353c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0xfce3
testl %eax, %eax
je 0x360f
testl %ebx, %ebx
je 0x3602
movq %r14, %rdi
callq 0xfd1b
testl %eax, %eax
je 0x360f
movq %r14, %rdi
callq 0xfd0c
movq %rax, %rbx
jmp 0x3611
xorl %ebx, %ebx
movq %r14, %rdi
callq 0xfcde
jmp 0x35d5
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/analyzer.c
// Function: gen_start
char * gen_start(Analyzer a) {
    if(!a) {
        return 0;
    }

    struct analyzer * ca = a;
    if(!ca->start || ca->tokens == 0) {
        return 0;
    }

    if(get_len(ca->start) == 0) {
        return 0;
    }

    double prob = randd();
    TokenIterator it = get_iterator(ca->start);

    while(has_elem(it) && (prob > ((double)(get_num_consumed(it)))/get_num_total(ca->start))) {
        next(it);
    }

    if(!has_elem(it)) {
        free_iterator(it);
        return 0;
    }

    char * res = get_str(it);
    free_iterator(it);

    return res;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x3702
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3702
cmpq $0x0, 0x18(%rbx)
je 0x3702
callq 0xfc8b
testq %rax, %rax
je 0x3702
callq 0xfd28
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
callq 0xfca5
movq %rax, %r14
movq %rax, %rdi
callq 0xfce3
testl %eax, %eax
je 0x370f
movq %r14, %rdi
callq 0xfd22
movq %rax, %xmm0
movq 0xd980(%rip), %xmm1     # 0x11010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xd984(%rip), %xmm1     # 0x11020
subpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movq 0x10(%rbx), %rdi
callq 0xfc98
movq %rax, %xmm0
punpckldq 0xd948(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd950(%rip), %xmm0     # 0x11020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd 0x10(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd 0x8(%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x370f
movq %r14, %rdi
callq 0xfcf2
movq %r14, %rdi
jmp 0x366e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0xfce3
testl %eax, %eax
je 0x3728
movq %r14, %rdi
callq 0xfd0c
movq %rax, %rbx
jmp 0x372a
xorl %ebx, %ebx
movq %r14, %rdi
callq 0xfcde
jmp 0x3704
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/analyzer.c
// Function: has_rule_for
int has_rule_for(Analyzer a, char src) {
    if(!a) {
        return 0;
    }

    struct analyzer * ca = a;
    if(!ca->tlists) {
        return 0;
    }
    return get_len(ca->tlists[(unsigned char)src]) != 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x3761
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x3761
pushq %rax
movzbl %sil, %eax
movq (%rcx,%rax,8), %rdi
callq 0xfc8b
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
addq $0x8, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/bounty.c
// Function: gen_global_bounty
void gen_global_bounty (void) {
    char out[MAX_MESSAGE_BUFFER];
    if (dawn->gbounty.amount) return;
    struct Bounty global_bounty;
    dawn->gbounty.name[0] = '\0';
    strcpy(global_bounty.name, dawn->monsters[rand() % MAX_MONSTERS].name);
    global_bounty.amount = 1 + rand() % 25;
    global_bounty.multiplier = 1 + rand() % 5;
    dawn->gbounty = global_bounty;

    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :New bounty! Kill %d %s's, (%dx reward)\r\n",
            dawn->active_room, dawn->gbounty.amount, dawn->gbounty.name, dawn->gbounty.multiplier);
    add_msg(out, strlen(out));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
leaq 0x1e30b(%rip), %r14     # 0x21a80
movq (%r14), %rbx
cmpl $0x0, 0x198(%rbx)
jne 0x387a
movb $0x0, 0x158(%rbx)
callq 0x2080
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
shll $0x3, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
imulq $0x78, %rax, %rax
leaq (%rbx,%rax), %rsi
addq $0xf1b40, %rsi          # imm = 0xF1B40
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x21c0
callq 0x2080
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
leal (%rcx,%rcx,4), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x40(%rbx)
callq 0x2080
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x44(%rbx)
movq (%r14), %rax
leaq 0x158(%rax), %r9
movl $0x12, %ecx
movq %r9, %rdi
movq %rbx, %rsi
rep  movsl (%rsi), %es:(%rdi)
leaq 0x100(%rax), %rcx
movl 0x198(%rax), %r8d
movl 0x19c(%rax), %eax
movl %eax, (%rsp)
leaq 0xd955(%rip), %rdx      # 0x111a8
leaq 0x50(%rsp), %rbx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/bounty.c
// Function: check_bounty
void check_bounty (struct Message *msg) {
    int pindex = get_pindex(msg->sender_nick);
    char out[MAX_MESSAGE_BUFFER];
    if (strcmp(dawn->gbounty.name, dawn->global_monster.name) == 0) {
        dawn->players[pindex].bounty++;
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has taken down one more %s, %d to go until they win the bounty!\r\n",
                dawn->active_room, msg->sender_nick, dawn->gbounty.name, (dawn->gbounty.amount - dawn->players[pindex].bounty));
        add_msg(out, strlen(out));
        if (dawn->players[pindex].bounty == dawn->gbounty.amount) collect_bounty(pindex);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r14
callq 0xd89c
movl %eax, %ebx
leaq 0x1e1d9(%rip), %rax     # 0x21a80
movq (%rax), %r12
leaq 0x158(%r12), %r15
leaq 0xf2e00(%r12), %rsi
movq %r15, %rdi
callq 0x22d0
testl %eax, %eax
jne 0x3951
movslq %ebx, %rax
imulq $0x26a8, %rax, %rbp     # imm = 0x26A8
movl 0x2794(%r12,%rbp), %eax
incl %eax
movl %eax, 0x2794(%r12,%rbp)
movl 0x198(%r12), %ecx
addq $0x100, %r12            # imm = 0x100
subl %eax, %ecx
movl %ecx, (%rsp)
leaq 0xd8dc(%rip), %rdx      # 0x111dd
leaq 0x10(%rsp), %r13
movl $0x190, %esi            # imm = 0x190
movq %r13, %rdi
movq %r12, %rcx
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x2390
movq %r13, %rdi
callq 0x20c0
movq %r13, %rdi
movq %rax, %rsi
callq 0xcd1c
leaq 0x1e148(%rip), %rax     # 0x21a80
movq (%rax), %rax
movl 0x2794(%rax,%rbp), %ecx
cmpl 0x198(%rax), %ecx
jne 0x3951
movl %ebx, %edi
callq 0x3963
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/bounty.c
// Function: collect_bounty
void collect_bounty (int pindex) {
    char out[MAX_MESSAGE_BUFFER];
    int gold_reward = dawn->global_monster.gold * dawn->gbounty.multiplier * dawn->gbounty.amount;
    int exp_reward  = dawn->global_monster.exp  * dawn->gbounty.multiplier * dawn->gbounty.amount;

    dawn->players[pindex].gold += gold_reward;
    dawn->players[pindex].experience  += exp_reward;

    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has completed the bounty: Slay %d %s's! %s has been"
            " rewarded with %d gold and %d experience!\r\n", dawn->active_room, dawn->players[pindex].username,
            dawn->gbounty.amount, dawn->gbounty.name, dawn->players[pindex].username, gold_reward, exp_reward);
    add_msg(out, strlen(out));
    struct Bounty empty;
    empty.name[0] = '\0';
    empty.amount = 0;
    empty.multiplier = 0;
    dawn->gbounty = empty;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
leaq 0x1e10a(%rip), %r14     # 0x21a80
movq (%r14), %r10
movl 0x198(%r10), %r9d
movl 0x19c(%r10), %eax
imull %r9d, %eax
movl 0xf2e58(%r10), %ecx
imull %eax, %ecx
imull 0xf2e5c(%r10), %eax
movslq %ecx, %r11
movslq %edi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
leaq (%r10,%rcx), %r8
addq $0x1a0, %r8             # imm = 0x1A0
addq %r11, 0x2648(%r8)
movslq %eax, %r15
addq %r15, 0x2658(%r8)
leaq 0x100(%r10), %rcx
addq $0x158, %r10            # imm = 0x158
leaq 0xd853(%rip), %rdx      # 0x1122e
movq %rsp, %rbx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r8
pushq %r10
callq 0x2390
addq $0x20, %rsp
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq (%r14), %rax
movb $0x0, 0x158(%rax)
movq $0x0, 0x198(%rax)
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: init_cmd_sys
CmdSys init_cmd_sys() {
    struct cmd_sys * ccs;
    CALLEXIT(!(ccs = calloc(1, sizeof *ccs)))
    ccs->flags = CMD_INITIALIZED;
    return ccs;
}

// Assembly:
pushq %rax
movl $0x1, %edi
movl $0x40, %esi
callq 0x2110
testq %rax, %rax
je 0x3a5e
movq $0x1, 0x38(%rax)
popq %rcx
retq
callq 0x2519
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: free_cmd_sys
void free_cmd_sys(CmdSys cs) {
    struct cmd_sys * ccs = cs ? cs : commands;
    assert(ccs);

    free(ccs->hashes);

    //free allocated character strings
    for(size_t i = 0; i < ccs->len; i++) {
        free(ccs->cmds[i]);
        free(ccs->helptexts[i]);
    }

    free(ccs->cmds);
    free(ccs->helptexts);
    free(ccs->auth_levels);
    free(ccs->fn);

    free(ccs);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x3a76
movq 0x1b802(%rip), %rbx     # 0x1f278
testq %rbx, %rbx
je 0x3ae2
movq 0x10(%rbx), %rdi
callq 0x2240
cmpq $0x0, (%rbx)
je 0x3aaf
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2240
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2240
incq %r14
cmpq (%rbx), %r14
jb 0x3a8d
movq 0x18(%rbx), %rdi
callq 0x2240
movq 0x20(%rbx), %rdi
callq 0x2240
movq 0x28(%rbx), %rdi
callq 0x2240
movq 0x30(%rbx), %rdi
callq 0x2240
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
leaq 0xd7f7(%rip), %rdi      # 0x112e0
leaq 0xd7f4(%rip), %rsi      # 0x112e4
leaq 0xd7fa(%rip), %rcx      # 0x112f1
movl $0x1a, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: trim_arrays
void trim_arrays(CmdSys cs) {
    struct cmd_sys * ccs = cs;
    assert(ccs);
    assert(ccs->len != 0);
    ccs->hashes = realloc(ccs->hashes, ccs->capacity * sizeof *ccs->hashes);
    ccs->cmds = realloc(ccs->cmds, ccs->capacity * sizeof *ccs->cmds);
    ccs->helptexts = realloc(ccs->helptexts, ccs->capacity * sizeof *ccs->helptexts);
    ccs->auth_levels = realloc(ccs->auth_levels, ccs->capacity * sizeof *ccs->auth_levels);
    ccs->fn = realloc(ccs->fn, ccs->capacity * sizeof *ccs->fn);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x3dde
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x3dfd
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
shlq $0x3, %rsi
callq 0x23b0
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdi
shlq $0x3, %rsi
callq 0x23b0
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rsi
movq 0x20(%rbx), %rdi
shlq $0x3, %rsi
callq 0x23b0
movq %rax, 0x20(%rbx)
movq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdi
shlq $0x2, %rsi
callq 0x23b0
movq %rax, 0x28(%rbx)
movq 0x8(%rbx), %rsi
movq 0x30(%rbx), %rdi
shlq $0x3, %rsi
callq 0x23b0
movq %rax, 0x30(%rbx)
popq %rbx
retq
leaq 0xd4fb(%rip), %rdi      # 0x112e0
leaq 0xd4f8(%rip), %rsi      # 0x112e4
leaq 0xdcbd(%rip), %rcx      # 0x11ab0
movl $0xfa, %edx
callq 0x2100
leaq 0xdcc5(%rip), %rdi      # 0x11ac9
leaq 0xd4d9(%rip), %rsi      # 0x112e4
leaq 0xdc9e(%rip), %rcx      # 0x11ab0
movl $0xfb, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: hash_code
uint64_t hash_code(char * str) {
    uint64_t hash = 1;
    uint64_t const prime = 13835058055282163729ull;
    size_t len = strlen(str);
    for(size_t i = 0; i < len; i++) {
        hash += hash * 31 + (unsigned char)(str[i]);
        hash %= prime;
    }
    return hash;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x20c0
movl $0x1, %ecx
testq %rax, %rax
je 0x3e62
xorl %edx, %edx
movabsq $-0x3fffffffffffffef, %rsi # imm = 0xC000000000000011
movq %rcx, %rdi
shlq $0x5, %rdi
subq %rcx, %rdi
movzbl (%rbx,%rdx), %r8d
addq %rcx, %rdi
addq %r8, %rdi
movq %rdi, %rcx
subq %rsi, %rcx
cmovbq %rdi, %rcx
incq %rdx
cmpq %rdx, %rax
jne 0x3e3b
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: finalize_cmd_sys
void finalize_cmd_sys(CmdSys cs) {
    struct cmd_sys * ccs = cs ? cs : commands;
    assert(ccs);

    ccs->capacity = ccs->len;
    trim_arrays(ccs);

    sort_cmd_sys(ccs);
    ccs->flags = CMD_FINALIZED;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x3e77
movq 0x1b401(%rip), %rbx     # 0x1f278
testq %rbx, %rbx
je 0x3e9d
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3d60
movq %rbx, %rdi
callq 0x3ebc
movq $0x4, 0x38(%rbx)
popq %rbx
retq
leaq 0xd43c(%rip), %rdi      # 0x112e0
leaq 0xd439(%rip), %rsi      # 0x112e4
leaq 0xd728(%rip), %rcx      # 0x115da
movl $0x53, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/cmdsys.c
// Function: get_cmd_id
size_t get_cmd_id(CmdSys cs, char * cmd) {
    struct cmd_sys * ccs = cs;
    assert(ccs);
    uint64_t hash = hash_code(cmd);
    size_t min = 0, max = ccs->len-1, mid = (size_t)(-1);
    int valid = 0;

    while(max >= min) {
        if (min == 0) min += 1;
        mid = (min+max)/2;
        if(ccs->hashes[mid] == hash) {
            valid = 1; break;
        } else if(ccs->hashes[mid] > hash) {
            max = mid-1;
        } else {
            min = mid+1;
        }
    }

    if(valid) {
        for(size_t iter = mid; iter < ccs->len && ccs->hashes[iter] == hash; iter++) {
            if(strcmp(cmd, ccs->cmds[iter]) == 0) {
                return iter;
            }
        }
        for(size_t iter = mid; iter < ccs->len && ccs->hashes[iter] == hash; iter--) {
            if(strcmp(cmd, ccs->cmds[iter]) == 0) {
                return iter;
            }
        }
    }
    return (size_t)-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4544
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3e1c
movq %rax, %r15
movq (%r14), %r8
movq 0x10(%r14), %rax
movq %r8, %r13
shrq %r13
movq (%rax,%r13,8), %rdx
cmpq %r15, %rdx
jne 0x4465
xorl %edi, %edi
jmp 0x44a0
leaq -0x1(%r8), %rsi
movl $0x1, %ecx
movq %rsi, %rdi
movq %rcx, %rsi
leaq 0x1(%r13), %rcx
cmpq %r15, %rdx
cmovaq %rsi, %rcx
leaq -0x1(%r13), %rsi
cmovbeq %rdi, %rsi
cmpq %rcx, %rsi
setb %dil
jb 0x44a0
leaq (%rcx,%rsi), %r13
shrq %r13
movq (%rax,%r13,8), %rdx
cmpq %r15, %rdx
jne 0x446e
testb %dil, %dil
jne 0x452b
movq %rbx, (%rsp)
movq %r13, %r12
cmpq %r8, %r13
movq %r8, %rbp
jae 0x44e8
movq 0x10(%r14), %rbx
movq %r13, %r12
cmpq %r15, (%rbx,%r12,8)
jne 0x44e8
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rsi
movq (%rsp), %rdi
callq 0x22d0
testl %eax, %eax
je 0x4532
incq %r12
movq %rbp, %r8
cmpq %r12, %rbp
jne 0x44bf
movq %r8, %r12
movb $0x1, %al
cmpq %r8, %r13
jae 0x451d
movq 0x10(%r14), %rbx
cmpq %r15, (%rbx,%r13,8)
jne 0x4516
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rsi
movq (%rsp), %rdi
callq 0x22d0
testl %eax, %eax
je 0x4522
decq %r13
cmpq %rbp, %r13
jb 0x44f3
movq %r12, %r13
movb $0x1, %al
jmp 0x4524
movq %r12, %r13
jmp 0x4524
xorl %eax, %eax
movq %r13, %r12
testb %al, %al
je 0x4532
movq $-0x1, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd95(%rip), %rdi      # 0x112e0
leaq 0xcd92(%rip), %rsi      # 0x112e4
leaq 0xd535(%rip), %rcx      # 0x11a8e
movl $0xd8, %edx
callq 0x2100
nop
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/combat.c
// Function: monster_attacks
void monster_attacks(struct Message *message, int player_defense, int pindex) {
    int monster_attack = rand() % dawn->global_monster.str;
    char out[MAX_MESSAGE_BUFFER];

    if (monster_attack > 0 && (monster_attack - player_defense) > 0 && dawn->players[pindex].alive) {
        dawn->players[pindex].health -= monster_attack;
        sprintf(out, "PRIVMSG %s :The %s attacks %s viciously for %d damage! (Remaining: %ld)\r\n",
                message->receiver, dawn->global_monster.name, message->sender_nick,
                monster_attack, dawn->players[pindex].health);
        add_msg(out, strlen(out));
        check_alive(message);
    } else {
        if (dawn->global_monster.hp > 0) {
            sprintf(out, "PRIVMSG %s :%s has blocked the %s's attack!\r\n",
                    message->receiver, message->sender_nick, dawn->global_monster.name);
            add_msg(out, strlen(out));
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x2080
leaq 0x1ce51(%rip), %rcx     # 0x21a80
movq (%rcx), %r8
cltd
idivl 0xf2e4c(%r8)
testl %edx, %edx
setle %al
cmpl %r14d, %edx
setle %cl
orb %al, %cl
jne 0x4cd3
movslq %ebp, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
cmpl $0x0, 0x2800(%r8,%rax)
je 0x4cd3
movl %edx, %r9d
leaq (%r8,%rax), %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
movl %edx, %edx
subq %rdx, 0x2650(%rcx)
leaq 0x1a0(%r8), %rcx
leaq 0xc0(%rbx), %rdx
addq $0xf2e00, %r8           # imm = 0xF2E00
movq 0x2650(%rcx,%rax), %rax
movq %rax, (%rsp)
leaq 0xd100(%rip), %rsi      # 0x11da1
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r8, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
callq 0x4564
jmp 0x4d17
cmpl $0x0, 0xf2e40(%r8)
jle 0x4d17
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xc0(%rbx), %rdx
leaq 0xd0f9(%rip), %rsi      # 0x11deb
leaq 0x10(%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 0xcd1c
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_cry
void cmd_cry(int pindex __attribute__((unused)), struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :You break down in tears\r\n", msg->receiver);
    add_msg(out, strlen(out));
    free(out);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x534a
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xe05d(%rip), %rdx      # 0x13373
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
callq 0x267e
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_auth
void cmd_auth(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if(matches_regex(msg->message, CMD_LIT" (\\w+)")) {
        if(auth_key_valid && strcmp(auth_key, regex_group[1]) == 0) {
            auth_key_valid = 0;
            free(auth_key);
            auth_key = 0;
            dawn->players[pindex].auth_level = AL_ROOT;
            dawn->players[pindex].max_auth = AL_ROOT;
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has been verified. (%s)\r\n",
                dawn->active_room,
                dawn->players[pindex].username,
                auth_level_to_str(dawn->players[pindex].auth_level));
            add_msg(out, strlen(out));
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Invalid auth_key!\r\n", dawn->active_room);
            add_msg(out, strlen(out));
        }
    } else if(matches_regex(msg->message, CMD_LIT)) {
        snprintf(out, MAX_MESSAGE_BUFFER, "WHOIS %s\r\n", dawn->players[pindex].username);
        add_msg(out, strlen(out));
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x54b5
movq %rax, %rbx
addq $0x100, %r14            # imm = 0x100
leaq 0xd630(%rip), %rsi      # 0x129af
movq %r14, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x53d2
cmpl $0x0, 0x19eee(%rip)     # 0x1f280
je 0x53ba
leaq 0x19eed(%rip), %r15     # 0x1f288
movq (%r15), %r14
movl $0x190, %esi            # imm = 0x190
addq 0x19c36(%rip), %rsi     # 0x1efe0
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
je 0x543e
leaq 0x1c6bf(%rip), %rax     # 0x21a80
movl $0x100, %ecx            # imm = 0x100
addq (%rax), %rcx
leaq 0xd619(%rip), %rdx      # 0x129e9
jmp 0x540a
leaq 0xd630(%rip), %rsi      # 0x12a09
movq %r14, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x542c
leaq 0x1c694(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rax, %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
leaq 0xd524(%rip), %rdx      # 0x1292e
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
movl $0x0, 0x19e38(%rip)     # 0x1f280
movq %r14, %rdi
callq 0x2240
movq $0x0, (%r15)
leaq 0x1c622(%rip), %rax     # 0x21a80
movq (%rax), %r14
movslq %ebp, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
leaq (%r14,%rax), %r15
addq $0x1a0, %r15            # imm = 0x1A0
movw $0x404, 0x26a0(%r15)    # imm = 0x404
addq $0x100, %r14            # imm = 0x100
movl $0x4, %edi
callq 0xe457
leaq 0xd528(%rip), %rdx      # 0x129c0
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
movq %r15, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x2390
jmp 0x5419
callq 0x2693
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_help
void cmd_help(int pindex, struct Message * msg) {
    extern CmdSys commands;
    struct cmd_sys * ccs = commands;
    assert(ccs);

    if(matches_regex(msg->message, CMD_LIT"\\s*([;\\s]"CMD_MATCH")")) {
        regex_group[1][0] = PREFIX_C;
        invoke_cmd(0, pindex, regex_group[1], msg, CMD_HELP);
    } else {
        char * out;
        CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
        int len = snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :", msg->receiver);
        for(size_t i = 0; i < ccs->len; i++) { //print each command to the string
            if(ccs->auth_levels[i] <= dawn->players[pindex].auth_level) {
                len += snprintf(out+len, (size_t)(MAX_MESSAGE_BUFFER-len), "%s ", ccs->cmds[i]);
            }
        }
        len += snprintf(out+len, (size_t)(MAX_MESSAGE_BUFFER-len), "\r\n");
        add_msg(out, (size_t)(len));
        free(out);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x19dac(%rip), %rax     # 0x1f278
movq (%rax), %r15
testq %r15, %r15
je 0x5607
movq %rsi, %r14
movl %edi, %ebp
leaq 0x100(%rsi), %rdi
leaq 0xd384(%rip), %rsi      # 0x1286f
callq 0xd1ba
testl %eax, %eax
je 0x5529
leaq 0x1ade5(%rip), %rdx     # 0x202e0
movb $0x3b, 0x190(%rdx)
addq $0x190, %rdx            # imm = 0x190
xorl %edi, %edi
movl %ebp, %esi
movq %r14, %rcx
movl $0x1, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4259
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5626
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd389(%rip), %rdx      # 0x128d6
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
cmpq $0x0, (%r15)
je 0x55c1
movslq %ebp, %rcx
leaq 0x1c511(%rip), %r12     # 0x21a80
imulq $0x26a8, %rcx, %r13     # imm = 0x26A8
xorl %ebp, %ebp
movq 0x28(%r15), %rcx
movq (%r12), %rdx
movzbl 0x2840(%rdx,%r13), %edx
cmpl %edx, (%rcx,%rbp,4)
jg 0x55b9
movslq %eax, %r14
leaq (%rbx,%r14), %rdi
movl $0x190, %eax            # imm = 0x190
subl %r14d, %eax
movslq %eax, %rsi
movq 0x18(%r15), %rax
movq (%rax,%rbp,8), %rcx
leaq 0xec22(%rip), %rdx      # 0x141d1
xorl %eax, %eax
callq 0x2390
addl %r14d, %eax
incq %rbp
cmpq (%r15), %rbp
jb 0x5578
movslq %eax, %r14
movq %rbx, %rdi
addq %r14, %rdi
movl $0x190, %eax            # imm = 0x190
subl %r14d, %eax
movslq %eax, %rsi
leaq 0xe6a2(%rip), %rdx      # 0x13c7e
xorl %eax, %eax
callq 0x2390
addl %r14d, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
leaq 0xbcd2(%rip), %rdi      # 0x112e0
leaq 0xd226(%rip), %rsi      # 0x1283b
leaq 0xd22e(%rip), %rcx      # 0x1284a
movl $0x55, %edx
callq 0x2100
callq 0x26a8
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_new
void cmd_new(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if(pindex == -1) {
        init_new_character(msg);
        snprintf(out, MAX_MESSAGE_BUFFER, "WHOIS %s\r\n", msg->sender_nick);
        add_msg(out, strlen(out));
    } else {
        sprintf(out, "PRIVMSG %s :You already have an account!\r\n", dawn->active_room);
        add_msg(out, strlen(out));
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x56ad
movq %rax, %rbx
cmpl $-0x1, %ebp
je 0x566d
leaq 0x1c42e(%rip), %rax     # 0x21a80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xd2d8(%rip), %rsi      # 0x12939
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x568e
movq %r14, %rdi
callq 0xd958
leaq 0xd2b2(%rip), %rdx      # 0x1292e
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26bd
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_ap
void cmd_ap(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you have %d attribute points which you can assign\r\n",
            msg->receiver, msg->sender_nick, dawn->players[pindex].attr_pts);
    add_msg(out, strlen(out));
    free(out);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5728
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1c3a5(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x2838(%rax,%rdx), %r9d
leaq 0xdabb(%rip), %rdx      # 0x131b2
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26d2
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_assign
void cmd_assign(int pindex, struct Message * msg) {
    if (matches_regex(msg->message, CMD_LIT" (\\w+) (\\d+)")) {
        assign_attr_points(msg, to_lower(regex_group[1]), atoi(regex_group[2]));
    } else {
        char * out;
        CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :To assign your attribute points, use \";assign <type> <amount>\"; type can be "
                "str, def, int or mdef. You have %d attribute points left which you can assign\r\n",
                msg->receiver, dawn->players[pindex].attr_pts);
        add_msg(out, strlen(out));
        free(out);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x100(%rsi), %rdi
leaq 0xd49c(%rip), %rsi      # 0x12be3
callq 0xd1ba
testl %eax, %eax
je 0x578c
leaq 0x1ab89(%rip), %r14     # 0x202e0
leaq 0x190(%r14), %rdi
callq 0xd008
movq %rax, %r15
addq $0x320, %r14            # imm = 0x320
movq %r14, %rdi
callq 0x2360
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe202
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x57ff
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1c2d4(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movl 0x2838(%rax,%rcx), %r8d
leaq 0xd8f7(%rip), %rdx      # 0x130bf
movl $0x190, %esi            # imm = 0x190
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2390
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x26e7
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_cheese
void cmd_cheese(int pindex, struct Message *msg) {
    char *out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))

    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you currently have %d wedges of cheese\r\n", 
            msg->receiver, msg->sender_nick, dawn->players[pindex].cheese);
    add_msg(out, strlen(out));
    free(out);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5884
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1c249(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x283c(%rax,%rdx), %r9d
leaq 0xda9c(%rip), %rdx      # 0x132ef
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26fc
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_drop
void cmd_drop(int pindex __attribute__((unused)), struct Message * msg) {
    if (matches_regex(msg->message, CMD_LIT" (\\d+)")) {
        int slot = atoi(regex_group[1]);
        drop_item(msg, slot);
    } else if (matches_regex(msg->message, CMD_LIT" (\\w+)")) {
        if (strcmp(regex_group[1], "common") == 0) {
            puts("common match");
            int flag = 1;
            int pindex = get_pindex(msg->sender_nick);
            while (flag == 1) {
                puts("in while");
                flag = 0;
                for (int i=0; i<MAX_INVENTORY_SLOTS; i++) {
                    if (dawn->players[pindex].inventory[i].rarity == 1) {
                        flag = 1;
                        drop_item(msg, i);
                        puts("dropped\n");
                        puts("breaking");
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x100(%rsi), %r14
leaq 0xd033(%rip), %rsi      # 0x12c5e
movq %r14, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x5c60
movl $0x190, %edi            # imm = 0x190
addq 0x1939d(%rip), %rdi     # 0x1efe0
callq 0x2360
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8752
leaq 0xcd48(%rip), %rsi      # 0x129af
movq %r14, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x5d29
leaq 0x1a662(%rip), %rax     # 0x202e0
movl $0x6d6d6f63, %ecx       # imm = 0x6D6D6F63
xorl 0x190(%rax), %ecx
movl $0x6e6f6d, %edx         # imm = 0x6E6F6D
xorl 0x193(%rax), %edx
orl %ecx, %edx
jne 0x5d29
leaq 0xcfd3(%rip), %rdi      # 0x12c76
callq 0x2330
movq %rbx, %rdi
callq 0xd89c
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
movq %rax, (%rsp)
leaq 0x1bdbc(%rip), %r14     # 0x21a80
leaq 0xcfc1(%rip), %r15      # 0x12c8c
leaq 0xcfc3(%rip), %r12      # 0x12c95
leaq 0xcfaa(%rip), %rdi      # 0x12c83
callq 0x2330
xorl %r13d, %r13d
movq (%rsp), %rbp
xorl %eax, %eax
movq (%r14), %rcx
cmpl $0x1, 0x3c4(%rcx,%rbp)
jne 0x5d14
movq %rbx, %rdi
movl %r13d, %esi
callq 0x8752
movq %r15, %rdi
callq 0x2330
movq %r12, %rdi
callq 0x2330
movl $0x1, %eax
incq %r13
addq $0x9c, %rbp
cmpq $0x19, %r13
jne 0x5ce7
cmpl $0x1, %eax
je 0x5cd2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_eat
void cmd_eat (int pindex, struct Message *msg) {
    char *out;
    CALLEXIT(!(out=malloc(MAX_MESSAGE_BUFFER)))

    if (matches_regex(msg->message, CMD_LIT " cheese")) {
        if (dawn->players[pindex].cheese > 0) {
            if (dawn->players[pindex].fullness + 10 > 100) {
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s decides it would be a good idea not to have anymore cheese.\r\n", msg->receiver, msg->sender_nick);
                add_msg(out, strlen(out));
                return;
            }
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s eats a large wedge of cheese. Mmm, cheese. Fullness +10!\r\n", msg->receiver, msg->sender_nick);
            dawn->players[pindex].fullness += 10;
            dawn->players[pindex].cheese -= 1;
            if (dawn->players[pindex].fullness > 100)
                dawn->players[pindex].fullness = 100;
            add_msg(out, strlen(out));
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you have no cheese left :(\r\n", msg->receiver, msg->sender_nick);
            add_msg(out, strlen(out));
        }
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5e77
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xd959(%rip), %rsi      # 0x136c2
callq 0xd1ba
testl %eax, %eax
je 0x5e67
leaq 0x1bd03(%rip), %r12     # 0x21a80
movq (%r12), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %r15     # imm = 0x26A8
cmpl $0x0, 0x283c(%rax,%r15)
jle 0x5de4
addq %r15, %rax
addq $0x1a0, %rax            # imm = 0x1A0
leaq 0xc0(%r14), %rcx
cmpw $0x5b, 0x26a2(%rax)
jl 0x5e06
leaq 0xd91d(%rip), %rdx      # 0x136d4
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xcd1c
leaq 0xc0(%r14), %rcx
leaq 0xd979(%rip), %rdx      # 0x1376b
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
jmp 0x5e54
leaq 0xd914(%rip), %rdx      # 0x13721
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq (%r12), %rax
movzwl 0x2842(%rax,%r15), %ecx
addl $0xa, %ecx
movw %cx, 0x2842(%rax,%r15)
decl 0x283c(%rax,%r15)
cmpw $0x65, %cx
jl 0x5e54
addq %r15, %rax
addq $0x2842, %rax           # imm = 0x2842
movw $0x64, (%rax)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x273b
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_ghunt
void cmd_ghunt (int pindex __attribute__((unused)), struct Message * msg) {
    if (dawn->global_monster.active) {
        char *out;
        CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :You must either kill the "
                "monster or use ;gslay!\r\n", msg->receiver);
        add_msg(out, strlen(out));
        free(out);
    } else {
        call_monster(msg->sender_nick, 1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x1bb9b(%rip), %rax     # 0x21a80
movq (%rax), %rax
cmpl $0x0, 0xf2e64(%rax)
je 0x5f45
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5f59
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd58a(%rip), %rdx      # 0x1349b
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
movq %r14, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xba54
callq 0x2750
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_give
void cmd_give(int pindex, struct Message * msg) {
    char *out, *endptr;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if (matches_regex(msg->message, CMD_LIT" (\\w+)\\s(\\d+)")) {
        int tindex = get_pindex(regex_group[1]);
        if (tindex != -1) {
            long amount = strtol(regex_group[2], &endptr, 10);
            if (amount <= dawn->players[pindex].gold) {
                dawn->players[pindex].gold -= amount;
                dawn->players[tindex].gold += amount;
                sprintf(out, "PRIVMSG %s :%s has sent %s %ld gold!\r\n",
                        dawn->active_room, msg->sender_nick, regex_group[1], amount);
            } else {
                sprintf(out, "PRIVMSG %s :%s, you don't have that much gold\r\n", dawn->active_room, msg->sender_nick);
            }
        } else {
            sprintf(out, "PRIVMSG %s :Invalid user\r\n", dawn->active_room);
        }
        add_msg(out, strlen(out));
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x60a3
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xcef5(%rip), %rsi      # 0x12e83
callq 0xd1ba
testl %eax, %eax
je 0x6091
movl $0x190, %edi            # imm = 0x190
addq 0x19039(%rip), %rdi     # 0x1efe0
callq 0xd89c
cmpl $-0x1, %eax
je 0x600b
movl %eax, %r15d
movl $0x320, %edi            # imm = 0x320
addq 0x19020(%rip), %rdi     # 0x1efe0
movq %rsp, %rsi
movl $0xa, %edx
callq 0x22e0
leaq 0x1baac(%rip), %rcx     # 0x21a80
movq (%rcx), %rdx
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movq 0x27e8(%rdx,%rcx), %rsi
subq %rax, %rsi
jge 0x602d
addq $0x100, %rdx            # imm = 0x100
leaq 0xcec6(%rip), %rsi      # 0x12ec2
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2050
jmp 0x607e
leaq 0x1ba6e(%rip), %rax     # 0x21a80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xcbf1(%rip), %rsi      # 0x12c12
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x607e
leaq 0x1a0(%rdx), %rdi
addq %rdx, %rcx
addq $0x27e8, %rcx           # imm = 0x27E8
movq %rsi, (%rcx)
movslq %r15d, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rax, 0x2648(%rdi,%rcx)
addq $0x100, %rdx            # imm = 0x100
movl $0x190, %r8d            # imm = 0x190
addq 0x18f79(%rip), %r8      # 0x1efe0
leaq 0xce2d(%rip), %rsi      # 0x12e9b
movq %rbx, %rdi
movq %r14, %rcx
movq %rax, %r9
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x2765
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_gslay
void cmd_gslay(int pindex __attribute__((unused)), struct Message * msg) {
    if(matches_regex(msg->message, CMD_LIT" (\\d+)")) {
        slay_monster(msg->sender_nick, 1, atoi(regex_group[1]));
    } else {
        char * out;
        CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :The %s will cost %d more gold to slay. Contribute to hiring a warrior "
                "with ;gslay <amount>\r\n", msg->receiver, dawn->global_monster.name,
                dawn->global_monster.slay_cost);
        add_msg(out, strlen(out));
        free(out);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x100(%rsi), %rdi
leaq 0xcb94(%rip), %rsi      # 0x12c5e
callq 0xd1ba
movl $0x190, %edi            # imm = 0x190
testl %eax, %eax
je 0x60fa
addq 0x18f01(%rip), %rdi     # 0x1efe0
callq 0x2360
movq %rbx, %rdi
movl $0x1, %esi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc1e8
callq 0x22b0
testq %rax, %rax
je 0x6161
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1b96b(%rip), %rax     # 0x21a80
movq (%rax), %r8
movl 0xf2e68(%r8), %r9d
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xcede(%rip), %rdx      # 0x1300b
movl $0x190, %esi            # imm = 0x190
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2390
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
callq 0x277a
// File: /workspace/github_c_makefile_star2_O1/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_inv
void cmd_inv (int pindex, struct Message * msg) {
    char *out, action[12];
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))

    if (matches_regex(msg->message, CMD_LIT" fav (\\d+)")) {
        is_favorite(pindex, atoi(regex_group[1])) ? strcpy(action, "unfavorited") : strcpy(action, "favorited");
        favorite_toggle(pindex, atoi(regex_group[1]));
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you have %s %s\r\n",
                dawn->active_room, msg->sender_nick, action, dawn->players[pindex].inventory[atoi(regex_group[1])].name);
        add_msg(out, strlen(out));
        free(out);
    } else {
        print_inventory(msg);
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x6311
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xd20f(%rip), %rsi      # 0x1340e
callq 0xd1ba
testl %eax, %eax
je 0x623f
movl $0x190, %edi            # imm = 0x190
addq 0x18dcc(%rip), %rdi     # 0x1efe0
callq 0x2360
movl %ebp, %edi
movl %eax, %esi
callq 0x7b05
testl %eax, %eax
je 0x624c
movabsq $0x69726f7661666e75, %rax # imm = 0x69726F7661666E75
movq %rax, 0x8(%rsp)
movl $0x646574, 0x10(%rsp)   # imm = 0x646574
jmp 0x6262
movq %r14, %rdi
callq 0x7b5a
jmp 0x62fa
movabsq $0x657469726f766166, %rax # imm = 0x657469726F766166
movq %rax, 0x8(%rsp)
movw $0x64, 0x10(%rsp)
movl $0x190, %eax            # imm = 0x190
leaq 0x1a072(%rip), %r15     # 0x202e0
addq %rax, %r15
movq %r15, %rdi
callq 0x2360
movl %ebp, %edi
movl %eax, %esi
callq 0x7ade
leaq 0x1b7f7(%rip), %rax     # 0x21a80
movq (%rax), %rax
leaq 0x100(%rax), %r12
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %r13     # imm = 0x26A8
addq %rax, %r13
movq %r15, %rdi
callq 0x2360
cltq
imulq $0x9c, %rax, %rax
addq %r13, %rax
addq $0x330, %rax            # imm = 0x330
movq %rax, (%rsp)
leaq 0xd16a(%rip), %rdx      # 0x1342f
leaq 0x8(%rsp), %r9
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r12, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
callq 0x2240
movq %rbx, %rdi
callq 0x2240
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x278f