// File: /workspace/github_cpp_makefile_star2_O3/Agusyc[P]CTRPG/src/jsonparser.cpp
// Function: parseItem(int)
Item parseItem(int index) {
    Json::Value root; // The root element
    Json::Reader reader; // The reader... that reads

    ifstream ifs("./json/items.json");

    bool parsingSuccessful = reader.parse(ifs, root);
    if(!parsingSuccessful) {
        // Print error
        cout << "Failed to parse the attacks." << endl << "Error:" << endl << reader.getFormattedErrorMessages();
        exit(1);
    }

    Json::Value jItem = root[index];

    Item item;

    item.name = jItem["name"].asString();
    item.attackBoost = jItem["attackBoost"].asInt();
    item.defenseBoost = jItem["defenseBoost"].asInt();
    item.manaRecover = jItem["manaRecover"].asInt();
    item.staminaRecover = jItem["staminaRecover"].asInt();
    item.hpRecover = jItem["hpRecover"].asInt();
    item.minLevel = jItem["minLevel"].asInt();
    item.maxLevel = jItem["maxLevel"].asInt();
    item.id = index;

    return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x390, %rsp            # imm = 0x390
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x3100
leaq -0x1a0(%rbp), %rdi
callq 0x32a0
leaq 0x30e4(%rip), %rsi      # 0xc519
leaq -0x3a8(%rbp), %rdi
movl $0x8, %edx
callq 0x34f0
leaq -0x1a0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movl $0x1, %ecx
callq 0x3510
testb %al, %al
je 0x960b
leaq -0x70(%rbp), %rdi
movl %r14d, %esi
callq 0x32c0
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x3450
leaq 0x10(%rbx), %r12
movq %r12, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x30ac(%rip), %rsi      # 0xc548
leaq -0x48(%rbp), %rdi
callq 0x30e0
leaq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x3500
leaq -0x90(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3330
movq (%r15), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x94d7
callq 0x3260
leaq 0x306f(%rip), %rsi      # 0xc54d
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x20(%rbx)
leaq 0x3060(%rip), %rsi      # 0xc559
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x24(%rbx)
leaq 0x3052(%rip), %rsi      # 0xc566
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x28(%rbx)
leaq 0x3043(%rip), %rsi      # 0xc572
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x2c(%rbx)
leaq 0x3037(%rip), %rsi      # 0xc581
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x30(%rbx)
leaq 0x3026(%rip), %rsi      # 0xc58b
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x34(%rbx)
leaq 0x3014(%rip), %rsi      # 0xc594
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x38(%rbx)
movl %r14d, 0x3c(%rbx)
leaq -0x48(%rbp), %rdi
callq 0x3140
leaq -0x3a8(%rbp), %rdi
callq 0x3080
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x95c2
callq 0x3260
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x95d7
callq 0x3260
leaq -0x150(%rbp), %rdi
callq 0xa800
leaq -0x1a0(%rbp), %rdi
callq 0xa9a0
leaq -0x70(%rbp), %rdi
callq 0x3140
movq %rbx, %rax
addq $0x390, %rsp            # imm = 0x390
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x59be(%rip), %rdi      # 0xefd0
leaq 0x2f12(%rip), %rsi      # 0xc52b
movl $0x1c, %edx
callq 0x32f0
movq 0x59a6(%rip), %rdi      # 0xefd0
callq 0x3130
movq %rax, %rbx
leaq 0x2ea8(%rip), %rsi      # 0xc4e1
movl $0x6, %edx
movq %rax, %rdi
callq 0x32f0
movq %rbx, %rdi
callq 0x3130
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3420
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3230
leaq -0x48(%rbp), %rdi
callq 0x3120
movl $0x1, %edi
callq 0x3320
movq %rax, %r14
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x96c5
callq 0x3260
jmp 0x96c5
jmp 0x96a7
movq %rax, %r14
jmp 0x96d1
movq %rax, %r14
jmp 0x96dd
jmp 0x96a7
jmp 0x96ac
movq %rax, %r14
jmp 0x96c5
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x96bc
callq 0x3260
leaq -0x48(%rbp), %rdi
callq 0x3140
leaq -0x3a8(%rbp), %rdi
callq 0x3080
leaq -0x1a0(%rbp), %rdi
callq 0xa7b0
leaq -0x70(%rbp), %rdi
callq 0x3140
movq %r14, %rdi
callq 0x34d0