// File: /workspace/github_cpp_makefile_star2_O1/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 0x3094(%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 0x965b
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 0x305c(%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 0x9527
callq 0x3260
leaq 0x301f(%rip), %rsi      # 0xc54d
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x20(%rbx)
leaq 0x3010(%rip), %rsi      # 0xc559
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x24(%rbx)
leaq 0x3002(%rip), %rsi      # 0xc566
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x28(%rbx)
leaq 0x2ff3(%rip), %rsi      # 0xc572
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x2c(%rbx)
leaq 0x2fe7(%rip), %rsi      # 0xc581
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x30(%rbx)
leaq 0x2fd6(%rip), %rsi      # 0xc58b
leaq -0x48(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33f0
movl %eax, 0x34(%rbx)
leaq 0x2fc4(%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 0x9612
callq 0x3260
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9627
callq 0x3260
leaq -0x150(%rbp), %rdi
callq 0xa850
leaq -0x1a0(%rbp), %rdi
callq 0xa9de
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 0x596e(%rip), %rdi      # 0xefd0
leaq 0x2ec2(%rip), %rsi      # 0xc52b
movl $0x1c, %edx
callq 0x32f0
movq 0x5956(%rip), %rdi      # 0xefd0
callq 0x3130
movq %rax, %rbx
leaq 0x2e58(%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 0x9715
callq 0x3260
jmp 0x9715
jmp 0x96f7
movq %rax, %r14
jmp 0x9721
movq %rax, %r14
jmp 0x972d
jmp 0x96f7
jmp 0x96fc
movq %rax, %r14
jmp 0x9715
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x970c
callq 0x3260
leaq -0x48(%rbp), %rdi
callq 0x3140
leaq -0x3a8(%rbp), %rdi
callq 0x3080
leaq -0x1a0(%rbp), %rdi
callq 0xa800
leaq -0x70(%rbp), %rdi
callq 0x3140
movq %r14, %rdi
callq 0x34d0