// File: /workspace/github_cpp_makefile_star2_O1/AlanReviews[P]Goblet-of-fire/Control.cc
// Function: Control::launch()
void Control::launch(void) {
    // Initialize the random seed
    srand( (unsigned)time( NULL ) );
    // Create a View object
    View view;
    // Declare and initialize the choice
    int choice;
    // Declare and initialize the student attributes: name, age, and school
    std::string name;
    int age;
    std::string school;
    // Declare and initialize has a school booleans
    bool hasHogwarts = false;
    bool hasDurmstrang = false;
    bool hasBeauxbatons = false;

    // Display the main menu
    while (1) {
        view.displayMenu(choice);
        // Get out of the program
        if (choice == 0) {
            break;
        }
        // Add a participant to the Goblet of fire
        else if (choice == 1) {
            // Prompt the user to input their age.
            cout << "You are at the age line. Please enter your age:" << endl;
            cin >> age;
            // Clear the buffer
            std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
            // If the user is under 17, go back to the main menu
            if (age < 17) {
                cout << "You are not allowed to participate in the Triwizard Tournament. Even if you look older or are under the aging potion, you are still not allowed." << endl;
                continue;
            }
            cout << endl;
            // Prompt the user to add a name and school
            cout << "Please enter your name:" << endl;
            std::getline(std::cin,name);
            if (name.empty()) {
                cout << "You didn't enter a name" << endl;
                continue;
            }
            cout << endl;
            cout << "Please enter your school:" << endl;
            std::getline(std::cin,school);
            if (school.empty()) {
                cout << "You didn't enter a school" << endl;
                continue;
            }
            cout << endl;
            // If there is a Hogwarts, Beauxbatons, or Durmstrang student added to the list, match the appropriate boolean variable to true
            if (school == "Hogwarts") {
                hasHogwarts = true;
            }
            else if (school == "Beauxbatons") {
                hasBeauxbatons = true;
            }
            else if (school == "Durmstrang") {
                hasDurmstrang = true;
            }
            // Statically allocate a participant object
            Participant p = Participant(name, age, school);
            // Add the participant object to the vector
            participants.push_back(p);
        }
        // Drawing out characters
        else if (choice == 2 && participants.size() >= 3 && (hasHogwarts && hasBeauxbatons && hasDurmstrang))  {
            // Pick a student from Hogwarts
            drawParticipant(participants, "Hogwarts");
            // Pick a student from Beauxbatons
            drawParticipant(participants, "Beauxbatons");
            // Pick a student from Durmstrang
            drawParticipant(participants, "Durmstrang");
            // Mentioning Harry Potter
            // cout << "Harry Potter, (14) from Hogwarts" << endl;
        }
        else if (choice == 2) {
            cout << "Not enough participants" << endl;
        }
    } // while(1)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x8(%rsp)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2130
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movq $0x0, 0x20(%rsp)
movb %bl, (%rax)
leaq 0x7(%rsp), %r14
leaq 0x14(%rsp), %r15
movq 0x3aa8(%rip), %r12      # 0x5fd0
movq 0x3ab1(%rip), %rbp      # 0x5fe0
leaq 0x1bfc(%rip), %r13      # 0x4132
movl $0x0, (%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3544
movl 0x14(%rsp), %eax
cmpl $0x1, %eax
jne 0x27d6
movl $0x2f, %edx
movq %r12, %rdi
leaq 0x1a97(%rip), %rsi      # 0x4004
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20b0
movq %rbp, %rdi
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movl $0xa, %edx
callq 0x20c0
movl $0x90, %edx
cmpl $0x11, 0x10(%rsp)
leaq 0x1a65(%rip), %rsi      # 0x4034
jl 0x27a1
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x17, %edx
movq %r12, %rdi
leaq 0x1ab9(%rip), %rsi      # 0x40c5
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %edx
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x21f0
cmpq $0x0, 0x50(%rsp)
je 0x2795
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x19, %edx
movq %r12, %rdi
leaq 0x1a54(%rip), %rsi      # 0x40f5
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %edx
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x21f0
movl $0x19, %edx
cmpq $0x0, 0x30(%rsp)
leaq 0x1a0a(%rip), %rsi      # 0x410f
je 0x27a1
leaq 0xe8(%rsp), %r13
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
leaq 0x19df(%rip), %rsi      # 0x4129
callq 0x2060
testl %eax, %eax
je 0x2a00
movq %rbx, %rdi
leaq 0x19d1(%rip), %rsi      # 0x4132
callq 0x2060
testl %eax, %eax
je 0x2a09
movq %rbx, %rdi
leaq 0x19c6(%rip), %rsi      # 0x413e
callq 0x2060
testl %eax, %eax
movl (%rsp), %ecx
movzbl %cl, %ecx
movl $0x1, %eax
cmovel %eax, %ecx
movl %ecx, (%rsp)
jmp 0x2a10
movl $0x17, %edx
leaq 0x193c(%rip), %rsi      # 0x40dd
movq %r12, %rdi
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
jmp 0x2546
testl %eax, %eax
je 0x2adb
cmpl $0x2, %eax
jne 0x2546
movq 0x8(%rsp), %rdx
movq 0x8(%rdx), %rcx
subq (%rdx), %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
cmpq $0x3, %rcx
jb 0x29b6
testb $0x1, 0x20(%rsp)
je 0x29b6
testb $0x1, 0x18(%rsp)
je 0x29b6
testb $0x1, (%rsp)
je 0x29b6
leaq 0x138(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2cee
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x18c6(%rip), %rsi      # 0x4129
leaq 0x18c7(%rip), %rdx      # 0x4131
callq 0x3240
leaq 0x138(%rsp), %rsi
movq %rbx, %rdx
callq 0x23e2
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x28a4
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x138(%rsp), %rdi
callq 0x2c82
leaq 0x120(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2cee
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x1855(%rip), %rdx      # 0x413d
callq 0x3240
leaq 0x120(%rsp), %rsi
movq %rbx, %rdx
callq 0x23e2
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x2922
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x120(%rsp), %rdi
callq 0x2c82
leaq 0x108(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2cee
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
leaq 0x17db(%rip), %rsi      # 0x413e
leaq 0x17de(%rip), %rdx      # 0x4148
callq 0x3240
leaq 0x108(%rsp), %rsi
movq %rbx, %rdx
callq 0x23e2
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x29a4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x108(%rsp), %rdi
callq 0x2c82
jmp 0x2546
cmpl $0x2, %eax
jne 0x2546
movl $0x17, %edx
movq %r12, %rdi
leaq 0x177b(%rip), %rsi      # 0x4149
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
jmp 0x2546
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x2a10
movb $0x1, %al
movq %rax, 0x18(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x2d92
movl 0x10(%rsp), %ebx
leaq 0xf8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x2d92
leaq 0x150(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl %ebx, %edx
movq %r13, %rcx
callq 0x32f0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2a96
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
leaq 0x150(%rsp), %rbx
je 0x2aba
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2cc4
movq %rbx, %rdi
callq 0x3374
leaq 0x165c(%rip), %r13      # 0x4132
jmp 0x2546
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2af7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2b13
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c3f
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b6c
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2b6c
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x3374
jmp 0x2c42
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2c42
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c42
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2bbe
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2bbe
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x2c34
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x2bf5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2bf5
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
jmp 0x2c34
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x2c2c
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c2c
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x2c82
jmp 0x2c42
jmp 0x2c3f
jmp 0x2c3f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2c5e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c7a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x21d0