// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %edi, -0xc(%rbp)
leaq 0x2591a(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e58(%rax), %eax
leaq 0x2590a(%rip), %rcx     # 0x28a70
movq (%rcx), %rcx
imull 0x19c(%rcx), %eax
leaq 0x258f9(%rip), %rcx     # 0x28a70
movq (%rcx), %rcx
imull 0x198(%rcx), %eax
movl %eax, -0x1a4(%rbp)
leaq 0x258e2(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e5c(%rax), %eax
leaq 0x258d2(%rip), %rcx     # 0x28a70
movq (%rcx), %rcx
imull 0x19c(%rcx), %eax
leaq 0x258c1(%rip), %rcx     # 0x28a70
movq (%rcx), %rcx
imull 0x198(%rcx), %eax
movl %eax, -0x1a8(%rbp)
movslq -0x1a4(%rbp), %rcx
leaq 0x258a3(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addq 0x2648(%rax), %rcx
movq %rcx, 0x2648(%rax)
movslq -0x1a8(%rbp), %rcx
leaq 0x25870(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addq 0x2658(%rax), %rcx
movq %rcx, 0x2658(%rax)
leaq -0x1a0(%rbp), %rdi
leaq 0x2583d(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
leaq 0x2582c(%rip), %rax     # 0x28a70
movq (%rax), %r8
addq $0x1a0, %r8             # imm = 0x1A0
movslq -0xc(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %r8
leaq 0x2580d(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0x198(%rax), %r9d
leaq 0x257fc(%rip), %rax     # 0x28a70
movq (%rax), %rbx
addq $0x158, %rbx            # imm = 0x158
leaq 0x257eb(%rip), %rax     # 0x28a70
movq (%rax), %r11
addq $0x1a0, %r11            # imm = 0x1A0
movslq -0xc(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %r11
movl -0x1a4(%rbp), %r10d
movl -0x1a8(%rbp), %eax
movl $0x190, %esi            # imm = 0x190
leaq 0x16f78(%rip), %rdx     # 0x1a22e
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x2390
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
movb $0x0, -0x1f0(%rbp)
movl $0x0, -0x1b0(%rbp)
movl $0x0, -0x1ac(%rbp)
leaq 0x25756(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x158, %rdi            # imm = 0x158
leaq -0x1f0(%rbp), %rsi
movl $0x48, %edx
callq 0x2170
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %rbp
retq
nop