// File: Matteo-Grellier[P]RPG/Menu.cpp
// Function: Menu::actions(Character&)
void Menu::actions(Character& character) {


    toScreen(
    " ",
    "c'est au tour de " + character.name + " de jouer",
    " ");

    if (character.getJob() != 7 ){

        int awnser = ask("| 1. attaquer | 2. " + character.getSpecialActionName() + " | 3. boire une potion |", "quel action souhaitez vous effectuer ?");
        int subAwnser;

        string targetList = targetListing();

        if (awnser == 1) {
            subAwnser = ask(
            targetList,
            "quel personnage souhaitez vous attaquer ?");


            character.attack(*Character::charactersList[subAwnser]);

        } else if (awnser == 2) {

            if (character.getJob() != 3) {
                subAwnser = ask(
                targetList,
                "quel personnage voulez vous viser ?");

                character.launchSpecialAction(*Character::charactersList[subAwnser]);
            } else {
                character.launchSpecialAction(character);
            }

        } else if (awnser == 3) {

            subAwnser = ask("| 0. Grande potion | 1. Moyenne potion | 2. Petite potion |", "choisissez une potion");

            character.drink(*Character::potionsList[subAwnser]);

        } else {
            toScreen(
            " ",
            "Action inconnu",
            " ");

            actions(character);

        }


    } else {
        character.launchSpecialAction(character);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x8(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x33a0
movq -0x2b0(%rbp), %rdx
leaq 0x4824(%rip), %rsi      # 0xe511
leaq -0x28(%rbp), %rdi
callq 0x4500
jmp 0x9cf8
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
leaq 0x47dc(%rip), %rsi      # 0xe4e3
leaq -0x80(%rbp), %rdi
callq 0x47c0
jmp 0x9d12
leaq 0x47dc(%rip), %rdx      # 0xe4f5
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4770
jmp 0x9d28
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x33a0
movq -0x2b8(%rbp), %rdx
leaq 0x47c8(%rip), %rsi      # 0xe511
leaq -0xa0(%rbp), %rdi
callq 0x4500
jmp 0x9d57
leaq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x93f0
jmp 0x9d6d
leaq -0xa0(%rbp), %rdi
callq 0x3418
leaq -0xa1(%rbp), %rdi
callq 0x3280
leaq -0x60(%rbp), %rdi
callq 0x3418
leaq -0x80(%rbp), %rdi
callq 0x3418
leaq -0x28(%rbp), %rdi
callq 0x3418
leaq -0x29(%rbp), %rdi
callq 0x3280
movq -0x8(%rbp), %rdi
callq 0x64e0
cmpl $0x7, %eax
je 0xa50c
movq -0x8(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x108(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq *%rax
movq -0x2c0(%rbp), %rdx
leaq 0x471c(%rip), %rsi      # 0xe4ff
leaq -0xe8(%rbp), %rdi
callq 0xae30
jmp 0x9df1
leaq 0x471b(%rip), %rdx      # 0xe513
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x4770
jmp 0x9e0d
leaq -0x129(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x33a0
movq -0x2c8(%rbp), %rdx
leaq 0x46fe(%rip), %rsi      # 0xe52c
leaq -0x128(%rbp), %rdi
callq 0x4500
jmp 0x9e3c
leaq -0xc8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x9580
movl %eax, -0x2cc(%rbp)
jmp 0x9e57
leaq -0x128(%rbp), %rdi
callq 0x3418
leaq -0x129(%rbp), %rdi
callq 0x3280
leaq -0xc8(%rbp), %rdi
callq 0x3418
leaq -0xe8(%rbp), %rdi
callq 0x3418
leaq -0x108(%rbp), %rdi
callq 0x3418
movl -0x2cc(%rbp), %eax
movl %eax, -0xa8(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xa530
cmpl $0x1, -0xa8(%rbp)
jne 0xa0cb
leaq -0x170(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x30f0
jmp 0x9ecd
leaq -0x191(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x33a0
movq -0x2d8(%rbp), %rdx
leaq 0x4665(%rip), %rsi      # 0xe553
leaq -0x190(%rbp), %rdi
callq 0x4500
jmp 0x9efc
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x9580
movl %eax, -0x2dc(%rbp)
jmp 0x9f17
movl -0x2dc(%rbp), %eax
movl %eax, -0x130(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x3418
leaq -0x191(%rbp), %rdi
callq 0x3280
leaq -0x170(%rbp), %rdi
callq 0x3418
movq -0x8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movslq -0x130(%rbp), %rsi
leaq 0xa2e8(%rip), %rdi      # 0x14248
callq 0x8d40
movq -0x2e8(%rbp), %rdi
movq (%rax), %rsi
callq 0x5df0
jmp 0x9f76
jmp 0xa4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9ff2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9fe9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9fe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9fcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3418
leaq -0xa1(%rbp), %rdi
callq 0x3280
leaq -0x60(%rbp), %rdi
callq 0x3418
leaq -0x80(%rbp), %rdi
callq 0x3418
leaq -0x28(%rbp), %rdi
callq 0x3418
leaq -0x29(%rbp), %rdi
callq 0x3280
jmp 0xa523
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa066
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa05a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa042
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x3418
leaq -0x129(%rbp), %rdi
callq 0x3280
leaq -0xc8(%rbp), %rdi
callq 0x3418
leaq -0xe8(%rbp), %rdi
callq 0x3418
leaq -0x108(%rbp), %rdi
callq 0x3418
jmp 0xa523
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa4fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa0ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x3418
leaq -0x191(%rbp), %rdi
callq 0x3280
leaq -0x170(%rbp), %rdi
callq 0x3418
jmp 0xa4fe
cmpl $0x2, -0xa8(%rbp)
jne 0xa218
movq -0x8(%rbp), %rdi
callq 0x64e0
movl %eax, -0x2ec(%rbp)
jmp 0xa0e9
movl -0x2ec(%rbp), %eax
cmpl $0x3, %eax
je 0xa1ff
leaq -0x1b8(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x30f0
jmp 0xa10d
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x33a0
movq -0x2f8(%rbp), %rdx
leaq 0x444f(%rip), %rsi      # 0xe57d
leaq -0x1d8(%rbp), %rdi
callq 0x4500
jmp 0xa13c
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x9580
movl %eax, -0x2fc(%rbp)
jmp 0xa157
movl -0x2fc(%rbp), %eax
movl %eax, -0x130(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x3418
leaq -0x1d9(%rbp), %rdi
callq 0x3280
leaq -0x1b8(%rbp), %rdi
callq 0x3418
movq -0x8(%rbp), %rax
movq %rax, -0x308(%rbp)
movslq -0x130(%rbp), %rsi
leaq 0xa0a8(%rip), %rdi      # 0x14248
callq 0x8d40
movq -0x308(%rbp), %rdi
movq (%rax), %rsi
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
jmp 0xa1ba
jmp 0xa213
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa1e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x3418
leaq -0x1d9(%rbp), %rdi
callq 0x3280
leaq -0x1b8(%rbp), %rdi
callq 0x3418
jmp 0xa4fe
movq -0x8(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
movq %rsi, %rdi
callq *%rax
jmp 0xa211
jmp 0xa213
jmp 0xa4ee
cmpl $0x3, -0xa8(%rbp)
jne 0xa36b
leaq -0x201(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x33a0
movq -0x310(%rbp), %rdx
leaq 0x435b(%rip), %rsi      # 0xe5a1
leaq -0x200(%rbp), %rdi
callq 0x4500
jmp 0xa254
leaq -0x229(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x33a0
movq -0x318(%rbp), %rdx
leaq 0x4368(%rip), %rsi      # 0xe5dd
leaq -0x228(%rbp), %rdi
callq 0x4500
jmp 0xa283
leaq -0x200(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x9580
movl %eax, -0x31c(%rbp)
jmp 0xa29e
movl -0x31c(%rbp), %eax
movl %eax, -0x130(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3418
leaq -0x229(%rbp), %rdi
callq 0x3280
leaq -0x200(%rbp), %rdi
callq 0x3418
leaq -0x201(%rbp), %rdi
callq 0x3280
movq -0x8(%rbp), %rax
movq %rax, -0x328(%rbp)
movslq -0x130(%rbp), %rsi
leaq 0x9f6d(%rip), %rdi      # 0x14260
callq 0xae80
movq -0x328(%rbp), %rdi
movq (%rax), %rsi
callq 0x5aa0
jmp 0xa309
jmp 0xa4ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa35a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa342
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3418
leaq -0x229(%rbp), %rdi
callq 0x3280
leaq -0x200(%rbp), %rdi
callq 0x3418
leaq -0x201(%rbp), %rdi
callq 0x3280
jmp 0xa4fe
leaq -0x251(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x33a0
movq -0x330(%rbp), %rdx
leaq 0x4185(%rip), %rsi      # 0xe511
leaq -0x250(%rbp), %rdi
callq 0x4500
jmp 0xa39a
leaq -0x279(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x33a0
movq -0x338(%rbp), %rdx
leaq 0x4238(%rip), %rsi      # 0xe5f3
leaq -0x278(%rbp), %rdi
callq 0x4500
jmp 0xa3c9
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x33a0
movq -0x340(%rbp), %rdx
leaq 0x4127(%rip), %rsi      # 0xe511
leaq -0x2a0(%rbp), %rdi
callq 0x4500
jmp 0xa3f8
leaq -0x250(%rbp), %rdi
leaq -0x278(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
callq 0x93f0
jmp 0xa414
leaq -0x2a0(%rbp), %rdi
callq 0x3418
leaq -0x2a1(%rbp), %rdi
callq 0x3280
leaq -0x278(%rbp), %rdi
callq 0x3418
leaq -0x279(%rbp), %rdi
callq 0x3280
leaq -0x250(%rbp), %rdi
callq 0x3418
leaq -0x251(%rbp), %rdi
callq 0x3280
movq -0x8(%rbp), %rdi
callq 0x9cc0
jmp 0xa467
jmp 0xa4ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa4de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa4c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa4ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x3418
leaq -0x2a1(%rbp), %rdi
callq 0x3280
leaq -0x278(%rbp), %rdi
callq 0x3418
leaq -0x279(%rbp), %rdi
callq 0x3280
leaq -0x250(%rbp), %rdi
callq 0x3418
leaq -0x251(%rbp), %rdi
callq 0x3280
jmp 0xa4fe
jmp 0xa4ee
jmp 0xa4f0
leaq -0x150(%rbp), %rdi
callq 0x3418
jmp 0xa51a
leaq -0x150(%rbp), %rdi
callq 0x3418
jmp 0xa523
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3390
nopl (%rax)