LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: getdirectpointer
pNode* getdirectpointer(char* key,char* functionname){
	int j = get_func_hash_value(functionname);
    int h = hash(key);
    while(ht->functable[j]->table[h]->next != NULL){
        if(strcmp(key,ht->functable[j]->table[h]->next->name) == 0){
            return ht->functable[j]->table[h]->next;
        }
        h++;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4409
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4343
movq 0x1a141(%rip), %rcx     # 0x1eec8
movslq %r14d, %rdx
movslq %eax, %r15
shlq $0x3, %r15
addq (%rcx,%rdx,8), %r15
movq (%r15), %rax
movq 0x50(%rax), %r14
testq %r14, %r14
je 0x4db4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
addq $0x8, %r15
testl %eax, %eax
jne 0x4d95
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./symboltable.c
// Function: createsymboltable
void createsymboltable(){
        functable = (struct func_hash_table*)malloc(sizeof(struct func_hash_table*));
        int i;
        char *t = "";
        char *inp = "";
        char *output = "";
        for (i = 0;i < SIZE;i++) {
            functable->table[i] = create_func_node(t,inp,output);
        }
        ht = (struct hash_of_hash_tables*)malloc(sizeof(struct hash_of_hash_tables));
        int j;
        for (j = 0 ; j < HASHSIZE ; j++) {
                ht->functable[j] = create_table();
                for ( i = 0 ; i < SIZE ; ++i ) {
                    char *key = "";
                    char* functionname = "";
                    char* type = "";
                    char* ifnumvalue = "";
                    ht->functable[j]->table[i] = create_node(key,type,functionname,ifnumvalue);
                }
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x8
popq %rdi
callq 0x2150
movq %rax, 0x173f3(%rip)     # 0x1c7a0
xorl %r14d, %r14d
leaq 0x3897(%rip), %rbx      # 0x8c4e
cmpq $0x14, %r14
je 0x53db
movq %rbx, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x42ee
movq 0x173ce(%rip), %rcx     # 0x1c7a0
movq %rax, (%rcx,%r14,8)
incq %r14
jmp 0x53b7
movl $0xa0, %edi
callq 0x2150
movq %rax, 0x19adc(%rip)     # 0x1eec8
xorl %r14d, %r14d
leaq 0x3858(%rip), %rbx      # 0x8c4e
cmpq $0x14, %r14
je 0x543f
callq 0x4271
movq 0x19ac0(%rip), %rcx     # 0x1eec8
movq %rax, (%rcx,%r14,8)
xorl %r15d, %r15d
cmpq $0x14, %r15
je 0x543a
movq %rbx, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0x4280
movq 0x19a9b(%rip), %rcx     # 0x1eec8
movq (%rcx,%r14,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x540f
incq %r14
jmp 0x53f6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x374e(%rip), %rdi      # 0x9bb0
callq 0x20e0
leaq 0x2be2(%rip), %rdi      # 0x9050
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x21e0
leaq 0x1e04(%rip), %rdi      # 0x8287
callq 0x4409
movslq %eax, %r15
xorl %r13d, %r13d
cmpq $0x14, %r13
je 0x653f
movq 0x18a29(%rip), %rax     # 0x1eec8
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rax
movq 0x50(%rax), %r12
testq %r12, %r12
je 0x6537
cmpb $0x0, (%r12)
je 0x6537
leaq 0x37(%r12), %r14
movq %r14, %rdi
leaq 0x1e3d(%rip), %rsi      # 0x8307
pushq $0x5
popq %rdx
callq 0x2050
pushq $0x1
popq %rcx
testl %eax, %eax
jne 0x6523
movq %r14, %rdi
leaq 0x1eea(%rip), %rsi      # 0x83cd
callq 0x2190
testq %rax, %rax
je 0x6519
xorl %edi, %edi
leaq 0x1ecb(%rip), %rsi      # 0x83c1
callq 0x2190
xorl %edi, %edi
leaq 0x2c3a(%rip), %rsi      # 0x913e
callq 0x2190
testq %rax, %rax
je 0x6519
movq %r14, %rdi
movq %rax, %rsi
callq 0x2060
movq %r14, %rdi
callq 0x21a0
movl %eax, %ecx
movq %rbx, %rdi
leaq 0x2b31(%rip), %rsi      # 0x905e
movq %r12, %rdx
xorl %eax, %eax
callq 0x2130
incq %r13
jmp 0x648e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %rbx
callq 0x644a
leaq 0x2b09(%rip), %rdi      # 0x906d
pushq $0xf
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21e0
leaq 0x2b00(%rip), %rdi      # 0x907d
pushq $0xc
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21e0
leaq 0x2af8(%rip), %rdi      # 0x908a
pushq $0xd
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21e0
leaq 0x2af1(%rip), %rdi      # 0x9098
pushq $0xe
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21e0
leaq 0x2aeb(%rip), %rdi      # 0x90a7
pushq $0x8
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x21e0
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/mpeg/psi/psi.h
// Function: psi_assemble_payload
static inline uint8_t *psi_assemble_payload(uint8_t **pp_psi_buffer,
                                            uint16_t *pi_psi_buffer_used,
                                            const uint8_t **pp_payload,
                                            uint8_t *pi_length)
{
    uint16_t i_remaining_size = PSI_PRIVATE_MAX_SIZE + PSI_HEADER_SIZE
                                 - *pi_psi_buffer_used;
    uint16_t i_copy_size = *pi_length < i_remaining_size ? *pi_length :
                           i_remaining_size;
    uint8_t *p_section = NULL;

    if (*pp_psi_buffer == NULL) {
        if (**pp_payload == 0xff) {
            /* padding table to the end of buffer */
            *pi_length = 0;
            return NULL;
        }
        *pp_psi_buffer = psi_private_allocate();
    }

    memcpy(*pp_psi_buffer + *pi_psi_buffer_used, *pp_payload, i_copy_size);
    *pi_psi_buffer_used += i_copy_size;

    if (*pi_psi_buffer_used >= PSI_HEADER_SIZE) {
        uint16_t i_section_size = psi_get_length(*pp_psi_buffer)
                                   + PSI_HEADER_SIZE;

        if (i_section_size > PSI_PRIVATE_MAX_SIZE) {
            /* invalid section */
            psi_assemble_reset(pp_psi_buffer, pi_psi_buffer_used);
            *pi_length = 0;
            return NULL;
        }
        if (i_section_size <= *pi_psi_buffer_used) {
            p_section = *pp_psi_buffer;
            i_copy_size -= (*pi_psi_buffer_used - i_section_size);
            *pp_psi_buffer = NULL;
            *pi_psi_buffer_used = 0;
        }
    }

    *pp_payload += i_copy_size;
    *pi_length -= i_copy_size;
    return p_section;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movzwl (%rsi), %r13d
movl $0x1000, %ebp           # imm = 0x1000
subl %r13d, %ebp
movzbl (%rcx), %eax
cmpw %ax, %bp
cmovael %eax, %ebp
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x1519
movq (%r14), %rax
cmpb $-0x1, (%rax)
je 0x157b
movl $0x1000, %edi           # imm = 0x1000
callq 0x10c0
movq %rax, %rdi
movq %rax, (%r12)
addq %r13, %rdi
movq (%r14), %rsi
movzwl %bp, %r13d
movq %r13, %rdx
callq 0x10b0
movzwl (%r15), %ecx
leal (%rcx,%rbp), %edx
movw %dx, (%r15)
cmpw $0x3, %dx
jb 0x1564
movq (%r12), %rax
movzbl 0x1(%rax), %esi
andl $0xf, %esi
shll $0x8, %esi
movzbl 0x2(%rax), %edi
leal (%rsi,%rdi), %r8d
cmpw $0xffa, %r8w            # imm = 0xFFA
ja 0x1570
addl %edi, %esi
addl $0x3, %esi
cmpw %dx, %si
jbe 0x1590
xorl %eax, %eax
addq %r13, (%r14)
movb (%rbx), %cl
subb %bpl, %cl
jmp 0x157f
movq %r12, %rdi
movq %r15, %rsi
callq 0x14aa
xorl %ecx, %ecx
xorl %eax, %eax
movb %cl, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl %si, %ebp
subl %ecx, %ebp
andq $0x0, (%r12)
andw $0x0, (%r15)
movzwl %bp, %r13d
jmp 0x1566
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/mpeg/psi/pat.h
// Function: pat_get_program
static inline uint8_t *pat_get_program(uint8_t *p_pat, uint8_t n)
{
    uint8_t *p_pat_n = p_pat + PAT_HEADER_SIZE + n * PAT_PROGRAM_SIZE;
    if (p_pat_n + PAT_PROGRAM_SIZE - p_pat
         > psi_get_length(p_pat) + PSI_HEADER_SIZE - PSI_CRC_SIZE)
        return NULL;
    return p_pat_n;
}

// Assembly:
shll $0x2, %esi
leaq (%rdi,%rsi), %rcx
addq $0x8, %rcx
addq $0xc, %rsi
movzbl 0x1(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x2(%rdi), %edx
orq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rsi
cmovlq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/mpeg/psi/pat.h
// Function: pat_table_find_program
static inline uint8_t *pat_table_find_program(uint8_t **pp_sections,
                                              uint16_t i_program)
{
    uint8_t i_last_section = psi_table_get_lastsection(pp_sections);
    uint8_t i;

    for (i = 0; i <= i_last_section; i++) {
        uint8_t *p_section = psi_table_get_section(pp_sections, i);
        uint8_t *p_program;
        int j = 0;

        while ((p_program = pat_get_program(p_section, j)) != NULL) {
            j++;
            if (patn_get_program(p_program) == i_program)
                return p_program;
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movb 0x7(%rax), %bpl
xorl %r12d, %r12d
cmpb %bpl, %r12b
ja 0x1ca6
movzbl %r12b, %eax
movq (%r14,%rax,8), %r15
xorl %r13d, %r13d
movzbl %r13b, %esi
movq %r15, %rdi
callq 0x1c2b
testq %rax, %rax
je 0x1ca1
incb %r13b
movzwl (%rax), %ecx
rolw $0x8, %cx
cmpw %bx, %cx
jne 0x1c7f
jmp 0x1ca8
incb %r12b
jmp 0x1c6f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/mpeg/psi/psi.h
// Function: psi_check_crc
static inline bool psi_check_crc(const uint8_t *p_section)
{
    uint32_t i_crc = 0xffffffff;
    uint16_t i_end = psi_get_length(p_section)
                      + PSI_HEADER_SIZE - PSI_CRC_SIZE;
    uint16_t i;

    for (i = 0; i < i_end; i++)
        i_crc = (i_crc << 8) ^ p_psi_crc_table[(i_crc >> 24) ^ (p_section[i])];

    return p_section[i_end] == (i_crc >> 24)
            && p_section[i_end + 1] == ((i_crc >> 16) & 0xff)
            && p_section[i_end + 2] == ((i_crc >> 8) & 0xff)
            && p_section[i_end + 3] == (i_crc & 0xff);
}

// Assembly:
movzbl 0x1(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x2(%rdi), %ecx
addl %ecx, %eax
decl %eax
movzwl %ax, %eax
pushq $-0x1
popq %rcx
xorl %edx, %edx
leaq 0x368(%rip), %rsi       # 0x2040
cmpq %rdx, %rax
je 0x1cfb
movl %ecx, %r8d
shll $0x8, %r8d
shrl $0x18, %ecx
movzbl (%rdi,%rdx), %r9d
xorl %ecx, %r9d
xorl (%rsi,%r9,4), %r8d
incq %rdx
movl %r8d, %ecx
jmp 0x1cd8
movzbl (%rdi,%rax), %edx
movl %ecx, %esi
shrl $0x18, %esi
cmpl %edx, %esi
jne 0x1d26
movl %ecx, %edx
shrl $0x10, %edx
cmpb %dl, 0x1(%rdi,%rax)
jne 0x1d26
movl %ecx, %edx
shrl $0x8, %edx
cmpb %dl, 0x2(%rdi,%rax)
jne 0x1d26
cmpb %cl, 0x3(%rdi,%rax)
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x25c3
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x22c0
testq %rax, %rax
je 0x25c7
andq $0x0, 0x8(%rax)
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
jmp 0x25c5
xorl %eax, %eax
popq %rbx
retq
leaq 0xda62(%rip), %rdi      # 0x10030
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x260c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x260d
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
cmpq $0x100, %r14            # imm = 0x100
je 0x260f
movq (%rdi,%r14,8), %rdi
callq 0xeaa3
incq %r14
jmp 0x25f1
retq
xorl %edi, %edi
callq 0x2250
movq 0x10(%rbx), %rdi
callq 0xeaa3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/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 0x2965
movq %rdi, %r15
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2965
cmpq $0x0, 0x18(%r15)
je 0x2965
movl %edx, %ebx
movzbl %sil, %r13d
movq (%rax,%r13,8), %rdi
callq 0xec83
testq %rax, %rax
je 0x2965
callq 0xed2c
movsd %xmm0, 0x8(%rsp)
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rdi
callq 0xec9d
movq %rax, %r14
movq %r14, %rdi
callq 0xece8
testl %eax, %eax
je 0x2978
movq %r14, %rdi
callq 0xed27
movq %rax, %r12
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rdi
callq 0xec90
testl %ebx, %ebx
jne 0x294c
movq %r12, %xmm0
movq 0xd709(%rip), %xmm2     # 0x10010
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xd70d(%rip), %xmm3     # 0x10020
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 0x2978
movq %r14, %rdi
callq 0xed20
testl %eax, %eax
jne 0x2978
movq %r14, %rdi
callq 0xecf7
jmp 0x28ce
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0xece8
testl %eax, %eax
je 0x29a1
testl %ebx, %ebx
je 0x2994
movq %r14, %rdi
callq 0xed20
testl %eax, %eax
je 0x29a1
movq %r14, %rdi
callq 0xed11
movq %rax, %rbx
jmp 0x29a3
xorl %ebx, %ebx
movq %r14, %rdi
callq 0xece3
jmp 0x2967
// File: /workspace/github_c_makefile_star2_O2/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 0x2a91
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x2a91
cmpq $0x0, 0x18(%rbx)
je 0x2a91
callq 0xec83
testq %rax, %rax
je 0x2a91
callq 0xed2c
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
callq 0xec9d
movq %rax, %r14
movq %r14, %rdi
callq 0xece8
testl %eax, %eax
je 0x2a9e
movq %r14, %rdi
callq 0xed27
movq %rax, %xmm0
movq 0xd5ee(%rip), %xmm1     # 0x10010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xd5f2(%rip), %xmm1     # 0x10020
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 0xec90
movq %rax, %xmm0
punpckldq 0xd5b6(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd5be(%rip), %xmm0     # 0x10020
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 0x2a9e
movq %r14, %rdi
callq 0xecf7
jmp 0x29fd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0xece8
testl %eax, %eax
je 0x2ab7
movq %r14, %rdi
callq 0xed11
movq %rax, %rbx
jmp 0x2ab9
xorl %ebx, %ebx
movq %r14, %rdi
callq 0xece3
jmp 0x2a93
// File: /workspace/github_c_makefile_star2_O2/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 0x2af0
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x2af0
pushq %rax
movzbl %sil, %eax
movq (%rcx,%rax,8), %rdi
callq 0xec83
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
addq $0x8, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x1cf7b(%rip), %r14     # 0x1fa80
movq (%r14), %rbx
cmpl $0x0, 0x198(%rbx)
jne 0x2bc0
movb $0x0, 0x158(%rbx)
callq 0x2080
pushq $0x28
popq %rcx
cltd
idivl %ecx
movslq %edx, %rax
imulq $0x78, %rax, %rax
leaq (%rbx,%rax), %rsi
addq $0xf1b40, %rsi          # imm = 0xF1B40
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x21c0
callq 0x2080
pushq $0x19
popq %rcx
cltd
idivl %ecx
incl %edx
movl %edx, 0x40(%rbx)
callq 0x2080
pushq $0x5
popq %rcx
cltd
idivl %ecx
incl %edx
movl %edx, 0x44(%rbx)
movq (%r14), %rax
leaq 0x158(%rax), %r9
pushq $0x12
popq %rcx
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 0xd60f(%rip), %rdx      # 0x101a8
leaq 0x50(%rsp), %rbx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc860
movl %eax, %ebx
leaq 0x1ce93(%rip), %rax     # 0x1fa80
movq (%rax), %r12
leaq 0x158(%r12), %r15
leaq 0xf2e00(%r12), %rsi
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
jne 0x2c97
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 0xd596(%rip), %rdx      # 0x101dd
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 0x23a0
movq %r13, %rdi
callq 0x20c0
movq %r13, %rdi
movq %rax, %rsi
callq 0xbd04
leaq 0x1ce02(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movl 0x2794(%rax,%rbp), %ecx
cmpl 0x198(%rax), %ecx
jne 0x2c97
movl %ebx, %edi
callq 0x2ca9
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1cdc4(%rip), %r14     # 0x1fa80
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 0xd50d(%rip), %rdx      # 0x1022e
movq %rsp, %rbx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r8
pushq %r10
callq 0x23a0
addq $0x20, %rsp
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq (%r14), %rax
movb $0x0, 0x158(%rax)
andq $0x0, 0x198(%rax)
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x2110
testq %rax, %rax
je 0x2d9e
movq $0x1, 0x38(%rax)
popq %rcx
retq
leaq 0xd4f7(%rip), %rdi      # 0x1029c
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x2dc5
movq 0x1a4b3(%rip), %rbx     # 0x1d278
testq %rbx, %rbx
je 0x2e29
movq 0x10(%rbx), %rdi
callq 0x2250
xorl %r14d, %r14d
movq 0x18(%rbx), %rdi
cmpq (%rbx), %r14
jae 0x2dfa
movq (%rdi,%r14,8), %rdi
callq 0x2250
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2250
incq %r14
jmp 0x2dd6
callq 0x2250
movq 0x20(%rbx), %rdi
callq 0x2250
movq 0x28(%rbx), %rdi
callq 0x2250
movq 0x30(%rbx), %rdi
callq 0x2250
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
leaq 0xd4b0(%rip), %rdi      # 0x102e0
leaq 0xd4ad(%rip), %rsi      # 0x102e4
leaq 0xd4b3(%rip), %rcx      # 0x102f1
pushq $0x1a
popq %rdx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O2/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 0x3144
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x3163
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 0xd195(%rip), %rdi      # 0x102e0
leaq 0xd192(%rip), %rsi      # 0x102e4
leaq 0xd957(%rip), %rcx      # 0x10ab0
movl $0xfa, %edx
callq 0x2100
leaq 0xd95f(%rip), %rdi      # 0x10ac9
leaq 0xd173(%rip), %rsi      # 0x102e4
leaq 0xd938(%rip), %rcx      # 0x10ab0
movl $0xfb, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rcx
xorl %edx, %edx
movabsq $-0x3fffffffffffffef, %rsi # imm = 0xC000000000000011
cmpq %rdx, %rax
je 0x31bd
imulq $0x1f, %rcx, %rdi
movzbl (%rbx,%rdx), %r8d
addq %rcx, %rdi
addq %r8, %rdi
movq %rdi, %rcx
subq %rsi, %rcx
cmovbq %rdi, %rcx
incq %rdx
jmp 0x319a
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x31d2
movq 0x1a0a6(%rip), %rbx     # 0x1d278
testq %rbx, %rbx
je 0x31f8
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x30c6
movq %rbx, %rdi
callq 0x3215
movq $0x4, 0x38(%rbx)
popq %rbx
retq
leaq 0xd0e1(%rip), %rdi      # 0x102e0
leaq 0xd0de(%rip), %rsi      # 0x102e4
leaq 0xd3cd(%rip), %rcx      # 0x105da
pushq $0x53
popq %rdx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O2/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 0x3805
movq %rsi, %r13
movq %rdi, %r15
movq %rsi, %rdi
callq 0x3182
movq %rax, %r12
movq (%r15), %rax
movq %rax, (%rsp)
leaq -0x1(%rax), %rdi
xorl %ecx, %ecx
pushq $-0x1
popq %rax
cmpq %rcx, %rdi
jb 0x37f6
cmpq $0x1, %rcx
adcq $0x0, %rcx
leaq (%rcx,%rdi), %rbp
shrq %rbp
movq 0x10(%r15), %r14
movq (%r14,%rbp,8), %rdx
cmpq %r12, %rdx
je 0x379e
leaq -0x1(%rbp), %rsi
incq %rbp
cmpq %r12, %rdx
cmovbeq %rbp, %rcx
cmovaq %rsi, %rdi
jmp 0x3765
movq %rbp, %rbx
cmpq (%rsp), %rbx
jae 0x37e3
cmpq %r12, (%r14,%rbx,8)
jne 0x37e3
movq 0x18(%r15), %rax
movq (%rax,%rbx,8), %rsi
movq %r13, %rdi
callq 0x22e0
testl %eax, %eax
je 0x37ee
incq %rbx
jmp 0x37a1
cmpq %r12, (%r14,%rbp,8)
jne 0x37e9
movq 0x18(%r15), %rax
movq (%rax,%rbp,8), %rsi
movq %r13, %rdi
callq 0x22e0
testl %eax, %eax
je 0x37f3
decq %rbp
cmpq (%rsp), %rbp
jb 0x37c6
pushq $-0x1
popq %rax
jmp 0x37f6
movq %rbx, %rax
jmp 0x37f6
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcad4(%rip), %rdi      # 0x102e0
leaq 0xcad1(%rip), %rsi      # 0x102e4
leaq 0xd274(%rip), %rcx      # 0x10a8e
movl $0xd8, %edx
callq 0x2100
// File: /workspace/github_c_makefile_star2_O2/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 0x1bc0c(%rip), %rcx     # 0x1fa80
movq (%rcx), %r8
cltd
idivl 0xf2e4c(%r8)
testl %edx, %edx
setle %al
cmpl %r14d, %edx
setle %cl
orb %al, %cl
jne 0x3f0d
movslq %ebp, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
cmpl $0x0, 0x2800(%r8,%rax)
je 0x3f0d
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 0xcec6(%rip), %rsi      # 0x10da1
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 0xbd04
movq %rbx, %rdi
callq 0x3824
jmp 0x3f51
cmpl $0x0, 0xf2e40(%r8)
jle 0x3f51
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xc0(%rbx), %rdx
leaq 0xcebf(%rip), %rsi      # 0x10deb
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 0xbd04
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x4517
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xde90(%rip), %rdx      # 0x12373
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
leaq 0xde0a(%rip), %rdi      # 0x12328
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x4689
movq %rax, %rbx
addq $0x100, %r14            # imm = 0x100
leaq 0xd454(%rip), %rsi      # 0x119af
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x45ae
cmpl $0x0, 0x18d12(%rip)     # 0x1d280
je 0x4596
leaq 0x18d11(%rip), %r15     # 0x1d288
movq (%r15), %r14
movl $0x190, %esi            # imm = 0x190
addq 0x18a5a(%rip), %rsi     # 0x1cfe0
movq %r14, %rdi
callq 0x22e0
testl %eax, %eax
je 0x461a
leaq 0x1b4e3(%rip), %rax     # 0x1fa80
movl $0x100, %ecx            # imm = 0x100
addq (%rax), %rcx
leaq 0xd43d(%rip), %rdx      # 0x119e9
jmp 0x45e6
leaq 0xd454(%rip), %rsi      # 0x11a09
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x4608
leaq 0x1b4b8(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rax, %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
leaq 0xd348(%rip), %rdx      # 0x1192e
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
andl $0x0, 0x18c5f(%rip)     # 0x1d280
movq %r14, %rdi
callq 0x2250
andq $0x0, (%r15)
leaq 0x1b44c(%rip), %rax     # 0x1fa80
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
pushq $0x4
popq %rdi
callq 0xd488
leaq 0xd354(%rip), %rdx      # 0x119c0
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
movq %r15, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x23a0
jmp 0x45f5
leaq 0xd2d4(%rip), %rdi      # 0x11964
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x18bc9(%rip), %rax     # 0x1d278
movq (%rax), %r15
testq %r15, %r15
je 0x47e2
movq %rsi, %r14
movl %edi, %ebp
leaq 0x100(%rsi), %rdi
leaq 0xd1a1(%rip), %rsi      # 0x1186f
callq 0xc187
testl %eax, %eax
je 0x470a
leaq 0x19c02(%rip), %rdx     # 0x1e2e0
movb $0x3b, 0x190(%rdx)
addq $0x190, %rdx            # imm = 0x190
pushq $0x1
popq %r8
xorl %edi, %edi
movl %ebp, %esi
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x355c
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x47ff
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd1a8(%rip), %rdx      # 0x118d6
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x23a0
movslq %ebp, %rcx
leaq 0x1b336(%rip), %r13     # 0x1fa80
imulq $0x26a8, %rcx, %rbp     # imm = 0x26A8
xorl %r14d, %r14d
movslq %eax, %r12
cmpq (%r15), %r14
jae 0x479f
movq 0x28(%r15), %rcx
movq (%r13), %rdx
movzbl 0x2840(%rdx,%rbp), %edx
cmpl %edx, (%rcx,%r14,4)
jg 0x479a
leaq (%rbx,%r12), %rdi
movl $0x190, %eax            # imm = 0x190
subl %r12d, %eax
movslq %eax, %rsi
movq 0x18(%r15), %rax
movq (%rax,%r14,8), %rcx
leaq 0xea41(%rip), %rdx      # 0x131d1
xorl %eax, %eax
callq 0x23a0
addl %r12d, %eax
incq %r14
jmp 0x4754
movq %rbx, %rdi
addq %r12, %rdi
movl $0x190, %eax            # imm = 0x190
subl %r12d, %eax
movslq %eax, %rsi
leaq 0xe4c7(%rip), %rdx      # 0x12c7e
xorl %eax, %eax
callq 0x23a0
addl %r12d, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xbd04
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xbaf7(%rip), %rdi      # 0x102e0
leaq 0xd04b(%rip), %rsi      # 0x1183b
leaq 0xd053(%rip), %rcx      # 0x1184a
pushq $0x55
popq %rdx
callq 0x2100
leaq 0xd086(%rip), %rdi      # 0x1188c
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x4895
movq %rax, %rbx
cmpl $-0x1, %ebp
je 0x4855
leaq 0x1b246(%rip), %rax     # 0x1fa80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xd0f0(%rip), %rsi      # 0x11939
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x4876
movq %r14, %rdi
callq 0xc91b
leaq 0xd0ca(%rip), %rdx      # 0x1192e
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2250
leaq 0xd047(%rip), %rdi      # 0x118e3
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x491f
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1b1ae(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x2838(%rax,%rdx), %r9d
leaq 0xd8c4(%rip), %rdx      # 0x121b2
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2250
leaq 0xd841(%rip), %rdi      # 0x12167
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0xd296(%rip), %rsi      # 0x11be3
callq 0xc187
testl %eax, %eax
je 0x4992
leaq 0x19983(%rip), %r14     # 0x1e2e0
leaq 0x190(%r14), %rdi
callq 0xbfd4
movq %rax, %r15
addq $0x320, %r14            # imm = 0x320
movq %r14, %rdi
callq 0x2370
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd232
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x4a05
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1b0ce(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movl 0x2838(%rax,%rcx), %r8d
leaq 0xd6f1(%rip), %rdx      # 0x120bf
movl $0x190, %esi            # imm = 0x190
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x23a0
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xbd04
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xd668(%rip), %rdi      # 0x12074
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x4a99
movq %rax, %rbx
leaq 0xc0(%r14), %rcx
leaq 0x1b034(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
movl 0x283c(%rax,%rdx), %r9d
leaq 0xd887(%rip), %rdx      # 0x122ef
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2250
leaq 0xd804(%rip), %rdi      # 0x122a4
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270