LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xcdea(%rip), %rsi      # 0x11c5e
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x4ea9
movl $0x190, %edi            # imm = 0x190
addq 0x18154(%rip), %rdi     # 0x1cfe0
callq 0x2370
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x780f
leaq 0xcaff(%rip), %rsi      # 0x119af
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x4edb
movl $0x190, %edi            # imm = 0x190
addq 0x18118(%rip), %rdi     # 0x1cfe0
leaq 0xcda0(%rip), %rsi      # 0x11c6f
pushq $0x7
popq %rdx
callq 0x2200
testl %eax, %eax
je 0x4eea
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd85(%rip), %rdi      # 0x11c76
callq 0x2340
movq %rbx, %rdi
callq 0xc860
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
movq %rax, (%rsp)
pushq $0x1
popq %rax
leaq 0x1ab6b(%rip), %rbp     # 0x1fa80
leaq 0xcd79(%rip), %r12      # 0x11c95
movl %eax, %r15d
cmpl $0x1, %eax
jne 0x4edb
leaq 0xcd58(%rip), %rdi      # 0x11c83
callq 0x2340
xorl %r13d, %r13d
movq (%rsp), %r14
xorl %eax, %eax
cmpq $0x19, %r13
je 0x4f1f
movq (%rbp), %rcx
cmpl $0x1, 0x3c4(%rcx,%r14)
jne 0x4f70
movq %rbx, %rdi
movl %r13d, %esi
callq 0x780f
leaq 0xcd2c(%rip), %rdi      # 0x11c8c
callq 0x2340
movq %r12, %rdi
callq 0x2340
movl %r15d, %eax
incq %r13
addq $0x9c, %r14
jmp 0x4f39
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x50bb
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xd715(%rip), %rsi      # 0x126c2
callq 0xc187
testl %eax, %eax
je 0x50ab
leaq 0x1aabf(%rip), %r12     # 0x1fa80
movq (%r12), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %r15     # imm = 0x26A8
cmpl $0x0, 0x283c(%rax,%r15)
jle 0x5028
addq %r15, %rax
addq $0x1a0, %rax            # imm = 0x1A0
leaq 0xc0(%r14), %rcx
cmpw $0x5b, 0x26a2(%rax)
jl 0x504a
leaq 0xd6d9(%rip), %rdx      # 0x126d4
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
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbd04
leaq 0xc0(%r14), %rcx
leaq 0xd735(%rip), %rdx      # 0x1276b
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
jmp 0x5098
leaq 0xd6d0(%rip), %rdx      # 0x12721
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq (%r12), %rax
movzwl 0x2842(%rax,%r15), %ecx
addl $0xa, %ecx
movw %cx, 0x2842(%rax,%r15)
decl 0x283c(%rax,%r15)
cmpw $0x65, %cx
jl 0x5098
addq %r15, %rax
addq $0x2842, %rax           # imm = 0x2842
movw $0x64, (%rax)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xd5b7(%rip), %rdi      # 0x12679
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x1a94c(%rip), %rax     # 0x1fa80
movq (%rax), %rax
cmpl $0x0, 0xf2e64(%rax)
je 0x5194
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x51a6
movq %rax, %rbx
addq $0xc0, %r14
leaq 0xd33b(%rip), %rdx      # 0x1249b
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
pushq $0x1
popq %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xab2c
leaq 0xd2a3(%rip), %rdi      # 0x12450
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0x22c0
testq %rax, %rax
je 0x52fd
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xcc99(%rip), %rsi      # 0x11e83
callq 0xc187
testl %eax, %eax
je 0x52eb
movl $0x190, %edi            # imm = 0x190
addq 0x17ddd(%rip), %rdi     # 0x1cfe0
callq 0xc860
cmpl $-0x1, %eax
je 0x5265
movl %eax, %r15d
movl $0x320, %edi            # imm = 0x320
addq 0x17dc4(%rip), %rdi     # 0x1cfe0
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x22f0
leaq 0x1a852(%rip), %rcx     # 0x1fa80
movq (%rcx), %rdx
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movq 0x27e8(%rdx,%rcx), %rsi
subq %rax, %rsi
jge 0x5287
addq $0x100, %rdx            # imm = 0x100
leaq 0xcc6c(%rip), %rsi      # 0x11ec2
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2050
jmp 0x52d8
leaq 0x1a814(%rip), %rax     # 0x1fa80
movl $0x100, %edx            # imm = 0x100
addq (%rax), %rdx
leaq 0xc997(%rip), %rsi      # 0x11c12
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x52d8
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 0x17d1f(%rip), %r8      # 0x1cfe0
leaq 0xcbd3(%rip), %rsi      # 0x11e9b
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 0xbd04
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xcb34(%rip), %rdi      # 0x11e38
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/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 0xc92d(%rip), %rsi      # 0x11c5e
callq 0xc187
movl $0x190, %edi            # imm = 0x190
testl %eax, %eax
je 0x535f
addq 0x17c9a(%rip), %rdi     # 0x1cfe0
callq 0x2370
pushq $0x1
popq %rsi
movq %rbx, %rdi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb182
callq 0x22c0
testq %rax, %rax
je 0x53c6
movq %rax, %r14
addq $0xc0, %rbx
leaq 0x1a706(%rip), %rax     # 0x1fa80
movq (%rax), %r8
movl 0xf2e68(%r8), %r9d
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0xcc79(%rip), %rdx      # 0x1200b
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
jmp 0x2250
leaq 0xcbf3(%rip), %rdi      # 0x11fc0
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_inv
void cmd_inv (int pindex, struct Message * msg) {
    char *out, action[12];
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x5585
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xcf9b(%rip), %rsi      # 0x1240e
callq 0xc187
testl %eax, %eax
je 0x54b3
movl $0x190, %edi            # imm = 0x190
addq 0x17b58(%rip), %rdi     # 0x1cfe0
callq 0x2370
movl %ebp, %edi
movl %eax, %esi
callq 0x6cdd
testl %eax, %eax
je 0x54c0
movabsq $0x69726f7661666e75, %rax # imm = 0x69726F7661666E75
movq %rax, 0x8(%rsp)
movl $0x646574, 0x10(%rsp)   # imm = 0x646574
jmp 0x54d6
movq %r14, %rdi
callq 0x6d32
jmp 0x556e
movabsq $0x657469726f766166, %rax # imm = 0x657469726F766166
movq %rax, 0x8(%rsp)
movw $0x64, 0x10(%rsp)
movl $0x190, %eax            # imm = 0x190
leaq 0x18dfe(%rip), %r15     # 0x1e2e0
addq %rax, %r15
movq %r15, %rdi
callq 0x2370
movl %ebp, %edi
movl %eax, %esi
callq 0x6cb6
leaq 0x1a583(%rip), %rax     # 0x1fa80
movq (%rax), %rax
leaq 0x100(%rax), %r12
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %r13     # imm = 0x26A8
addq %rax, %r13
movq %r15, %rdi
callq 0x2370
cltq
imulq $0x9c, %rax, %rax
addq %r13, %rax
addq $0x330, %rax            # imm = 0x330
movq %rax, (%rsp)
leaq 0xcef6(%rip), %rdx      # 0x1242f
leaq 0x8(%rsp), %r9
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r12, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2250
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xce37(%rip), %rdi      # 0x123c3
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_make
void cmd_make(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if (matches_regex(msg->message, CMD_LIT" snow angels")) {
        if (dawn->weather == SNOWING) {
            int yeti_chance = rand() % 100;
            if (yeti_chance >= 75) {
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s falls to the ground and begins making snow angels!"
                        " Unfortunately, they were mauled by a yeti in the process. -25 HP\r\n", msg->receiver,
                        msg->sender_nick);
                dawn->players[pindex].health -= 25;
                add_msg(out, strlen(out));
                check_alive(msg);
                return;
            }
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s falls to the ground and begins making snow angels!\r\n",
                    msg->receiver, msg->sender_nick);
            add_msg(out, strlen(out));
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :There is no snow\r\n", msg->receiver);
            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 0x56c1
movq %rax, %rbx
leaq 0x100(%r14), %rdi
leaq 0xc75f(%rip), %rsi      # 0x11d39
callq 0xc187
testl %eax, %eax
je 0x565b
leaq 0x1a496(%rip), %r15     # 0x1fa80
movq (%r15), %rax
cmpl $0x2, 0x14c(%rax)
jne 0x5628
callq 0x2080
pushq $0x64
popq %rcx
cltd
idivl %ecx
leaq 0xc0(%r14), %rcx
cmpl $0x4a, %edx
jg 0x566d
leaq 0xc7c1(%rip), %rdx      # 0x11dd5
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
jmp 0x5648
addq $0xc0, %r14
leaq 0xc7e3(%rip), %rdx      # 0x11e19
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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xc6dc(%rip), %rdx      # 0x11d50
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq (%r15), %rax
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq $-0x19, 0x27f0(%rax,%rcx)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3824
leaq 0xc626(%rip), %rdi      # 0x11cee
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_market
void cmd_market(int pindex __attribute__((unused)), struct Message * msg) {
    if (matches_regex(msg->message, CMD_LIT" sell (\\w+) (\\d+)")) {
        char *eptr;
        long amount = strtol(regex_group[2], &eptr, 10);
        market_buysell(msg, 0, regex_group[1], amount);
    } else if (matches_regex(msg->message, CMD_LIT" buy (\\w+) (\\d+)")) {
        char *eptr;
        long amount = strtol(regex_group[2], &eptr, 10);
        market_buysell(msg, 1, regex_group[1], amount);
    } else {
        print_market();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x100(%rsi), %r14
leaq 0xcb23(%rip), %rsi      # 0x1220d
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x571d
leaq 0x18be3(%rip), %r14     # 0x1e2e0
leaq 0x320(%r14), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x22f0
addq $0x190, %r14            # imm = 0x190
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x5756
leaq 0xcb05(%rip), %rsi      # 0x12229
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x5769
leaq 0x18ba9(%rip), %r14     # 0x1e2e0
leaq 0x320(%r14), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x22f0
addq $0x190, %r14            # imm = 0x190
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
callq 0xa82a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa6fb
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_sheet
void cmd_sheet(int pindex __attribute__((unused)), struct Message * msg) {
    if (matches_regex(msg->message, CMD_LIT" (.*)")) {
        if (strcmp(regex_group[1], dawn->nickname) == 0) {
            strncpy(msg->sender_nick, to_lower(regex_group[1]), MAX_NICK_LENGTH);
            print_sheet(msg);
            return;
        }
        strncpy(msg->sender_nick, to_lower(regex_group[1]), MAX_NICK_LENGTH);
        if (get_pindex(regex_group[1]) != -1) {
            print_sheet(msg);
        }
    } else {
        print_sheet(msg);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x100(%rsi), %rdi
leaq 0xc389(%rip), %rsi      # 0x11b2d
callq 0xc187
testl %eax, %eax
je 0x57fb
leaq 0x1a2cc(%rip), %rax     # 0x1fa80
movq (%rax), %rsi
movl $0x190, %r14d           # imm = 0x190
addq 0x1781c(%rip), %r14     # 0x1cfe0
movq %r14, %rdi
callq 0x22e0
movl %eax, %ebp
movq %r14, %rdi
callq 0xbfd4
leaq 0x17a87(%rip), %rcx     # 0x1d264
movl (%rcx), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20e0
testl %ebp, %ebp
je 0x57fb
movq %r14, %rdi
callq 0xc860
cmpl $-0x1, %eax
je 0x5807
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xcd7d
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_umbrella
void cmd_umbrella (int pindex __attribute__((unused)), struct Message *msg) {
    char *out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if (dawn->weather == RAINING) {
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s throws up an umbrella and becomes a little less wet\r\n",
                dawn->active_room, msg->sender_nick);
        add_msg(out, strlen(out));
    } else {
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :You throw up your umbrella. You look silly.\r\n", dawn->active_room);
        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 0x5b2c
movq %rax, %rbx
leaq 0x19fba(%rip), %rax     # 0x1fa80
movq (%rax), %rax
leaq 0x100(%rax), %rcx
cmpl $0x1, 0x14c(%rax)
jne 0x5af4
leaq 0xcf3f(%rip), %rdx      # 0x12a1f
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
jmp 0x5b0a
leaq 0xcf69(%rip), %rdx      # 0x12a64
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
jmp 0x2250
leaq 0xcea1(%rip), %rdi      # 0x129d4
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_weather
void cmd_weather (int pindex __attribute__((unused)), struct Message *msg) {
    char *out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, the current weather is: ", dawn->active_room, msg->sender_nick);
    switch (dawn->weather) {
        case SUNNY:
            strcat(out, "warm and sunny!\r\n");
            break;
        case RAINING:
            strcat(out, "pouring rain\r\n");
            break;
        case SNOWING:
            strcat(out, "snowing, perfect for making snow angels!\r\n");
            break;
        default:
            strcat(out, "wejustdontknow.gif\r\n");
    }
    add_msg(out, strlen(out));
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x5c85
movq %rax, %rbx
leaq 0x19ecc(%rip), %r15     # 0x1fa80
movl $0x100, %ecx            # imm = 0x100
addq (%r15), %rcx
leaq 0xcd87(%rip), %rdx      # 0x1294a
movl $0x190, %esi            # imm = 0x190
movq %rax, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq (%r15), %rax
movl 0x14c(%rax), %ebp
movq %rbx, %rdi
callq 0x20c0
addq %rbx, %rax
cmpl $0x2, %ebp
je 0x5c26
cmpl $0x1, %ebp
je 0x5c09
testl %ebp, %ebp
jne 0x5c48
movups 0xcd75(%rip), %xmm0     # 0x12973
movups %xmm0, (%rax)
movw $0xa, 0x10(%rax)
jmp 0x5c60
movabsq $0xa0d6e69617220, %rcx  # imm = 0xA0D6E69617220
movq %rcx, 0x7(%rax)
movabsq $0x20676e6972756f70, %rcx # imm = 0x20676E6972756F70
movq %rcx, (%rax)
jmp 0x5c60
movups 0xcd82(%rip), %xmm0     # 0x129af
movups %xmm0, 0x1b(%rax)
movups 0xcd6c(%rip), %xmm0     # 0x129a4
movups %xmm0, 0x10(%rax)
movups 0xcd51(%rip), %xmm0     # 0x12994
movups %xmm0, (%rax)
jmp 0x5c60
movups 0xcd70(%rip), %xmm0     # 0x129bf
movups %xmm0, (%rax)
movabsq $0xa0d6669672e77, %rcx  # imm = 0xA0D6669672E77
movq %rcx, 0xd(%rax)
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
leaq 0xcc73(%rip), %rdi      # 0x128ff
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_gib
void cmd_gib(int pindex, struct Message * msg) {
    if(matches_regex(msg->message, CMD_LIT" gold (\\d+)")) {
        dawn->players[pindex].gold += atoi(regex_group[1]);
    } else if(matches_regex(msg->message, CMD_LIT" ap (\\d+)")) {
        dawn->players[pindex].attr_pts += atoi(regex_group[1]);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
addq $0x100, %r14            # imm = 0x100
leaq 0xc6b1(%rip), %rsi      # 0x12399
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x5d25
movl $0x190, %edi            # imm = 0x190
addq 0x172e0(%rip), %rdi     # 0x1cfe0
callq 0x2370
cltq
leaq 0x19d72(%rip), %rcx     # 0x1fa80
movq (%rcx), %rcx
movslq %ebx, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rax, 0x27e8(%rcx,%rdx)
jmp 0x5d64
leaq 0xc683(%rip), %rsi      # 0x123af
movq %r14, %rdi
callq 0xc187
testl %eax, %eax
je 0x5d64
movl $0x190, %edi            # imm = 0x190
addq 0x1729c(%rip), %rdi     # 0x1cfe0
callq 0x2370
leaq 0x19d30(%rip), %rcx     # 0x1fa80
movq (%rcx), %rcx
movslq %ebx, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addl %eax, 0x2838(%rcx,%rdx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_givexp
void cmd_givexp(int pindex __attribute__((unused)), struct Message * msg) {
    if (matches_regex(msg->message, CMD_LIT" (\\w+) (\\d+)")) {
        char * username;
        CALLEXIT(!(username = calloc(MAX_NICK_LENGTH, 1)))
        char *eptr;
        int index;
        unsigned long long amount = strtoull(regex_group[2], &eptr, 10);

        strncpy(username, to_lower(regex_group[1]), MAX_NICK_LENGTH);
        index = get_pindex(username);
        dawn->players[index].experience += amount;

        if (index == -1) return;

        while (dawn->players[index].experience > get_nextlvl_exp(username)) {
            struct Message temp;
            strncpy(temp.sender_nick, username, MAX_NICK_LENGTH);
            strncpy(temp.receiver, dawn->active_room, MAX_CHANNEL_LENGTH);
            check_levelup(&temp);
        }
        free(username);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x908, %rsp            # imm = 0x908
leaq 0x100(%rsi), %rdi
leaq 0xbe58(%rip), %rsi      # 0x11be3
callq 0xc187
testl %eax, %eax
je 0x5e89
leaq 0x174c5(%rip), %r12     # 0x1d264
movl (%r12), %edi
pushq $0x1
popq %rsi
callq 0x2110
testq %rax, %rax
je 0x5e9b
movq %rax, %rbx
leaq 0x18522(%rip), %r15     # 0x1e2e0
leaq 0x320(%r15), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x22d0
movq %rax, %r14
addq $0x190, %r15            # imm = 0x190
movq %r15, %rdi
callq 0xbfd4
movl (%r12), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20e0
movq %rbx, %rdi
callq 0xc860
leaq 0x19c80(%rip), %rbp     # 0x1fa80
movq (%rbp), %rcx
cltq
imulq $0x26a8, %rax, %r13     # imm = 0x26A8
addq 0x27f8(%rcx,%r13), %r14
movq %r14, 0x27f8(%rcx,%r13)
cmpl $-0x1, %eax
je 0x5e89
leaq 0x8(%rsp), %r12
leaq 0x17432(%rip), %r15     # 0x1d260
movq %rbx, %rdi
callq 0xcd28
cmpq %rax, %r14
jbe 0x5e81
leaq 0x17422(%rip), %rax     # 0x1d264
movl (%rax), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x20e0
movq (%rbp), %rsi
movl $0x100, %eax            # imm = 0x100
addq %rax, %rsi
movl (%r15), %edx
leaq 0xc8(%rsp), %rdi
callq 0x20e0
movq %r12, %rdi
callq 0xd117
movq (%rbp), %rax
movq 0x27f8(%rax,%r13), %r14
jmp 0x5e2e
movq %rbx, %rdi
callq 0x2250
addq $0x908, %rsp            # imm = 0x908
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbdfc(%rip), %rdi      # 0x11c9e
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_save
void cmd_save(int pindex __attribute__((unused)), struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    persistent_save();
    snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Saved.\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 0x5f0f
movq %rax, %rbx
callq 0xc818
addq $0xc0, %r14
leaq 0xc3b4(%rip), %rdx      # 0x1228f
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
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
leaq 0xc32e(%rip), %rdi      # 0x12244
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_stop
void cmd_stop(int pindex __attribute__((unused)), struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if (matches_regex(msg->message, CMD_LIT " (.*)")) {
        if(strcasecmp(regex_group[1], dawn->nickname) == 0) {
            close_socket(con_socket);
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Wrong nickname.\r\n", dawn->active_room);
            add_msg(out, strlen(out));
        }
    } else {
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Please supply the nickname of the bot.\r\n", dawn->active_room);
        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 0x6141
movq %rax, %rbx
addq $0x100, %r14            # imm = 0x100
leaq 0xba7c(%rip), %rsi      # 0x11b2d
movq %r14, %rdi
callq 0xc187
leaq 0x199c0(%rip), %rcx     # 0x1fa80
movq (%rcx), %r14
testl %eax, %eax
je 0x60ef
movl $0x190, %edi            # imm = 0x190
addq 0x16f0d(%rip), %rdi     # 0x1cfe0
movq %r14, %rsi
callq 0x2210
testl %eax, %eax
je 0x6124
addq $0x100, %r14            # imm = 0x100
leaq 0xba50(%rip), %rdx      # 0x11b3d
jmp 0x60fd
addq $0x100, %r14            # imm = 0x100
leaq 0xba5e(%rip), %rdx      # 0x11b5b
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
jmp 0x6132
leaq 0x17195(%rip), %rax     # 0x1d2c0
movl (%rax), %edi
callq 0xbb8b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
leaq 0xb99a(%rip), %rdi      # 0x11ae2
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_fdel
void cmd_fdel(int pindex, struct Message *msg) {
    char *out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    struct Inventory empty = {0};
    puts("in fdel");
    if (matches_regex(msg->message, CMD_LIT" (\\w+) (\\d+)")) {
        puts("regex matched");
        pindex = get_pindex(regex_group[1]);
        if (pindex == -1) {
            puts("pindex -1");
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Invalid user\r\n", msg->receiver);
            add_msg(out, strlen(out));
            return;
        } else {
            puts("good");
            printf("user %s slot %s\n", regex_group[1], regex_group[2]);
            int slot = atoi(regex_group[2]);
            dawn->players[pindex].inventory[slot] = empty;
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Slot cleared\r\n", msg->receiver);
            add_msg(out, strlen(out));
        }
    }
    free(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x62c0
movq %rax, %rbx
leaq 0xba5f(%rip), %rdi      # 0x11bdb
callq 0x2340
leaq 0x100(%r14), %rdi
leaq 0xba54(%rip), %rsi      # 0x11be3
callq 0xc187
testl %eax, %eax
je 0x6265
leaq 0xba57(%rip), %rdi      # 0x11bfa
callq 0x2340
movl $0x190, %edi            # imm = 0x190
addq 0x16e2c(%rip), %rdi     # 0x1cfe0
callq 0xc860
cmpl $-0x1, %eax
je 0x6277
movl %eax, %ebp
leaq 0xba62(%rip), %rdi      # 0x11c2d
callq 0x2340
leaq 0x18109(%rip), %r15     # 0x1e2e0
leaq 0x190(%r15), %rsi
addq $0x320, %r15            # imm = 0x320
leaq 0xba46(%rip), %rdi      # 0x11c32
movq %r15, %rdx
xorl %eax, %eax
callq 0x2040
movq %r15, %rdi
callq 0x2370
leaq 0x1987b(%rip), %rcx     # 0x1fa80
movslq %ebp, %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq (%rcx), %rdx
cltq
imulq $0x9c, %rax, %rax
leaq (%rax,%rdx), %rdi
addq $0x330, %rdi            # imm = 0x330
movl $0x9c, %edx
xorl %esi, %esi
callq 0x20f0
addq $0xc0, %r14
leaq 0xba03(%rip), %rdx      # 0x11c43
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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xb98a(%rip), %rdi      # 0x11c08
callq 0x2340
addq $0xc0, %r14
leaq 0xb981(%rip), %rdx      # 0x11c12
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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbd04
leaq 0xb8c9(%rip), %rdi      # 0x11b90
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/events.c
// Function: update_weather
void update_weather(void) {
    int weather = rand() % MAX_WEATHER_TYPE;
    char out[MAX_MESSAGE_BUFFER];

    //Avoid same weather
    while (weather == dawn->weather)
        weather = rand() % MAX_WEATHER_TYPE;

    switch (weather) {
        case 0:
            sprintf(out, "PRIVMSG %s :The clouds disperse, allowing "
                        "the sunlight to shine down upon %s\r\n",
                    dawn->active_room, dawn->active_room);
            dawn->weather = SUNNY;
            break;
        case 1:
            sprintf(out, "PRIVMSG %s :Dark clouds roll in, plunging the town"
                         " of stacked into darkness. Rain begins to fall from"
                    " the sky.\r\n", dawn->active_room);
            dawn->weather = RAINING;
            break;
        case 2:
            sprintf(out, "PRIVMSG %s :Snow begins to float down from the skies!\r\n",
                    dawn->active_room);
            dawn->weather = SNOWING;
            break;
        default:
            PRINTERR("INVALID WEATHER")
    }
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
callq 0x2080
pushq $0x3
popq %rbp
leaq 0x19122(%rip), %rbx     # 0x1fa80
cltd
idivl %ebp
movl %edx, %eax
movq (%rbx), %rdx
cmpl 0x14c(%rdx), %eax
jne 0x6975
callq 0x2080
jmp 0x695e
cmpl $0x2, %eax
je 0x69ae
cmpl $0x1, %eax
je 0x69d5
testl %eax, %eax
jne 0x6a1a
addq $0x100, %rdx            # imm = 0x100
leaq 0xc156(%rip), %rsi      # 0x12aeb
movq %rsp, %rdi
movq %rdx, %rcx
xorl %eax, %eax
callq 0x2050
movq (%rbx), %rax
andl $0x0, 0x14c(%rax)
jmp 0x69fa
addq $0x100, %rdx            # imm = 0x100
leaq 0xc1ef(%rip), %rsi      # 0x12bab
movq %rsp, %rdi
xorl %eax, %eax
callq 0x2050
movq (%rbx), %rax
movl $0x2, 0x14c(%rax)
jmp 0x69fa
addq $0x100, %rdx            # imm = 0x100
leaq 0xc157(%rip), %rsi      # 0x12b3a
movq %rsp, %rdi
xorl %eax, %eax
callq 0x2050
movq (%rbx), %rax
movl $0x1, 0x14c(%rax)
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %rbp
retq
leaq 0xc1c2(%rip), %rdi      # 0x12be3
callq 0x2190
jmp 0x69fa
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/events.c
// Function: check_famine
void check_famine(int whom) {
    struct Message temp;
    if (whom == -1) {
        for (int i = 0; i < dawn->player_count; i++) {
            strncpy(temp.sender_nick, dawn->players[i].username, MAX_NICK_LENGTH);
            strncpy(temp.receiver, dawn->active_room, MAX_CHANNEL_LENGTH);
            check_alive(&temp);
        }
    } else {
        strncpy(temp.sender_nick, dawn->players[whom].username, MAX_NICK_LENGTH);
        strncpy(temp.receiver, dawn->active_room, MAX_CHANNEL_LENGTH);
        check_alive(&temp);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x908, %rsp            # imm = 0x908
cmpl $-0x1, %edi
je 0x6aad
leaq 0x1903b(%rip), %rax     # 0x1fa80
movq (%rax), %rbx
movslq %edi, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
leaq (%rbx,%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
leaq 0x16800(%rip), %rax     # 0x1d264
movl (%rax), %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x20e0
leaq 0xc8(%rsp), %rdi
addq $0x100, %rbx            # imm = 0x100
leaq 0x167d7(%rip), %rax     # 0x1d260
movl (%rax), %edx
movq %rbx, %rsi
callq 0x20e0
movq %r14, %rdi
callq 0x3824
addq $0x908, %rsp            # imm = 0x908
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1a0, %r12d           # imm = 0x1A0
xorl %r13d, %r13d
leaq 0x18fc3(%rip), %rbp     # 0x1fa80
leaq 0x8(%rsp), %r14
leaq 0x16797(%rip), %rbx     # 0x1d260
movq (%rbp), %r15
movslq 0x148(%r15), %rax
cmpq %rax, %r13
jge 0x6a9b
leaq (%r15,%r12), %rsi
leaq 0x16780(%rip), %rax     # 0x1d264
movl (%rax), %edx
movq %r14, %rdi
callq 0x20e0
addq $0x100, %r15            # imm = 0x100
movl (%rbx), %edx
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x20e0
movq %r14, %rdi
callq 0x3824
incq %r13
addq $0x26a8, %r12           # imm = 0x26A8
jmp 0x6ac9
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/events.c
// Function: lottery_collect
void lottery_collect (void) {
    for (int i=0; i<dawn->player_count; i++) {
        if (dawn->players[i].gold <= 50) {
            continue;
        }

        long long amount = rand() % 45000; //( (long long)((2.0f/100) * dawn->players[i].gold) );
        dawn->lottery += amount;
        //dawn->players[i].gold -= amount;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x18f57(%rip), %rbx     # 0x1fa80
movq (%rbx), %rax
movl $0x27e8, %r14d          # imm = 0x27E8
xorl %r15d, %r15d
movl $0xafc8, %ebp           # imm = 0xAFC8
movslq 0x148(%rax), %rcx
cmpq %rcx, %r15
jge 0x6b6e
cmpq $0x33, (%rax,%r14)
jl 0x6b62
callq 0x2080
cltd
idivl %ebp
movslq %edx, %rcx
movq (%rbx), %rax
addq %rcx, 0x150(%rax)
incq %r15
addq $0x26a8, %r14           # imm = 0x26A8
jmp 0x6b3a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/events.c
// Function: lottery_reward
void lottery_reward (void) {
    char out[MAX_MESSAGE_BUFFER];
    int player = rand() % dawn->player_count;

    while (dawn->players[player].available != 1) {
        player = rand() % dawn->player_count;
    }

    dawn->players[player].gold += dawn->lottery;
    
    snprintf(
        out,
        MAX_MESSAGE_BUFFER,
        "PRIVMSG %s :Congratulations, %s! You've won the lottery and have been awarded with %lld gold pieces!!!\r\n",
        dawn->active_room,
        dawn->players[player].username,
        dawn->lottery
    );

    dawn->lottery = 0;
    add_msg(out, strlen(out));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
leaq 0x18ef6(%rip), %r14     # 0x1fa80
callq 0x2080
movq (%r14), %rcx
cltd
idivl 0x148(%rcx)
movslq %edx, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
cmpl $0x1, 0x2804(%rcx,%rax)
jne 0x6b8a
leaq (%rcx,%rax), %r8
addq $0x1a0, %r8             # imm = 0x1A0
movq 0x150(%rcx), %r9
addq %r9, 0x2648(%r8)
addq $0x100, %rcx            # imm = 0x100
leaq 0xc044(%rip), %rdx      # 0x12c18
movq %rsp, %rbx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x23a0
movq (%r14), %rax
andq $0x0, 0x150(%rax)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/items.c
// Function: get_item_info
void get_item_info(struct Message *message, int slot) {
    char item_name[128];
    char out[MAX_MESSAGE_BUFFER];
    int index = get_pindex(message->sender_nick);
    int total_items = MAX_INVENTORY_SLOTS - dawn->players[index].available_slots;
    int str    = dawn->players[index].inventory[slot].attr_strength;
    int intel  = dawn->players[index].inventory[slot].attr_intelligence;
    int def    = dawn->players[index].inventory[slot].attr_defense;
    int mdef   = dawn->players[index].inventory[slot].attr_mdef;
    int hp     = dawn->players[index].inventory[slot].attr_health;
    int mp     = dawn->players[index].inventory[slot].attr_mana;
    int weight = dawn->players[index].inventory[slot].weight;
    int reqlvl = dawn->players[index].inventory[slot].req_level;

    if (slot < total_items && slot > -1) {
        strcpy(item_name, dawn->players[index].inventory[slot].name);
        sprintf(out, "PRIVMSG %s :%s - STR: %d - DEF: %d - INT: %d - MDEF: %d - HP: %d - MP: %d"
               " - Weight: %d - Req lvl: %d\r\n", message->receiver, item_name, str, def, intel, mdef, hp, mp, weight, reqlvl);
        add_msg(out, strlen(out));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movl %esi, %ebp
movq %rdi, %rbx
callq 0xc860
testl %ebp, %ebp
js 0x7aad
leaq 0x180a8(%rip), %rcx     # 0x1fa80
movq (%rcx), %rcx
cltq
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
pushq $0x19
popq %rdx
subl 0x2818(%rcx,%rax), %edx
cmpl %ebp, %edx
jle 0x7aad
addq %rcx, %rax
addq $0x1a0, %rax            # imm = 0x1A0
movl %ebp, %ecx
imulq $0x9c, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x190, %rsi            # imm = 0x190
movl 0x78(%rsi), %r13d
movl 0x7c(%rsi), %r14d
movl 0x90(%rsi), %eax
movq %rax, (%rsp)
movl 0x74(%rsi), %eax
movq %rax, 0x18(%rsp)
movl 0x64(%rsi), %eax
movq %rax, 0x8(%rsp)
movl 0x68(%rsi), %ebp
movl 0x6c(%rsi), %eax
movq %rax, 0x10(%rsp)
movl 0x70(%rsi), %r15d
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x21c0
addq $0xc0, %rbx
leaq 0xbbf2(%rip), %rsi      # 0x13651
leaq 0xa0(%rsp), %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %r15d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r13
pushq %r14
pushq 0x10(%rsp)
pushq 0x20(%rsp)
pushq 0x38(%rsp)
pushq 0x38(%rsp)
callq 0x2050
addq $0x30, %rsp
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/main.c
// Function: print_usage
void print_usage (char **argv) {
    printf(WARN "Usage: %s [parameters]\n\n", argv[0]);
    printf(WARN "Valid parameters:\n");
    printf(WARN "\t-h\t\t- Prints this, hi\n");
    printf(WARN "\t-m <file>\t- Specifies the raw monster database\n");
    printf(WARN "\t-n <nick>\t- Sets the bot's nickname\n");
    printf(WARN "\t-p <port>\t- Sets the server port the bot connects to\n");
    printf(WARN "\t-r <room>\t- Sets which room the bot will join - NOTE: OMIT THE #\n");
    printf(WARN "\t-s <server>\t- Specify the server the bot connects to -\n"
                "\t\t\t  can be IP or hostname\n");
}

// Assembly:
pushq %rax
movq (%rdi), %rsi
leaq 0xb479(%rip), %rdi      # 0x13d75
xorl %eax, %eax
callq 0x2040
leaq 0xb52c(%rip), %rdi      # 0x13e36
callq 0x2340
leaq 0xb545(%rip), %rdi      # 0x13e5b
callq 0x2340
leaq 0xb563(%rip), %rdi      # 0x13e85
callq 0x2340
leaq 0xb59a(%rip), %rdi      # 0x13ec8
callq 0x2340
leaq 0xb5c6(%rip), %rdi      # 0x13f00
callq 0x2340
leaq 0xb603(%rip), %rdi      # 0x13f49
callq 0x2340
leaq 0xb64c(%rip), %rdi      # 0x13f9e
popq %rax
jmp 0x2340
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/main.c
// Function: timestamp
char *timestamp (void) {
    static char timestamp[12];
    time_t ltime;
    ltime = time(NULL);
    struct tm *tm;
    tm = localtime(&ltime);
    sprintf(timestamp, "%02d/%02d:%02d:%02d", tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
    return timestamp;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %edi, %edi
callq 0x21b0
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x2140
movl 0xc(%rax), %edx
movl 0x8(%rax), %ecx
movl (%rax), %r9d
movl 0x4(%rax), %r8d
leaq 0x1490b(%rip), %rbx     # 0x1d290
leaq 0xb415(%rip), %rsi      # 0x13da1
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/map.c
// Function: entity_location
static inline struct Location entity_location(struct entity *ent) {
    int dim = global_map->dim;
    return (struct Location) {
            .x = (int) ((ent - global_map->m_ent) % dim),
            .y = (int) ((ent - global_map->m_ent) / dim)
    };
}

// Assembly:
movq %rdi, %rax
movq 0x139cf(%rip), %rcx     # 0x1d2a0
movslq 0x20(%rcx), %rsi
subq 0x8(%rcx), %rax
sarq $0x3, %rax
cqto
idivq %rsi
shlq $0x20, %rax
movl %edx, %ecx
orq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/map.c
// Function: free_map
void free_map() {
    free(global_map->heightmap);

    for (int i = 0; i < global_map->town_count; i++) {
        free(global_map->towns[i].t_ent);
    }

    free(global_map->towns);
    free(global_map->m_ent);
    free(global_map);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x13310(%rip), %rax     # 0x1d2a0
movq (%rax), %rdi
callq 0x2250
pushq $0x20
popq %rbx
xorl %r14d, %r14d
movq 0x132fb(%rip), %rax     # 0x1d2a0
movslq 0x18(%rax), %rcx
movq 0x10(%rax), %rdi
cmpq %rcx, %r14
jge 0x9fc4
movq (%rdi,%rbx), %rdi
callq 0x2250
incq %r14
addq $0x30, %rbx
jmp 0x9f9e
callq 0x2250
movq 0x132d0(%rip), %rax     # 0x1d2a0
movq 0x8(%rax), %rdi
callq 0x2250
movq 0x132c0(%rip), %rdi     # 0x1d2a0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/map.c
// Function: print_location
void print_location(int i) {
    char out[MAX_MESSAGE_BUFFER];
    sprintf(out, "PRIVMSG %s :%s, you are at %d,%d\r\n", dawn->active_room, dawn->players[i].username,
            dawn->players[i].pos_x, dawn->players[i].pos_y);
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
leaq 0x15a85(%rip), %rax     # 0x1fa80
movq (%rax), %rdx
movslq %edi, %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
leaq (%rdx,%rax), %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
addq $0x100, %rdx            # imm = 0x100
movl 0x25ec(%rcx), %r8d
movl 0x25f0(%rcx), %r9d
leaq 0xad4d(%rip), %rsi      # 0x14d7c
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Ziddykins[P]Dawn/src/map.c
// Function: find_building
void find_building (struct Bot *b, struct Message *message, char *location) {
    char out[MAX_MESSAGE_BUFFER];
    int pindex = get_pindex(message->sender_nick);
    int bindex = get_bindex(b, message->sender_nick, location);

    if (bindex != -1) {
        sprintf(out, "PRIVMSG %s :The %s in %s is located at %d,%d\r\n",
            message->receiver,
            location,
            b->players[pindex].current_map.name,
            b->players[pindex].current_map.buildings[bindex].x,
            b->players[pindex].current_map.buildings[bindex].y
        );
    } else {
        sprintf(out, "PRIVMSG %s :Unknown location '%s'\r\n", message->receiver, location);
    }
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0xc860
movl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xc8b7
addq $0xc0, %r14
cmpl $-0x1, %eax
je 0xa3b8
movslq %ebp, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
leaq (%r15,%rcx), %rdx
leaq (%r15,%rcx), %r8
addq $0x273c, %r8            # imm = 0x273C
cltq
imulq $0x50, %rax, %rax
movl 0x137c(%rax,%rdx), %r9d
movl 0x1380(%rax,%rdx), %eax
movl %eax, (%rsp)
leaq 0xabda(%rip), %rsi      # 0x14f7e
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2050
jmp 0xa3d1
leaq 0xabee(%rip), %rsi      # 0x14fad
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2050
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq