// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/StudentRemove.cpp
// Function: StudentRemove()
void StudentRemove()
{
    cout << "Enter roll of the student to be removed: ";
    int removeRoll;
    cin >> removeRoll;
    if (removeRoll == -1)
    {
        system("CLS");
        userHomeHeader();
        userHome();
    }
    int position = -1;
    for (int i = 0; i < ::Student.size(); i++)
    {
        int stRoll = ::Student[i].getRoll();
        if (removeRoll == stRoll)
        {
            position = i;
            break;
        }
    }
    if (position != -1)
    {
        string Removedname = ::Student[position].getName();
        auto it = ::Student.begin() + position;
        ::Student.erase(it);
        cout << removeRoll << setw(25) << Removedname << endl;
        cout << "Removed!" << endl
             << endl;
        writeSorted();
    input:
        cout << "1. Remove another" << endl;
        cout << "2. Go back" << endl;
        int StdRemoveSelection;
        cin >> StdRemoveSelection;
        if (StdRemoveSelection == -1)
        {
            system("CLS");
            userHomeHeader();
            userHome();
        }
        switch (StdRemoveSelection)
        {
        case 1:
            system("CLS");
            StudentRemoveHeader();
            StudentRemove();
            break;
        case 2:
            system("CLS");
            userHomeHeader();
            userHome();
            break;
        default:
            system("CLS");
            StudentRemoveHeader();
            cout << "Invalid selection! Try again: " << endl;
            goto input;
            break;
        }
    }
    else
    {
        system("CLS");
        StudentRemoveHeader();
        cout << "Roll not found! Try again: " << endl;
        StudentRemove();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x6f9b(%rip), %rdi      # 0xafd0
leaq 0x3368(%rip), %rsi      # 0x73a4
callq 0x21d0
movq 0x6f98(%rip), %rdi      # 0xafe0
leaq 0x4(%rsp), %rbx
movq %rbx, %rsi
callq 0x2120
cmpl $-0x1, (%rbx)
jne 0x4070
leaq 0x319a(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x6472
callq 0x62a0
xorl %r14d, %r14d
leaq 0x717e(%rip), %rbx      # 0xb1f8
pushq $0x50
popq %r12
movabsq $0x100000000, %r13      # imm = 0x100000000
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
subq %rdi, %rax
cqto
idivq %r12
cmpq %rbp, %rax
jbe 0x40bb
addq %r14, %rdi
callq 0x39ec
cmpl %eax, 0x4(%rsp)
je 0x40f1
incq %rbp
addq %r13, %r15
addq $0x50, %r14
jmp 0x408d
leaq 0x3139(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x427a
movq 0x6efd(%rip), %rdi      # 0xafd0
leaq 0x330f(%rip), %rsi      # 0x73e9
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
callq 0x4020
jmp 0x4250
sarq $0x20, %r15
imulq $0x50, %r15, %r14
movq (%rbx), %rsi
addq %r14, %rsi
leaq 0x8(%rsp), %rdi
callq 0x39f6
addq (%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4300
movl 0x4(%rsp), %esi
movq 0x6eae(%rip), %rdi      # 0xafd0
callq 0x2320
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x19, 0x10(%rax,%rcx)
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
movq 0x6e7d(%rip), %rdi      # 0xafd0
leaq 0x3274(%rip), %rsi      # 0x73ce
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
callq 0x3261
movq 0x6e55(%rip), %rbx      # 0xafd0
leaq 0x3255(%rip), %r14      # 0x73d7
leaq 0x30c9(%rip), %r15      # 0x7252
movq 0x6e50(%rip), %r12      # 0xafe0
movq %rsp, %r13
leaq 0x3061(%rip), %rbp      # 0x71fb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2120
movl (%rsp), %eax
cmpl $-0x1, %eax
jne 0x41e8
movq %rbp, %rdi
callq 0x2190
callq 0x6472
callq 0x62a0
movl (%rsp), %eax
cmpl $0x2, %eax
je 0x4230
cmpl $0x1, %eax
je 0x4218
movq %rbp, %rdi
callq 0x2190
callq 0x427a
movq %rbx, %rdi
leaq 0x3054(%rip), %rsi      # 0x725d
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
jmp 0x419a
leaq 0x2fdc(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x427a
callq 0x4020
jmp 0x4246
leaq 0x2fc4(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x6472
callq 0x62a0
leaq 0x8(%rsp), %rdi
callq 0x20d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4265
jmp 0x4265
jmp 0x4265
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2330