// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/monsters.c
// Function: print_monster
void print_monster(char const *username, int global) { //username -> MAX_NICK_LENGTH
    char out[MAX_MESSAGE_BUFFER];
    int pindex = get_pindex(username);

    if (pindex == -1) return;

    if (global) {
        if (!dawn->global_monster.active) {
            sprintf(out, "PRIVMSG %s :There is no monster in the room currently\r\n", dawn->active_room);
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :A %s is in the room: [Health: %d] [%d Str - %d Def - %d Int - %d MDef]\r\n",
                     dawn->active_room, dawn->global_monster.name, dawn->global_monster.hp,
                     dawn->global_monster.str, dawn->global_monster.def, dawn->global_monster.intel,
                     dawn->global_monster.mdef);
        }
    } else {
        if (!dawn->players[pindex].personal_monster.active) {
            sprintf(out, "PRIVMSG %s :%s, you are not fighting any monster currently\r\n", dawn->active_room, username);
        } else {
            sprintf(out, "PRIVMSG %s :%s, you are fighting a %s: [Health: %d][%dS - %dD - %dI - %dMD]\r\n",
                    dawn->active_room, username, dawn->players[pindex].personal_monster.name,
                    dawn->players[pindex].personal_monster.hp,
                    dawn->players[pindex].personal_monster.str,
                    dawn->players[pindex].personal_monster.def,
                    dawn->players[pindex].personal_monster.intel,
                    dawn->players[pindex].personal_monster.mdef);
        }
    }
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x1b4(%rbp)
cmpl $-0x1, -0x1b4(%rbp)
jne 0x11930
jmp 0x11bcb
cmpl $0x0, -0x14(%rbp)
je 0x11a1d
leaq 0x1712f(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x0, 0xf2e64(%rax)
jne 0x11978
leaq -0x1b0(%rbp), %rdi
leaq 0x17115(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x100, %rdx            # imm = 0x100
leaq 0xe1d3(%rip), %rsi      # 0x1fb3f
movb $0x0, %al
callq 0x2050
jmp 0x11a18
leaq -0x1b0(%rbp), %rdi
leaq 0x170ea(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
leaq 0x170d9(%rip), %rax     # 0x28a70
movq (%rax), %r8
addq $0xf2e00, %r8           # imm = 0xF2E00
leaq 0x170c8(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e40(%rax), %r9d
leaq 0x170b7(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e4c(%rax), %ebx
leaq 0x170a7(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e48(%rax), %r11d
leaq 0x17096(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e50(%rax), %r10d
leaq 0x17085(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e54(%rax), %eax
movl $0x190, %esi            # imm = 0x190
leaq 0xe177(%rip), %rdx      # 0x1fb77
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x2390
jmp 0x11ba2
leaq 0x1704c(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
cmpl $0x0, 0x1130(%rax)
jne 0x11a76
leaq -0x1b0(%rbp), %rdi
leaq 0x1701b(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x10(%rbp), %rcx
leaq 0xe162(%rip), %rsi      # 0x1fbcc
movb $0x0, %al
callq 0x2050
jmp 0x11ba0
leaq -0x1b0(%rbp), %rdi
leaq 0x16fec(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x10(%rbp), %rcx
leaq 0x16fd7(%rip), %rax     # 0x28a70
movq (%rax), %r8
addq $0x1a0, %r8             # imm = 0x1A0
movslq -0x1b4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %r8
addq $0x10cc, %r8            # imm = 0x10CC
leaq 0x16fae(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rax
movl 0x110c(%rax), %r9d
leaq 0x16f86(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rax
movl 0x1118(%rax), %ebx
leaq 0x16f5f(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rax
movl 0x1114(%rax), %r11d
leaq 0x16f37(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rax
movl 0x111c(%rax), %r10d
leaq 0x16f0f(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1b4(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rax
movl 0x1120(%rax), %eax
leaq 0xe081(%rip), %rsi      # 0x1fc09
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x2050
jmp 0x11ba2
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x20c0
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop