// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x8(%rsp)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2130
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movq $0x0, 0x28(%rsp)
movb %bl, (%rax)
leaq 0x7(%rsp), %r14
leaq 0x34(%rsp), %r15
movq 0x3a9e(%rip), %r12      # 0x5fd0
movq 0x3aa7(%rip), %rbp      # 0x5fe0
leaq 0xf8(%rsp), %r13
leaq 0x1bea(%rip), %rbx      # 0x4132
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3574
movl 0x34(%rsp), %eax
cmpl $0x1, %eax
jne 0x27e0
movl $0x2f, %edx
movq %r12, %rdi
leaq 0x1a83(%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 0x14(%rsp), %rsi
callq 0x20b0
movq %rbp, %rdi
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movl $0xa, %edx
callq 0x20c0
movl $0x90, %edx
cmpl $0x11, 0x14(%rsp)
leaq 0x1a51(%rip), %rsi      # 0x4034
jl 0x27ab
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 0x1aa5(%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 0x58(%rsp), %rsi
callq 0x21f0
cmpq $0x0, 0x60(%rsp)
je 0x279f
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 0x1a40(%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 0x38(%rsp), %rsi
callq 0x21f0
movl $0x19, %edx
cmpq $0x0, 0x40(%rsp)
leaq 0x19f6(%rip), %rsi      # 0x410f
je 0x27ab
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 0x38(%rsp), %rbx
movq %rbx, %rdi
leaq 0x19d3(%rip), %rsi      # 0x4129
callq 0x2060
testl %eax, %eax
je 0x286f
movq %rbx, %rdi
leaq 0x19c5(%rip), %rsi      # 0x4132
callq 0x2060
testl %eax, %eax
je 0x2878
movq %rbx, %rdi
leaq 0x19ba(%rip), %rsi      # 0x413e
callq 0x2060
testl %eax, %eax
sete %al
movq 0x18(%rsp), %rcx
orb %al, %cl
movq %rcx, 0x18(%rsp)
jmp 0x287f
movl $0x17, %edx
leaq 0x1932(%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 0x255a
testl %eax, %eax
je 0x2af5
cmpl $0x2, %eax
jne 0x255a
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rax
cmpq $0x3, %rax
setae %al
movq 0x28(%rsp), %rcx
andb 0x20(%rsp), %cl
andb 0x18(%rsp), %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x295f
movl $0x17, %edx
movq %r12, %rdi
leaq 0x190c(%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 0x255a
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0x287f
movb $0x1, %al
movq %rax, 0x20(%rsp)
leaq 0xe8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0x2dac
movl 0x14(%rsp), %ebx
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x2dac
leaq 0x160(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movl %ebx, %edx
movq %r13, %rcx
callq 0x3320
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x2911
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x160(%rsp), %rbx
je 0x293e
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2cde
movq %rbx, %rdi
callq 0x33a4
leaq 0x17d8(%rip), %rbx      # 0x4132
jmp 0x255a
leaq 0x148(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2d08
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x1799(%rip), %rsi      # 0x4129
leaq 0x179a(%rip), %rdx      # 0x4131
callq 0x3268
leaq 0x148(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x23e2
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x29d6
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x148(%rsp), %rdi
callq 0x2c96
leaq 0x130(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2d08
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
leaq 0x1726(%rip), %rdx      # 0x413d
callq 0x3268
leaq 0x130(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x23e2
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2a56
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x130(%rsp), %rdi
callq 0x2c96
leaq 0x118(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2d08
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x16b0(%rip), %rsi      # 0x413e
leaq 0x16b3(%rip), %rdx      # 0x4148
callq 0x3268
leaq 0x118(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x23e2
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2ace
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x118(%rsp), %rdi
callq 0x2c96
movb $0x1, %al
movq %rax, 0x28(%rsp)
movb $0x1, %al
movq %rax, 0x18(%rsp)
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x255a
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2b11
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2b2d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b69
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2b69
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x2bdf
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2ba0
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2ba0
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x2bdf
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x2bd7
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2bd7
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x2c96
jmp 0x2c55
jmp 0x2c52
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x2c27
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c27
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x33a4
jmp 0x2c55
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x2c55
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c55
jmp 0x2c52
jmp 0x2c52
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2c71
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2c8d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x21d0
nop