// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/inventory.c
// Function: print_inventory
void print_inventory(struct Message *message) {
    int i = get_pindex(message->sender_nick);
    int j;
    char out[MAX_MESSAGE_BUFFER];
    char temp[100];

    sprintf(out, "PRIVMSG %s :", message->receiver);

    for (j = 0; j < (MAX_INVENTORY_SLOTS - dawn->players[i].available_slots); j++) {
        if (j % 9 == 0) {
            strcat(out, "\r\n");
            add_msg(out, strlen(out));
            sprintf(out, "PRIVMSG %s :", message->receiver);
        }
        temp[0] = '\0';

        sprintf(temp, "[%s%d%s%s] - %s%s%s ", 
                is_equipped(i, j) ? IRC_GREEN : IRC_RED,
                j,
                IRC_NORMAL,
                is_favorite(i, j) ? IRC_PURPLE"*"IRC_NORMAL : "",
                is_new(i, j) ? IRC_RED"["IRC_NORMAL : "",
                dawn->players[i].inventory[j].name,
                is_new(i, j) ? IRC_RED"]"IRC_NORMAL : "");
        strcat(out, temp);
    }
    sprintf(temp, " - Available slots: %d", dawn->players[i].available_slots);
    strcat(out, temp);
    strcat(out, "\r\n");
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0xc(%rbp)
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
leaq 0x11c32(%rip), %rsi     # 0x1b8d6
movb $0x0, %al
callq 0x2050
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
leaq 0x1edb4(%rip), %rcx     # 0x28a70
movq (%rcx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rdx
movl $0x19, %ecx
subl 0x2678(%rdx), %ecx
cmpl %ecx, %eax
jge 0x9eb6
movl -0x10(%rbp), %eax
movl $0x9, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x9d53
leaq -0x1a0(%rbp), %rdi
leaq 0x12f81(%rip), %rsi     # 0x1cc86
callq 0x2400
leaq -0x1a0(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
leaq 0x11b8a(%rip), %rsi     # 0x1b8d6
movb $0x0, %al
callq 0x2050
movb $0x0, -0x210(%rbp)
leaq -0x210(%rbp), %rax
movq %rax, -0x248(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x9a40
movl %eax, %edx
leaq 0x10fb4(%rip), %rax     # 0x1ad30
leaq 0x1345a(%rip), %rcx     # 0x1d1dd
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x240(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x234(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x9bd0
movl %eax, %edx
leaq 0x136fe(%rip), %rax     # 0x1d4ac
leaq 0x1342c(%rip), %rcx     # 0x1d1e1
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x230(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x9c20
movl %eax, %edx
leaq 0x136d5(%rip), %rax     # 0x1d4ac
leaq 0x13409(%rip), %rcx     # 0x1d1e7
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x228(%rbp)
leaq 0x1ec7d(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x10(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x220(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x9c20
movq -0x248(%rbp), %rdi
movq -0x240(%rbp), %rdx
movl -0x234(%rbp), %ecx
movq -0x230(%rbp), %r9
movq -0x228(%rbp), %r11
movq -0x220(%rbp), %r10
movl %eax, %r8d
leaq 0x13649(%rip), %rax     # 0x1d4ac
leaq 0x13383(%rip), %rsi     # 0x1d1ed
cmpl $0x0, %r8d
cmovneq %rsi, %rax
leaq 0x1334f(%rip), %rsi     # 0x1d1c8
leaq 0x13365(%rip), %r8      # 0x1d1e5
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x2400
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9cb2
leaq -0x210(%rbp), %rdi
leaq 0x1ebac(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2678(%rax), %edx
leaq 0x1330b(%rip), %rsi     # 0x1d1f3
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x2400
leaq -0x1a0(%rbp), %rdi
leaq 0x12d76(%rip), %rsi     # 0x1cc86
callq 0x2400
leaq -0x1a0(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x250(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
nopw (%rax,%rax)