// File: /workspace/github_cpp_makefile_star2_O3/tbonelaforge[P]gradebook/Main.cpp
// Function: handleAddStudent(Gradebook&)
void handleAddStudent(Gradebook &gradebook) {
    string firstName, lastName;
    int studentId;
    cout << "Enter the new student's first and last name: " << endl;
    cin >> firstName;
    while (firstName.length() > 20){
      cout<< "Error, too many characters, please shorten to less than 20"<<endl;
      cout << "Enter the new student's first name: " << endl;
      cin >> firstName;
    }

    cin >> lastName;
    while (lastName.length() > 20){
      cout<< "Error, too many characters, please shorten to less than 20"<<endl;
      cout << "Enter the new student's last name: " << endl;
      cin >> lastName;
    }

    cout << "Enter the new student's ID number: " << endl;
    cin >> studentId;
    while (studentId>9999 || studentId<1){
      cout<< " Error please enter a value between 1-9999"<< endl;
      cout << "Enter the new student's ID number: " << endl;
      cin >> studentId;
    }

    cout << "Adding " << firstName << " " << lastName << " (" << studentId << ") to the gradebook" << endl;
    try {
        Student * newStudent = gradebook.addStudent(studentId, firstName, lastName);
        cout << "Successfully added student " << newStudent->getId() << ": "
             << newStudent->getFirstName() << " " << newStudent->getLastName() << endl;
        saveGrades(gradebook);
    } catch (const string& reason) {
        cout << "Unable to add new student: " << endl << reason << endl;
    }
    transLog << "Added " << firstName << " " << lastName << " id " << studentId << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, -0x78(%rbp)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq 0x8cd4(%rip), %rbx      # 0xcfc8
leaq 0x5348(%rip), %rsi      # 0x9643
movl $0x2d, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x8ca2(%rip), %r14      # 0xcfc8
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq 0x8ca3(%rip), %rdi      # 0xcfe0
leaq -0x70(%rbp), %rsi
callq 0x2250
leaq 0x5324(%rip), %r15      # 0x9671
leaq 0x5358(%rip), %rbx      # 0x96ac
movq 0x8c85(%rip), %r12      # 0xcfe0
leaq -0x70(%rbp), %r13
cmpq $0x15, -0x68(%rbp)
jb 0x43e4
movl $0x3a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0x24, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2250
jmp 0x435f
movq 0x8bf5(%rip), %rdi      # 0xcfe0
leaq -0x50(%rbp), %rsi
callq 0x2250
leaq 0x5276(%rip), %r15      # 0x9671
leaq 0x52cf(%rip), %rbx      # 0x96d1
movq 0x8bd7(%rip), %r12      # 0xcfe0
leaq -0x50(%rbp), %r13
cmpq $0x15, -0x48(%rbp)
jb 0x4492
movl $0x3a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0x23, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2250
jmp 0x440d
movq 0x8b2f(%rip), %rbx      # 0xcfc8
leaq 0x5255(%rip), %rsi      # 0x96f5
movl $0x23, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x8afd(%rip), %r14      # 0xcfc8
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq 0x8afe(%rip), %rdi      # 0xcfe0
leaq -0x2c(%rbp), %rsi
callq 0x2110
movl $0xffffd8f0, %r15d      # imm = 0xFFFFD8F0
leaq 0x51fd(%rip), %r12      # 0x96f5
movq 0x8ae1(%rip), %r13      # 0xcfe0
leaq -0x2c(%rbp), %rbx
movl -0x2c(%rbp), %eax
addl %r15d, %eax
cmpl %r15d, %eax
ja 0x4594
movl $0x2a, %edx
movq %r14, %rdi
leaq 0x51f8(%rip), %rsi      # 0x9719
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0x23, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2110
jmp 0x4503
movq 0x8a2d(%rip), %rdi      # 0xcfc8
leaq 0x51a2(%rip), %rsi      # 0x9744
movl $0x7, %edx
callq 0x2210
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x8a0d(%rip), %rdi      # 0xcfc8
callq 0x2210
movq %rax, %rbx
leaq 0x4d5d(%rip), %rsi      # 0x9327
movl $0x1, %edx
movq %rax, %rdi
callq 0x2210
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0x515b(%rip), %rsi      # 0x974c
movl $0x2, %edx
movq %rax, %rdi
callq 0x2210
movl -0x2c(%rbp), %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %rbx
leaq 0x513c(%rip), %rsi      # 0x974f
movl $0x12, %edx
movq %rax, %rdi
callq 0x2210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl -0x2c(%rbp), %ebx
leaq -0xe8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x50a6
leaq -0xc8(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x50a6
leaq -0xf8(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
movq -0x78(%rbp), %rdi
movl %ebx, %esi
callq 0x5330
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0x46c6
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0xf8(%rbp), %rdi
cmpq %r15, %rdi
je 0x46e1
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x88e0(%rip), %rdi      # 0xcfc8
leaq 0x5073(%rip), %rsi      # 0x9762
movl $0x1b, %edx
callq 0x2210
movq %r14, %rdi
callq 0x62b6
movq 0x88c0(%rip), %rdi      # 0xcfc8
movl %eax, %esi
callq 0x2300
movq %rax, %rbx
leaq 0x49d5(%rip), %rsi      # 0x90ee
movl $0x2, %edx
movq %rax, %rdi
callq 0x2210
leaq -0xb8(%rbp), %rdi
movq %r14, %rsi
callq 0x62c0
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq %rbx, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0x4bd2(%rip), %rsi      # 0x9327
movl $0x1, %edx
movq %rax, %rdi
callq 0x2210
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x62ee
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %rbx, %rdi
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47d0
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21d0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47ef
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x78(%rbp), %rdi
callq 0x256c
leaq 0x89e9(%rip), %rdi      # 0xd1e8
leaq 0x4f94(%rip), %rsi      # 0x979a
movl $0x6, %edx
callq 0x2210
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq 0x89c9(%rip), %rdi      # 0xd1e8
callq 0x2210
movq %rax, %rbx
leaq 0x4af9(%rip), %rsi      # 0x9327
movl $0x1, %edx
movq %rax, %rdi
callq 0x2210
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0x4f4c(%rip), %rsi      # 0x97a1
movl $0x4, %edx
movq %rax, %rdi
callq 0x2210
movl -0x2c(%rbp), %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x48b0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x48c9
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4920
jmp 0x496e
movq %rdx, %r14
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0x490b
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21d0
jmp 0x490b
movq %rdx, %r14
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r15, %rdi
je 0x4974
movq -0xe8(%rbp), %rsi
jmp 0x4964
movq %rdx, %r14
movq %rax, %rbx
jmp 0x494d
movq %rdx, %r14
movq %rax, %rbx
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x494d
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21d0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4974
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21d0
jmp 0x4974
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x49e7
movq %rbx, %rdi
callq 0x20a0
movq %rax, %rbx
movq 0x863c(%rip), %rdi      # 0xcfc8
leaq 0x4deb(%rip), %rsi      # 0x977e
movl $0x1b, %edx
callq 0x2210
movq 0x8624(%rip), %rdi      # 0xcfc8
callq 0x20d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20d0
callq 0x22c0
jmp 0x47f8
jmp 0x49e4
movq %rax, %rbx
callq 0x22c0
jmp 0x49e7
movq %rax, %rdi
callq 0x5097
jmp 0x49e4
jmp 0x49e4
jmp 0x49e4
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4a00
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4a19
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2310