LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Gaurang18[P]Compiler-Project-BITS-Pilani/./codegen.c
// Function: declarevariables
void declarevariables(parsetree head, FILE* fp)
{
    int i;
    char datasection[] = "section .data\n\tnumberin_form:\tdb \"%d\",0\n\n\tnumberout_form:\tdb \"%d\",10,0\n";
    fprintf(fp, "%s", datasection);
    fprintf(fp,"section .bss\n");
   
    char* functionname = "driver";
    int j = get_func_hash_value(functionname);
    for(i=0;i<SIZE;i++){
        pNode* it  = ht->functable[j]->table[i]->next;
        if(it !=NULL && strcmp(it->name,"")!= 0){
        	char* yp = "ARRAY";
        	if(strncmp(it->type,yp,5)!=0)
            fprintf(fp,"\t%s:\t resd %d\n",it->name,1);
        	else{

        		char* type = it->type;
        		char *token = NULL;
            		token = strtok(it->type, "(");
            		if(token!=NULL){
                		token = strtok(NULL, ",");
                		token = strtok(NULL, ")");
                		if(token!=NULL)
                		strcpy(type, token);
            			}

            	int range = atoi(type);
            	fprintf(fp,"\t%s:\t resd %d\n",it->name,range);


        	}
        }


    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4118(%rip), %rdi      # 0xabb0
callq 0x20e0
leaq 0x35ac(%rip), %rdi      # 0xa050
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21d0
leaq 0x27ca(%rip), %rdi      # 0x9287
callq 0x47cd
movslq %eax, %r14
xorl %r12d, %r12d
movq 0x193f9(%rip), %rax     # 0x1fec8
movq (%rax,%r14,8), %rax
movq (%rax,%r12,8), %rax
movq 0x50(%rax), %r13
testq %r13, %r13
je 0x6b6a
cmpb $0x0, (%r13)
je 0x6b6a
leaq 0x37(%r13), %r15
movl $0x5, %edx
movq %r15, %rdi
leaq 0x2809(%rip), %rsi      # 0x9307
callq 0x2050
movl $0x1, %ecx
testl %eax, %eax
jne 0x6b56
movq %r15, %rdi
leaq 0x28b7(%rip), %rsi      # 0x93cd
callq 0x2180
testq %rax, %rax
je 0x6b4c
xorl %edi, %edi
leaq 0x2898(%rip), %rsi      # 0x93c1
callq 0x2180
xorl %edi, %edi
leaq 0x3607(%rip), %rsi      # 0xa13e
callq 0x2180
testq %rax, %rax
je 0x6b4c
movq %r15, %rdi
movq %rax, %rsi
callq 0x2060
movq %r15, %rdi
callq 0x2190
movl %eax, %ecx
movq %rbx, %rdi
leaq 0x34fe(%rip), %rsi      # 0xa05e
movq %r13, %rdx
xorl %eax, %eax
callq 0x2130
incq %r12
cmpq $0x14, %r12
jne 0x6ac8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Gaurang18[P]Compiler-Project-BITS-Pilani/./codegen.c
// Function: codegen
void codegen(parsetree head, FILE* fp){
    /*parseTree mf = ast->child->right;
    parseTree typedefinitions = mf->child->child;
    parseTree decl = typedefinitions->right;*/
    //print("\nsection .data\n");
    declarevariables(head, fp);
    fprintf(fp,"\nsection .text\n");
    fprintf(fp,"global main\n");
    fprintf(fp,"extern scanf\n");
    fprintf(fp,"extern printf\n");
    fprintf(fp,"\nmain :\n");
    //handle_stmt(decl->right->child, output, ht);
    //fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x6a80
leaq 0x34d2(%rip), %rdi      # 0xa06d
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21d0
leaq 0x34c9(%rip), %rdi      # 0xa07d
movl $0xc, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21d0
leaq 0x34bd(%rip), %rdi      # 0xa08a
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21d0
leaq 0x34b2(%rip), %rdi      # 0xa098
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21d0
leaq 0x34a8(%rip), %rdi      # 0xa0a7
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O3/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 0x3246
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3247
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xfd40
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x3227
movq 0x8(%rbx), %rdi
jmp 0x3249
retq
xorl %edi, %edi
callq 0x2240
movq 0x10(%rbx), %rdi
callq 0xfd40
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x35bc
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x35bc
cmpq $0x0, 0x18(%r14)
je 0x35bc
movl %edx, %ebp
movzbl %sil, %r12d
movq (%rax,%r12,8), %rdi
callq 0xff4b
testq %rax, %rax
je 0x35bc
callq 0xffe8
movsd %xmm0, 0x8(%rsp)
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0xff65
movq %rax, %rbx
movq %rax, %rdi
callq 0xffa3
testl %eax, %eax
je 0x35cf
movq %rbx, %rdi
callq 0xffe2
movq %rax, %r15
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0xff58
testl %ebp, %ebp
jne 0x35a0
movq %r15, %xmm0
movq 0xdab5(%rip), %xmm2     # 0x11010
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xdab9(%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 0x35e9
movq %rbx, %rdi
callq 0xffdb
testl %eax, %eax
jne 0x35cf
movq %rbx, %rdi
callq 0xffb2
movq %rbx, %rdi
jmp 0x3525
xorl %r14d, %r14d
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xffa3
testl %eax, %eax
je 0x3602
testl %ebp, %ebp
je 0x35f5
movq %rbx, %rdi
callq 0xffdb
jmp 0x35f1
movq %rbx, %rdi
callq 0xffa3
testl %eax, %eax
je 0x3602
movq %rbx, %rdi
callq 0xffcc
movq %rax, %r14
jmp 0x3605
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0xff9e
jmp 0x35bf
// File: /workspace/github_c_makefile_star2_O3/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 0x36f6
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x36f6
cmpq $0x0, 0x18(%rbx)
je 0x36f6
callq 0xff4b
testq %rax, %rax
je 0x36f6
callq 0xffe8
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
callq 0xff65
movq %rax, %r14
movq %rax, %rdi
callq 0xffa3
testl %eax, %eax
je 0x3703
movq %r14, %rdi
callq 0xffe2
movq %rax, %xmm0
movq 0xd98c(%rip), %xmm1     # 0x11010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xd990(%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 0xff58
movq %rax, %xmm0
punpckldq 0xd954(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd95c(%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 0x3703
movq %r14, %rdi
callq 0xffb2
movq %r14, %rdi
jmp 0x3662
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0xffa3
testl %eax, %eax
je 0x371c
movq %r14, %rdi
callq 0xffcc
movq %rax, %rbx
jmp 0x371e
xorl %ebx, %ebx
movq %r14, %rdi
callq 0xff9e
jmp 0x36f8
// File: /workspace/github_c_makefile_star2_O3/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 0x3755
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x3755
pushq %rax
movzbl %sil, %eax
movq (%rcx,%rax,8), %rdi
callq 0xff4b
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
addq $0x8, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x1e317(%rip), %r14     # 0x21a80
movq (%r14), %rbx
cmpl $0x0, 0x198(%rbx)
jne 0x386e
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 0xd961(%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 0xcefe
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xda6c
movl %eax, %ebx
leaq 0x1e1e5(%rip), %rax     # 0x21a80
movq (%rax), %r12
leaq 0x158(%r12), %r15
leaq 0xf2e00(%r12), %rsi
movq %r15, %rdi
callq 0x22d0
testl %eax, %eax
jne 0x3945
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 0xd8e8(%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 0xcefe
leaq 0x1e154(%rip), %rax     # 0x21a80
movq (%rax), %rax
movl 0x2794(%rax,%rbp), %ecx
cmpl 0x198(%rax), %ecx
jne 0x3945
movl %ebx, %edi
callq 0x3957
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1e116(%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 0xd85f(%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 0xcefe
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_O3/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 0x3a52
movq $0x1, 0x38(%rax)
popq %rcx
retq
callq 0x2519
// File: /workspace/github_c_makefile_star2_O3/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 0x3a6a
movq 0x1b80e(%rip), %rbx     # 0x1f278
testq %rbx, %rbx
je 0x3ad6
movq 0x10(%rbx), %rdi
callq 0x2240
cmpq $0x0, (%rbx)
je 0x3aa3
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 0x3a81
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 0xd837(%rip), %rdi      # 0x11314
leaq 0xd834(%rip), %rsi      # 0x11318
leaq 0xd83a(%rip), %rcx      # 0x11325
movl $0x1a, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O3/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 0x3df4
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x3e13
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 0xd519(%rip), %rdi      # 0x11314
leaq 0xd516(%rip), %rsi      # 0x11318
leaq 0xdcdb(%rip), %rcx      # 0x11ae4
movl $0xfa, %edx
callq 0x2100
leaq 0xdce3(%rip), %rdi      # 0x11afd
leaq 0xd4f7(%rip), %rsi      # 0x11318
leaq 0xdcbc(%rip), %rcx      # 0x11ae4
movl $0xfb, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O3/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 0x3e78
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 0x3e51
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3e8d
movq 0x1b3eb(%rip), %rbx     # 0x1f278
testq %rbx, %rbx
je 0x3eb3
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3d76
movq %rbx, %rdi
callq 0x3ed2
movq $0x4, 0x38(%rbx)
popq %rbx
retq
leaq 0xd45a(%rip), %rdi      # 0x11314
leaq 0xd457(%rip), %rsi      # 0x11318
leaq 0xd746(%rip), %rcx      # 0x1160e
movl $0x53, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O3/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 0x459b
movq %rsi, %r13
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3e32
movq %rax, %r15
movq (%r14), %rax
movq 0x10(%r14), %rbp
movq %rax, (%rsp)
decq %rax
xorl %ecx, %ecx
cmpq $0x1, %rcx
adcq $0x0, %rcx
leaq (%rcx,%rax), %r12
shrq %r12
movq (%rbp,%r12,8), %rdx
cmpq %r15, %rdx
je 0x4528
leaq -0x1(%r12), %rsi
incq %r12
cmpq %r15, %rdx
cmovbeq %r12, %rcx
cmovaq %rsi, %rax
cmpq %rcx, %rax
jae 0x44ee
movq $-0x1, %rax
jmp 0x458c
movq $-0x1, %rax
cmpq (%rsp), %r12
jae 0x458c
movq %r12, %rbx
cmpq %r15, (%rbp,%rbx,8)
jne 0x457c
movq 0x18(%r14), %rax
movq (%rax,%rbx,8), %rsi
movq %r13, %rdi
callq 0x22d0
testl %eax, %eax
je 0x4584
incq %rbx
cmpq %rbx, (%rsp)
jne 0x4538
jmp 0x457c
cmpq %r15, (%rbp,%r12,8)
jne 0x451f
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
callq 0x22d0
testl %eax, %eax
je 0x4589
decq %r12
cmpq (%rsp), %r12
jb 0x455e
jmp 0x451f
movq %rbx, %rax
jmp 0x458c
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd72(%rip), %rdi      # 0x11314
leaq 0xcd6f(%rip), %rsi      # 0x11318
leaq 0xd512(%rip), %rcx      # 0x11ac2
movl $0xd8, %edx
callq 0x2100
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x1cdef(%rip), %rcx     # 0x21a80
movq (%rcx), %r8
cltd
idivl 0xf2e4c(%r8)
testl %edx, %edx
setle %al
cmpl %r14d, %edx
setle %cl
orb %al, %cl
jne 0x4d2a
movslq %ebp, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
cmpl $0x0, 0x2800(%r8,%rax)
je 0x4d2a
movl %edx, %r9d
addq %r8, %rax
addq $0x1a0, %rax            # imm = 0x1A0
movl %edx, %ecx
movq 0x2650(%rax), %rsi
subq %rcx, %rsi
movq %rsi, 0x2650(%rax)
leaq 0xc0(%rbx), %rdx
addq $0xf2e00, %r8           # imm = 0xF2E00
movq %rsi, (%rsp)
leaq 0xd0e1(%rip), %rsi      # 0x11dd9
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 0xcefe
movq %rbx, %rdi
callq 0x45bc
jmp 0x4d6e
cmpl $0x0, 0xf2e40(%r8)
jle 0x4d6e
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xc0(%rbx), %rdx
leaq 0xd0da(%rip), %rsi      # 0x11e23
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 0xcefe
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x53a2
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xe03d(%rip), %rdx      # 0x133ab
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 0xcefe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
callq 0x267e
// File: /workspace/github_c_makefile_star2_O3/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 0x550d
movq %rax, %rbx
addq $0x100, %r14            # imm = 0x100
leaq 0xd610(%rip), %rsi      # 0x129e7
movq %r14, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x542a
cmpl $0x0, 0x19e96(%rip)     # 0x1f280
je 0x5412
leaq 0x19e95(%rip), %r15     # 0x1f288
movq (%r15), %r14
movl $0x190, %esi            # imm = 0x190
addq 0x19bde(%rip), %rsi     # 0x1efe0
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
je 0x5496
leaq 0x1c667(%rip), %rax     # 0x21a80
movl $0x100, %ecx            # imm = 0x100
addq (%rax), %rcx
leaq 0xd5f9(%rip), %rdx      # 0x12a21
jmp 0x5462
leaq 0xd610(%rip), %rsi      # 0x12a41
movq %r14, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x5484
leaq 0x1c63c(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rax, %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
leaq 0xd504(%rip), %rdx      # 0x12966
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 0xcefe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
movl $0x0, 0x19de0(%rip)     # 0x1f280
movq %r14, %rdi
callq 0x2240
movq $0x0, (%r15)
leaq 0x1c5ca(%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 0xe737
leaq 0xd508(%rip), %rdx      # 0x129f8
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
movq %r15, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x2390
jmp 0x5471
callq 0x2693
// File: /workspace/github_c_makefile_star2_O3/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 0x19d54(%rip), %rax     # 0x1f278
movq (%rax), %r15
testq %r15, %r15
je 0x5670
movq %rsi, %r14
movl %edi, %ebp
leaq 0x100(%rsi), %rdi
leaq 0xd364(%rip), %rsi      # 0x128a7
callq 0xd3aa
testl %eax, %eax
je 0x5581
leaq 0x1ad8d(%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 0x42ec
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x568f
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd369(%rip), %rdx      # 0x1290e
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movq (%r15), %rcx
testq %rcx, %rcx
je 0x562a
movslq %ebp, %rsi
leaq 0x1c4b7(%rip), %rdx     # 0x21a80
movq (%rdx), %rdx
imulq $0x26a8, %rsi, %r13     # imm = 0x26A8
leaq 0xec2f(%rip), %r14      # 0x14209
xorl %ebp, %ebp
movq 0x28(%r15), %rsi
movzbl 0x2840(%rdx,%r13), %edi
cmpl %edi, (%rsi,%rbp,4)
jg 0x5622
movslq %eax, %r12
leaq (%rbx,%r12), %rdi
movl $0x190, %eax            # imm = 0x190
subl %r12d, %eax
movslq %eax, %rsi
movq 0x18(%r15), %rax
movq (%rax,%rbp,8), %rcx
movq %r14, %rdx
xorl %eax, %eax
callq 0x2390
addl %r12d, %eax
leaq 0x1c464(%rip), %rcx     # 0x21a80
movq (%rcx), %rdx
movq (%r15), %rcx
incq %rbp
cmpq %rcx, %rbp
jb 0x55dc
movslq %eax, %r14
movq %rbx, %rdi
addq %r14, %rdi
movl $0x190, %eax            # imm = 0x190
subl %r14d, %eax
movslq %eax, %rsi
leaq 0xe671(%rip), %rdx      # 0x13cb6
xorl %eax, %eax
callq 0x2390
addl %r14d, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xcefe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
leaq 0xbc9d(%rip), %rdi      # 0x11314
leaq 0xd1f5(%rip), %rsi      # 0x12873
leaq 0xd1fd(%rip), %rcx      # 0x12882
movl $0x55, %edx
callq 0x2100
callq 0x26a8
// File: /workspace/github_c_makefile_star2_O3/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 0x5716
movq %rax, %rbx
cmpl $-0x1, %ebp
je 0x56d6
leaq 0x1c3c5(%rip), %rax     # 0x21a80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xd2a7(%rip), %rsi      # 0x12971
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x56f7
movq %r14, %rdi
callq 0xdb28
leaq 0xd281(%rip), %rdx      # 0x12966
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 0xcefe
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26bd
// File: /workspace/github_c_makefile_star2_O3/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 0x5791
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1c33c(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x2838(%rax,%rdx), %r9d
leaq 0xda8a(%rip), %rdx      # 0x131ea
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 0xcefe
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26d2
// File: /workspace/github_c_makefile_star2_O3/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 0xd46b(%rip), %rsi      # 0x12c1b
callq 0xd3aa
testl %eax, %eax
je 0x57f5
leaq 0x1ab20(%rip), %r14     # 0x202e0
leaq 0x190(%r14), %rdi
callq 0xd1f8
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 0xe4e1
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5868
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1c26b(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movl 0x2838(%rax,%rcx), %r8d
leaq 0xd8c6(%rip), %rdx      # 0x130f7
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 0xcefe
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x26e7
// File: /workspace/github_c_makefile_star2_O3/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 0x58ed
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1c1e0(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x283c(%rax,%rdx), %r9d
leaq 0xda6b(%rip), %rdx      # 0x13327
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 0xcefe
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
callq 0x26fc
// File: /workspace/github_c_makefile_star2_O3/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 0xd002(%rip), %rsi      # 0x12c96
movq %r14, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x5cc9
movl $0x190, %edi            # imm = 0x190
addq 0x19334(%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 0x87e3
leaq 0xcd17(%rip), %rsi      # 0x129e7
movq %r14, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x5d95
leaq 0x1a5f9(%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 0x5d95
leaq 0xcfa2(%rip), %rdi      # 0x12cae
callq 0x2330
movq %rbx, %rdi
callq 0xda6c
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
movq %rax, (%rsp)
leaq 0x1bd53(%rip), %r14     # 0x21a80
leaq 0xcf90(%rip), %r15      # 0x12cc4
leaq 0xcf92(%rip), %r12      # 0x12ccd
leaq 0xcf79(%rip), %rdi      # 0x12cbb
callq 0x2330
movq (%r14), %rax
xorl %r13d, %r13d
movq (%rsp), %rbp
xorl %ecx, %ecx
cmpl $0x1, 0x3c4(%rax,%rbp)
jne 0x5d80
movq %rbx, %rdi
movl %r13d, %esi
callq 0x87e3
movq %r15, %rdi
callq 0x2330
movq %r12, %rdi
callq 0x2330
movq (%r14), %rax
movl $0x1, %ecx
incq %r13
addq $0x9c, %rbp
cmpq $0x19, %r13
jne 0x5d53
cmpl $0x1, %ecx
je 0x5d3b
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/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 0x5ee3
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xd925(%rip), %rsi      # 0x136fa
callq 0xd3aa
testl %eax, %eax
je 0x5ed3
leaq 0x1bc97(%rip), %r12     # 0x21a80
movq (%r12), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %r15     # imm = 0x26A8
cmpl $0x0, 0x283c(%rax,%r15)
jle 0x5e50
addq %r15, %rax
addq $0x1a0, %rax            # imm = 0x1A0
leaq 0xc0(%r14), %rcx
cmpw $0x5b, 0x26a2(%rax)
jl 0x5e72
leaq 0xd8e9(%rip), %rdx      # 0x1370c
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 0xcefe
leaq 0xc0(%r14), %rcx
leaq 0xd945(%rip), %rdx      # 0x137a3
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
jmp 0x5ec0
leaq 0xd8e0(%rip), %rdx      # 0x13759
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 0x5ec0
addq %r15, %rax
addq $0x2842, %rax           # imm = 0x2842
movw $0x64, (%rax)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcefe
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x273b
// File: /workspace/github_c_makefile_star2_O3/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 0x1bb2f(%rip), %rax     # 0x21a80
movq (%rax), %rax
cmpl $0x0, 0xf2e64(%rax)
je 0x5fb1
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
testq %rax, %rax
je 0x5fc5
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd556(%rip), %rdx      # 0x134d3
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 0xcefe
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 0xbb54
callq 0x2750
// File: /workspace/github_c_makefile_star2_O3/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 0x610f
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xcec1(%rip), %rsi      # 0x12ebb
callq 0xd3aa
testl %eax, %eax
je 0x60fd
movl $0x190, %edi            # imm = 0x190
addq 0x18fcd(%rip), %rdi     # 0x1efe0
callq 0xda6c
cmpl $-0x1, %eax
je 0x6077
movl %eax, %r15d
movl $0x320, %edi            # imm = 0x320
addq 0x18fb4(%rip), %rdi     # 0x1efe0
movq %rsp, %rsi
movl $0xa, %edx
callq 0x22e0
leaq 0x1ba40(%rip), %rcx     # 0x21a80
movq (%rcx), %rdx
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movq 0x27e8(%rdx,%rcx), %rsi
subq %rax, %rsi
jge 0x6099
addq $0x100, %rdx            # imm = 0x100
leaq 0xce92(%rip), %rsi      # 0x12efa
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2050
jmp 0x60ea
leaq 0x1ba02(%rip), %rax     # 0x21a80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xcbbd(%rip), %rsi      # 0x12c4a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x60ea
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 0x18f0d(%rip), %r8      # 0x1efe0
leaq 0xcdf9(%rip), %rsi      # 0x12ed3
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 0xcefe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x2765
// File: /workspace/github_c_makefile_star2_O3/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 0xcb60(%rip), %rsi      # 0x12c96
callq 0xd3aa
movl $0x190, %edi            # imm = 0x190
testl %eax, %eax
je 0x6166
addq 0x18e95(%rip), %rdi     # 0x1efe0
callq 0x2360
movq %rbx, %rdi
movl $0x1, %esi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc3b4
callq 0x22b0
testq %rax, %rax
je 0x61cd
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1b8ff(%rip), %rax     # 0x21a80
movq (%rax), %r8
movl 0xf2e68(%r8), %r9d
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xceaa(%rip), %rdx      # 0x13043
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 0xcefe
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2240
callq 0x277a