// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
callq 0xda6c
movl %eax, %ebp
addq $0xc0, %rbx
leaq 0xad23(%rip), %rsi      # 0x1290e
leaq 0x80(%rsp), %rdi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movslq %ebp, %rax
leaq 0x19e74(%rip), %rcx     # 0x21a80
movq (%rcx), %r10
imulq $0x26a8, %rax, %rbp     # imm = 0x26A8
movl 0x2818(%r10,%rbp), %edx
cmpl $0x18, %edx
jg 0x7d57
leaq 0x330(%rbp), %rbx
leaq 0xd19b(%rip), %r12      # 0x14dd0
xorl %r15d, %r15d
movl %r15d, %eax
imulq $0x38e38e39, %rax, %rax # imm = 0x38E38E39
shrq $0x21, %rax
leal (%rax,%rax,8), %eax
cmpl %eax, %r15d
jne 0x7ca3
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x20c0
movw $0xa0d, 0x80(%rsp,%rax) # imm = 0xA0D
movb $0x0, 0x82(%rsp,%rax)
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcefe
movq %r14, %rdi
leaq 0xac81(%rip), %rsi      # 0x1290e
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x19de0(%rip), %rax     # 0x21a80
movq (%rax), %r10
movb $0x0, 0x10(%rsp)
movb 0x98(%r10,%rbx), %al
addq %rbx, %r10
testb $0x4, %al
leaq 0xc551(%rip), %rdx      # 0x1420d
leaq 0xa0a5(%rip), %rcx      # 0x11d68
cmoveq %rcx, %rdx
testb $0x2, %al
leaq 0xc541(%rip), %r9       # 0x14211
cmoveq %r12, %r9
testb $0x1, %al
leaq 0xc53a(%rip), %r11      # 0x14217
cmoveq %r12, %r11
leaq 0xc535(%rip), %r13      # 0x1421d
cmoveq %r12, %r13
subq $0x8, %rsp
leaq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0xc4f9(%rip), %rsi      # 0x141f8
movl %r15d, %ecx
leaq 0xc50c(%rip), %r8       # 0x14215
xorl %eax, %eax
pushq %r13
pushq %r10
pushq %r11
callq 0x2050
addq $0x20, %rsp
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x2410
incq %r15
leaq 0x19d4c(%rip), %rax     # 0x21a80
movq (%rax), %r10
movslq 0x2818(%r10,%rbp), %rdx
movl $0x19, %eax
subq %rdx, %rax
addq $0x9c, %rbx
cmpq %rax, %r15
jl 0x7c38
leaq 0xc4c5(%rip), %rsi      # 0x14223
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2410
movq %r14, %rdi
callq 0x20c0
movw $0xa0d, 0x80(%rsp,%rax) # imm = 0xA0D
movb $0x0, 0x82(%rsp,%rax)
movq %r14, %rdi
callq 0x20c0
movq %r14, %rdi
movq %rax, %rsi
callq 0xcefe
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq