// File: tbonelaforge[P]gradebook/Main.cpp
// Function: displayMenu(int, Gradebook&, bool)
void displayMenu(int state, Gradebook& gradebook, bool idMode) {
    switch (state) {
    case 0:
        cout << "WELCOME TO GRADEBOOK!" << endl;
        cout << "Type 'S' to setup a new semester." << endl;
        cout << "Type 'Q' to quit." << endl;
        break;
    case 1:
        cout << "GRADEBOOK MENU" << endl;
        cout << "Type 'S' to re-initialize the semester (all grades will be lost)." << endl;
        cout << "Type 'A' to add a new student." << endl;
        if (gradebook.getNumStudents() > 0) {
            cout << "Type 'P' to enter a program grade for all students." << endl;
            cout << "Type 'T' to enter a test grade for all students." << endl;          if (gradebook.getNumFinals() > 0) {
                cout << "Type 'F' to enter a final exam grade for all students." << endl;
            }
        }
        cout << "Type 'C' to change a grade for one student." << endl;
        cout << "Type 'G' to calculate and store the final grade for all students." << endl;
        cout << "Type 'O' to output the grade data." << endl;
        cout << "Type 'M' to toggle the output mode (currently " << ((idMode) ? "by Id)" : "by Name)") << endl;
        cout << "Type 'Q' to quit" << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
testl %eax, %eax
je 0x579f
jmp 0x5792
movl -0x18(%rbp), %eax
subl $0x1, %eax
je 0x580a
jmp 0x59be
movq 0x8822(%rip), %rdi      # 0xdfc8
leaq 0x4ff9(%rip), %rsi      # 0xa7a6
callq 0x3220
movq %rax, %rdi
movq 0x87ec(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8800(%rip), %rdi      # 0xdfc8
leaq 0x4fed(%rip), %rsi      # 0xa7bc
callq 0x3220
movq %rax, %rdi
movq 0x87ca(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x87de(%rip), %rdi      # 0xdfc8
leaq 0x4fed(%rip), %rsi      # 0xa7de
callq 0x3220
movq %rax, %rdi
movq 0x87a8(%rip), %rsi      # 0xdfa8
callq 0x3250
jmp 0x59be
movq 0x87b7(%rip), %rdi      # 0xdfc8
leaq 0x4fd8(%rip), %rsi      # 0xa7f0
callq 0x3220
movq %rax, %rdi
movq 0x8781(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8795(%rip), %rdi      # 0xdfc8
leaq 0x4fc5(%rip), %rsi      # 0xa7ff
callq 0x3220
movq %rax, %rdi
movq 0x875f(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8773(%rip), %rdi      # 0xdfc8
leaq 0x4fe5(%rip), %rsi      # 0xa841
callq 0x3220
movq %rax, %rdi
movq 0x873d(%rip), %rsi      # 0xdfa8
callq 0x3250
movq -0x10(%rbp), %rdi
callq 0x6740
cmpl $0x0, %eax
jle 0x58f4
movq 0x8743(%rip), %rdi      # 0xdfc8
leaq 0x4fd4(%rip), %rsi      # 0xa860
callq 0x3220
movq %rax, %rdi
movq 0x870d(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8721(%rip), %rdi      # 0xdfc8
leaq 0x4fe6(%rip), %rsi      # 0xa894
callq 0x3220
movq %rax, %rdi
movq 0x86eb(%rip), %rsi      # 0xdfa8
callq 0x3250
movq -0x10(%rbp), %rdi
callq 0x6130
cmpl $0x0, %eax
jle 0x58f2
movq 0x86f1(%rip), %rdi      # 0xdfc8
leaq 0x4fe7(%rip), %rsi      # 0xa8c5
callq 0x3220
movq %rax, %rdi
movq 0x86bb(%rip), %rsi      # 0xdfa8
callq 0x3250
jmp 0x58f4
movq 0x86cd(%rip), %rdi      # 0xdfc8
leaq 0x4ffa(%rip), %rsi      # 0xa8fc
callq 0x3220
movq %rax, %rdi
movq 0x8697(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x86ab(%rip), %rdi      # 0xdfc8
leaq 0x5004(%rip), %rsi      # 0xa928
callq 0x3220
movq %rax, %rdi
movq 0x8675(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8689(%rip), %rdi      # 0xdfc8
leaq 0x5024(%rip), %rsi      # 0xa96a
callq 0x3220
movq %rax, %rdi
movq 0x8653(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8667(%rip), %rdi      # 0xdfc8
leaq 0x5025(%rip), %rsi      # 0xa98d
callq 0x3220
movq %rax, %rdi
movb -0x11(%rbp), %cl
leaq 0x5049(%rip), %rsi      # 0xa9c3
leaq 0x503b(%rip), %rax      # 0xa9bc
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x3220
movq %rax, %rdi
movq 0x8611(%rip), %rsi      # 0xdfa8
callq 0x3250
movq 0x8625(%rip), %rdi      # 0xdfc8
leaq 0x5022(%rip), %rsi      # 0xa9cc
callq 0x3220
movq %rax, %rdi
movq 0x85ef(%rip), %rsi      # 0xdfa8
callq 0x3250
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)