// File: /workspace/github_cpp_makefile_star2_O2/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, -0x38(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movq 0x77fd(%rip), %rdi      # 0xafc8
leaq 0x3e71(%rip), %rsi      # 0x7643
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq 0x77fa(%rip), %rdi      # 0xafe0
leaq -0x78(%rbp), %rsi
callq 0x2200
movq 0x77d2(%rip), %r14      # 0xafc8
leaq 0x3e74(%rip), %rbx      # 0x7671
leaq 0x3ea8(%rip), %r15      # 0x76ac
movq 0x77d5(%rip), %r12      # 0xafe0
leaq -0x78(%rbp), %r13
cmpq $0x15, -0x70(%rbp)
jb 0x3849
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2200
jmp 0x380f
movq 0x7790(%rip), %rdi      # 0xafe0
leaq -0x58(%rbp), %rsi
callq 0x2200
movq 0x7768(%rip), %r14      # 0xafc8
leaq 0x3e0a(%rip), %rbx      # 0x7671
leaq 0x3e63(%rip), %r15      # 0x76d1
movq 0x776b(%rip), %r12      # 0xafe0
leaq -0x58(%rbp), %r13
cmpq $0x15, -0x50(%rbp)
jb 0x38b3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2200
jmp 0x3879
movq 0x770e(%rip), %rdi      # 0xafc8
leaq 0x3e34(%rip), %rsi      # 0x76f5
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq 0x770b(%rip), %rdi      # 0xafe0
leaq -0x2c(%rbp), %rsi
callq 0x20e0
movl $0xffffd8f0, %r15d      # imm = 0xFFFFD8F0
movq 0x76dd(%rip), %r14      # 0xafc8
leaq 0x3e03(%rip), %r12      # 0x76f5
movq 0x76e7(%rip), %r13      # 0xafe0
leaq -0x2c(%rbp), %rbx
movl -0x2c(%rbp), %eax
addl %r15d, %eax
cmpl %r15d, %eax
ja 0x393f
movq %r14, %rdi
leaq 0x3e07(%rip), %rsi      # 0x7719
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x20e0
jmp 0x38fd
movq 0x7682(%rip), %rdi      # 0xafc8
leaq 0x3df7(%rip), %rsi      # 0x7744
callq 0x2170
leaq -0x78(%rbp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x39c2(%rip), %rsi      # 0x7327
movq %rax, %rdi
callq 0x2170
leaq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x3dcc(%rip), %rsi      # 0x774c
movq %rax, %rdi
callq 0x2170
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x22c0
leaq 0x3db5(%rip), %rsi      # 0x774f
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movl -0x2c(%rbp), %ebx
leaq -0xf8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2240
leaq -0xd8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2240
leaq -0xf8(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
movq -0x38(%rbp), %rdi
movl %ebx, %esi
callq 0x41f2
movq %rax, %r14
leaq -0xd8(%rbp), %rdi
callq 0x2358
leaq -0xf8(%rbp), %rdi
callq 0x2358
movq 0x75c0(%rip), %rdi      # 0xafc8
leaq 0x3d53(%rip), %rsi      # 0x7762
callq 0x2170
movq %rax, %rbx
movq %r14, %rdi
callq 0x4d38
movq %rbx, %rdi
movl %eax, %esi
callq 0x22c0
leaq 0x36be(%rip), %rsi      # 0x70ee
movq %rax, %rdi
callq 0x2170
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
movq %r14, %rsi
callq 0x4d42
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x38c7(%rip), %rsi      # 0x7327
movq %rax, %rdi
callq 0x2170
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x4d5e
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20b0
leaq -0x98(%rbp), %rdi
callq 0x2358
leaq -0xb8(%rbp), %rdi
callq 0x2358
movq -0x38(%rbp), %rdi
callq 0x255c
leaq 0x771f(%rip), %rdi      # 0xb1d8
leaq 0x3cda(%rip), %rsi      # 0x779a
callq 0x2170
leaq -0x78(%rbp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x384f(%rip), %rsi      # 0x7327
movq %rax, %rdi
callq 0x2170
leaq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x3cae(%rip), %rsi      # 0x77a1
movq %rax, %rdi
callq 0x2170
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x22c0
movq %rax, %rdi
callq 0x20b0
leaq -0x58(%rbp), %rdi
callq 0x2358
leaq -0x78(%rbp), %rdi
callq 0x2358
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b6d
jmp 0x3b81
movq %rdx, %r14
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x2358
jmp 0x3b50
movq %rdx, %r14
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0x3b7a
movq %rdx, %r14
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x2358
jmp 0x3b73
movq %rdx, %r14
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x2358
jmp 0x3b87
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x3bed
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
movq 0x7429(%rip), %rdi      # 0xafc8
leaq 0x3bd8(%rip), %rsi      # 0x777e
callq 0x2170
movq %rax, %rdi
callq 0x20b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20b0
callq 0x2280
jmp 0x3ab2
jmp 0x3bea
movq %rax, %rbx
callq 0x2280
jmp 0x3bed
movq %rax, %rdi
callq 0x4043
jmp 0x3bea
jmp 0x3bea
jmp 0x3bea
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2358
leaq -0x78(%rbp), %rdi
callq 0x2358
movq %rbx, %rdi
callq 0x22d0