// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x388, %rsp            # imm = 0x388
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x30e0
leaq -0x198(%rbp), %rdi
callq 0x3240
leaq 0x1f74(%rip), %rsi      # 0x94ef
leaq -0x3a0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x34a0
leaq -0x198(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
leaq -0x68(%rbp), %rdx
pushq $0x1
popq %rcx
callq 0x34c0
testb %al, %al
je 0x7709
leaq -0x68(%rbp), %rdi
movl %r14d, %esi
callq 0x3260
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x3410
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x1f43(%rip), %rsi      # 0x951e
leaq -0x40(%rbp), %rdi
callq 0x30b0
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x34b0
leaq -0x88(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x3100
leaq 0x1f0f(%rip), %rsi      # 0x9523
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x20(%rbx)
leaq 0x1f00(%rip), %rsi      # 0x952f
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x24(%rbx)
leaq 0x1ef2(%rip), %rsi      # 0x953c
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x28(%rbx)
leaq 0x1ee3(%rip), %rsi      # 0x9548
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x2c(%rbx)
leaq 0x1ed7(%rip), %rsi      # 0x9557
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x30(%rbx)
leaq 0x1ec6(%rip), %rsi      # 0x9561
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x34(%rbx)
leaq 0x1eb4(%rip), %rsi      # 0x956a
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x38(%rbx)
movl %r14d, 0x3c(%rbx)
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x3a0(%rbp), %rdi
callq 0x3070
leaq -0x198(%rbp), %rdi
callq 0x860c
leaq -0x68(%rbp), %rdi
callq 0x3120
movq %rbx, %rax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x58c0(%rip), %rdi      # 0xcfd0
leaq 0x1dea(%rip), %rsi      # 0x9501
callq 0x3220
movq %rax, %rdi
callq 0x3110
leaq 0x1d8c(%rip), %rsi      # 0x94b7
movq %rax, %rdi
callq 0x3220
movq %rax, %rdi
callq 0x3110
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x33d0
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x31d0
leaq -0x40(%rbp), %rdi
callq 0x3100
pushq $0x1
popq %rdi
callq 0x32b0
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x3100
jmp 0x77a2
jmp 0x7789
movq %rax, %r14
jmp 0x77ae
movq %rax, %r14
jmp 0x77ba
jmp 0x7789
jmp 0x778e
movq %rax, %r14
jmp 0x77a2
movq %rax, %r14
movq %rbx, %rdi
callq 0x3100
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x3a0(%rbp), %rdi
callq 0x3070
leaq -0x198(%rbp), %rdi
callq 0x860c
leaq -0x68(%rbp), %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3490