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

    ifstream ifs("./json/attacks.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 jAttack = root[index];

    Attack attack;

    attack.name = jAttack["name"].asString();
    attack.damage = jAttack["damage"].asInt();
    attack.magicDamage = jAttack["magicDamage"].asInt();
    attack.mana = jAttack["mana"].asInt();
    attack.stamina = jAttack["stamina"].asInt();
    attack.minLevel = jAttack["minLevel"].asInt();
    attack.maxLevel = jAttack["maxLevel"].asInt();
    attack.cost = jAttack["cost"].asInt();
    attack.id = index;

    return attack;
}

// 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 0x1c88(%rip), %rsi      # 0x9487
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 0x798d
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 0x1cbf(%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 0x1cdb(%rip), %rsi      # 0x9573
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x20(%rbx)
leaq 0x1cc7(%rip), %rsi      # 0x957a
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x24(%rbx)
leaq 0x1b06(%rip), %rsi      # 0x93d4
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x28(%rbx)
leaq 0x1af0(%rip), %rsi      # 0x93d9
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x2c(%rbx)
leaq 0x1c5d(%rip), %rsi      # 0x9561
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x30(%rbx)
leaq 0x1c4b(%rip), %rsi      # 0x956a
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, %rdi
callq 0x33a0
movl %eax, 0x34(%rbx)
leaq 0x1c4c(%rip), %rsi      # 0x9586
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 0x563c(%rip), %rdi      # 0xcfd0
leaq 0x1b66(%rip), %rsi      # 0x9501
callq 0x3220
movq %rax, %rdi
callq 0x3110
leaq 0x1b08(%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 0x7a26
jmp 0x7a0d
movq %rax, %r14
jmp 0x7a32
movq %rax, %r14
jmp 0x7a3e
jmp 0x7a0d
jmp 0x7a12
movq %rax, %r14
jmp 0x7a26
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