// File: TasnimAnas[P]Attendance-Management-System/src/StudentAdd.cpp
// Function: StudentAdd()
void StudentAdd()
{
    int roll;
    string name;
    cout << "Enter student roll: ";
    cin >> roll;
    if (roll == -1)
    {
        system("CLS");
        userHomeHeader();
        userHome();
    }
    for (int i = 0; i < ::Student.size(); i++)
    {
        if (roll == ::Student[i].getRoll())
        {
            system("CLS");
            StudentAddHeader();
            cout << "Roll " << roll << " already exist." << endl;
            cout << "Try another..." << endl;
            StudentAdd();
        }
    }
    cout << "Enter student name: ";
    cin.ignore();
    getline(cin, name);
    if (name == "-1")
    {
        system("CLS");
        userHomeHeader();
        userHome();
    }
    add(roll, name);
    SortStudentList();
    system("CLS");
    StudentAddHeader();
    cout << roll;
    cout << setw(25) << name << endl;
    cout << "Added!" << endl
         << endl;
    writeSorted();
input:
    cout
        << "1. Add another"
        << endl;
    cout << "2. Go back" << endl;
    int StdAddSelection;
    cin >> StdAddSelection;
    if (StdAddSelection == -1)
    {
        system("CLS");
        userHomeHeader();
        userHome();
    }
    switch (StdAddSelection)
    {
    case 1:
        system("CLS");
        StudentAddHeader();
        StudentAdd();
        break;
    case 2:
        system("CLS");
        userHomeHeader();
        userHome();
        break;
    default:
        system("CLS");
        StudentAddHeader();
        cout << "Invalid selection! Try again: " << endl;
        goto input;
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
leaq -0x28(%rbp), %rdi
callq 0x3380
movq 0xf6e5(%rip), %rdi      # 0x13fd0
leaq 0x98f4(%rip), %rsi      # 0xe1e6
callq 0x3270
jmp 0x48f9
movq 0xf6e0(%rip), %rdi      # 0x13fe0
leaq -0x4(%rbp), %rsi
callq 0x3170
jmp 0x490b
cmpl $-0x1, -0x4(%rbp)
jne 0x4940
leaq 0x98e3(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x491f
callq 0xd280
jmp 0x4926
callq 0xd020
jmp 0x492d
jmp 0x4940
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4d49
movl $0x0, -0x38(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0xf95a(%rip), %rdi      # 0x142b0
callq 0x4860
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jae 0x4a54
movl -0x4(%rbp), %eax
movl %eax, -0x70(%rbp)
movslq -0x38(%rbp), %rsi
leaq 0xf934(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7630
movl %eax, -0x6c(%rbp)
jmp 0x498e
movl -0x70(%rbp), %eax
movl -0x6c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4a44
leaq 0x9858(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x49aa
callq 0x4d60
jmp 0x49b1
movq 0xf618(%rip), %rdi      # 0x13fd0
leaq 0x9840(%rip), %rsi      # 0xe1ff
callq 0x3270
movq %rax, -0x78(%rbp)
jmp 0x49ca
movq -0x78(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x3450
movq %rax, -0x80(%rbp)
jmp 0x49dc
movq -0x80(%rbp), %rdi
leaq 0x981e(%rip), %rsi      # 0xe205
callq 0x3270
movq %rax, -0x88(%rbp)
jmp 0x49f5
movq -0x88(%rbp), %rdi
movq 0xf5b5(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4a0a
movq 0xf5bf(%rip), %rdi      # 0x13fd0
leaq 0x97fd(%rip), %rsi      # 0xe215
callq 0x3270
movq %rax, -0x90(%rbp)
jmp 0x4a26
movq -0x90(%rbp), %rdi
movq 0xf584(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4a3b
callq 0x48d0
jmp 0x4a42
jmp 0x4a44
jmp 0x4a46
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4947
movq 0xf575(%rip), %rdi      # 0x13fd0
leaq 0x97c2(%rip), %rsi      # 0xe224
callq 0x3270
jmp 0x4a69
movq 0xf570(%rip), %rdi      # 0x13fe0
callq 0x34b0
jmp 0x4a77
movq 0xf562(%rip), %rdi      # 0x13fe0
leaq -0x28(%rbp), %rsi
callq 0x3070
jmp 0x4a89
leaq 0x97a9(%rip), %rsi      # 0xe239
leaq -0x28(%rbp), %rdi
callq 0x51e0
movb %al, -0x91(%rbp)
jmp 0x4aa1
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x4aad
jmp 0x4acb
leaq 0x9747(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4abb
callq 0xd280
jmp 0x4ac2
callq 0xd020
jmp 0x4ac9
jmp 0x4acb
movl -0x4(%rbp), %eax
movl %eax, -0x98(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3100
jmp 0x4ae3
movl -0x98(%rbp), %edi
leaq -0x58(%rbp), %rsi
callq 0x4e20
jmp 0x4af4
leaq -0x58(%rbp), %rdi
callq 0x3180
callq 0x4ef0
jmp 0x4b04
leaq 0x96f0(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4b12
callq 0x4d60
jmp 0x4b19
movl -0x4(%rbp), %esi
movq 0xf4ad(%rip), %rdi      # 0x13fd0
callq 0x3450
jmp 0x4b2a
movl $0x19, %edi
callq 0x4890
movl %eax, -0x9c(%rbp)
jmp 0x4b3c
movl -0x9c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %esi
movq 0xf481(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, -0xa8(%rbp)
jmp 0x4b5d
movq -0xa8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3260
movq %rax, -0xb0(%rbp)
jmp 0x4b76
movq -0xb0(%rbp), %rdi
movq 0xf434(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4b8b
movq 0xf43e(%rip), %rdi      # 0x13fd0
leaq 0x96a3(%rip), %rsi      # 0xe23c
callq 0x3270
movq %rax, -0xb8(%rbp)
jmp 0x4ba7
movq -0xb8(%rbp), %rdi
movq 0xf403(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq %rax, -0xc0(%rbp)
jmp 0x4bc3
movq -0xc0(%rbp), %rdi
movq 0xf3e7(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4bd8
callq 0x5060
jmp 0x4bdf
jmp 0x4be1
movq 0xf3e8(%rip), %rdi      # 0x13fd0
leaq 0x9654(%rip), %rsi      # 0xe243
callq 0x3270
movq %rax, -0xc8(%rbp)
jmp 0x4bfd
movq -0xc8(%rbp), %rdi
movq 0xf3ad(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4c12
movq 0xf3b7(%rip), %rdi      # 0x13fd0
leaq 0x9632(%rip), %rsi      # 0xe252
callq 0x3270
movq %rax, -0xd0(%rbp)
jmp 0x4c2e
movq -0xd0(%rbp), %rdi
movq 0xf37c(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4c43
movq 0xf396(%rip), %rdi      # 0x13fe0
leaq -0x60(%rbp), %rsi
callq 0x3170
jmp 0x4c55
cmpl $-0x1, -0x60(%rbp)
jne 0x4c93
leaq 0x9599(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4c69
callq 0xd280
jmp 0x4c70
callq 0xd020
jmp 0x4c77
jmp 0x4c93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3180
jmp 0x4d49
movl -0x60(%rbp), %eax
movl %eax, -0xd4(%rbp)
subl $0x1, %eax
je 0x4cb0
jmp 0x4ca3
movl -0xd4(%rbp), %eax
subl $0x2, %eax
je 0x4cce
jmp 0x4cec
leaq 0x9544(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4cbe
callq 0x4d60
jmp 0x4cc5
callq 0x48d0
jmp 0x4ccc
jmp 0x4d37
leaq 0x9526(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4cdc
callq 0xd280
jmp 0x4ce3
callq 0xd020
jmp 0x4cea
jmp 0x4d37
leaq 0x9508(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x4cfa
callq 0x4d60
jmp 0x4d01
movq 0xf2c8(%rip), %rdi      # 0x13fd0
leaq 0x954e(%rip), %rsi      # 0xe25d
callq 0x3270
movq %rax, -0xe0(%rbp)
jmp 0x4d1d
movq -0xe0(%rbp), %rdi
movq 0xf28d(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x4d32
jmp 0x4be1
leaq -0x28(%rbp), %rdi
callq 0x3180
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3180
movq -0x30(%rbp), %rdi
callq 0x3460
nopl (%rax,%rax)