// File: 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
movq %rsp, %rbp
subq $0xd0, %rsp
movq 0xb47e(%rip), %rdi      # 0x13fd0
leaq 0x584b(%rip), %rsi      # 0xe3a4
callq 0x3270
movq 0xb47b(%rip), %rdi      # 0x13fe0
leaq -0x4(%rbp), %rsi
callq 0x3170
cmpl $-0x1, -0x4(%rbp)
jne 0x8b8a
leaq 0x5680(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xd280
callq 0xd020
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0xb709(%rip), %rdi      # 0x142b0
callq 0x4860
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x8bf0
movslq -0xc(%rbp), %rsi
leaq 0xb6ed(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7630
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x8be3
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x8bf0
jmp 0x8be5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8b98
cmpl $-0x1, -0x8(%rbp)
je 0x8e90
movslq -0x8(%rbp), %rsi
leaq 0xb6ab(%rip), %rdi      # 0x142b0
movq %rdi, -0x80(%rbp)
callq 0x48b0
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x7670
movq -0x80(%rbp), %rdi
callq 0x6dc0
movq %rax, -0x40(%rbp)
movslq -0x8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8fa0
movq %rax, -0x38(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9050
movq -0x80(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x8fe0
movq %rax, -0x78(%rbp)
jmp 0x8c58
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x4(%rbp), %esi
movq 0xb366(%rip), %rdi      # 0x13fd0
callq 0x3450
movq %rax, -0x88(%rbp)
jmp 0x8c78
movl $0x19, %edi
callq 0x4890
movl %eax, -0x8c(%rbp)
jmp 0x8c8a
movq -0x88(%rbp), %rdi
movl -0x8c(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %esi
callq 0x32f0
movq %rax, -0x98(%rbp)
jmp 0x8cab
movq -0x98(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3260
movq %rax, -0xa0(%rbp)
jmp 0x8cc4
movq -0xa0(%rbp), %rdi
movq 0xb2e6(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x8cd9
movq 0xb2f0(%rip), %rdi      # 0x13fd0
leaq 0x56e7(%rip), %rsi      # 0xe3ce
callq 0x3270
movq %rax, -0xa8(%rbp)
jmp 0x8cf5
movq -0xa8(%rbp), %rdi
movq 0xb2b5(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq %rax, -0xb0(%rbp)
jmp 0x8d11
movq -0xb0(%rbp), %rdi
movq 0xb299(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x8d26
callq 0x5060
jmp 0x8d2d
jmp 0x8d2f
movq 0xb29a(%rip), %rdi      # 0x13fd0
leaq 0x569a(%rip), %rsi      # 0xe3d7
callq 0x3270
movq %rax, -0xb8(%rbp)
jmp 0x8d4b
movq -0xb8(%rbp), %rdi
movq 0xb25f(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x8d60
movq 0xb269(%rip), %rdi      # 0x13fd0
leaq 0x54e4(%rip), %rsi      # 0xe252
callq 0x3270
movq %rax, -0xc0(%rbp)
jmp 0x8d7c
movq -0xc0(%rbp), %rdi
movq 0xb22e(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x8d91
movq 0xb248(%rip), %rdi      # 0x13fe0
leaq -0x68(%rbp), %rsi
callq 0x3170
jmp 0x8da3
cmpl $-0x1, -0x68(%rbp)
jne 0x8de1
leaq 0x544b(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x8db7
callq 0xd280
jmp 0x8dbe
callq 0xd020
jmp 0x8dc5
jmp 0x8de1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3180
jmp 0x8ed1
movl -0x68(%rbp), %eax
movl %eax, -0xc4(%rbp)
subl $0x1, %eax
je 0x8dfe
jmp 0x8df1
movl -0xc4(%rbp), %eax
subl $0x2, %eax
je 0x8e1c
jmp 0x8e3a
leaq 0x53f6(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x8e0c
callq 0x8ee0
jmp 0x8e13
callq 0x8b40
jmp 0x8e1a
jmp 0x8e85
leaq 0x53d8(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x8e2a
callq 0xd280
jmp 0x8e31
callq 0xd020
jmp 0x8e38
jmp 0x8e85
leaq 0x53ba(%rip), %rdi      # 0xe1fb
callq 0x3230
jmp 0x8e48
callq 0x8ee0
jmp 0x8e4f
movq 0xb17a(%rip), %rdi      # 0x13fd0
leaq 0x5400(%rip), %rsi      # 0xe25d
callq 0x3270
movq %rax, -0xd0(%rbp)
jmp 0x8e6b
movq -0xd0(%rbp), %rdi
movq 0xb13f(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0x8e80
jmp 0x8d2f
leaq -0x30(%rbp), %rdi
callq 0x3180
jmp 0x8ec8
leaq 0x5364(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0x8ee0
movq 0xb128(%rip), %rdi      # 0x13fd0
leaq 0x553a(%rip), %rsi      # 0xe3e9
callq 0x3270
movq %rax, %rdi
movq 0xb0fa(%rip), %rsi      # 0x13fb8
callq 0x32a0
callq 0x8b40
addq $0xd0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3460
nopw (%rax,%rax)