// File: /workspace/github_cpp_makefile_star2_O1/PepiJK[P]Mail-Server-Client/src/myhelper/myhelper.cpp
// Function: MyHelper::checkServerArguments(int, char**)
void MyHelper::checkServerArguments(int argc, char *argv[])
{
    if (argc < 3)
    {
        cout << "Usage: " << argv[0] << " <port> <directory>" << endl;
        exit(EXIT_FAILURE);
    }

    if (!stringIsInt(argv[1]) || stoi(argv[1]) < 1024 || stoi(argv[1]) > 65535)
    {
        cout << "Invalid port" << endl;
        exit(EXIT_FAILURE);
    }

    if (opendir(argv[2]) == NULL)
    {
        perror("directory error");
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
cmpl $0x2, %esi
jle 0x3942
movq 0x8(%rbx), %rsi
leaq 0x50(%rsp), %r14
leaq 0xb(%rsp), %rdx
movq %r14, %rdi
callq 0x4060
movq %r14, %rsi
callq 0x3a4a
movl %eax, %ebp
movb $0x1, %r13b
testb %al, %al
je 0x3849
movq 0x8(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x4060
movq 0x30(%rsp), %r15
callq 0x3040
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%r14)
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x3390
cmpq %r15, (%r12)
je 0x3996
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x39a2
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x39a2
testl %ecx, %ecx
jne 0x3842
movl 0xc(%rsp), %ecx
movl %ecx, (%r14)
cmpl $0x400, %eax            # imm = 0x400
jge 0x384d
xorl %eax, %eax
jmp 0x38c6
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x9(%rsp), %rdx
callq 0x4060
movq 0x10(%rsp), %r15
movl (%r14), %r13d
movl $0x0, (%r14)
leaq 0x70(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x3390
cmpq %r15, (%r12)
je 0x39ae
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0x39ba
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x39ba
testl %ecx, %ecx
jne 0x38bb
movl %r13d, (%r14)
cmpl $0x10000, %eax          # imm = 0x10000
setge %r13b
movb $0x1, %al
testb %al, %al
je 0x38e5
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38e5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3300
testb %bpl, %bpl
je 0x3905
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3905
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3300
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3920
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3300
testb %r13b, %r13b
jne 0x396c
movq 0x10(%rbx), %rdi
callq 0x33f0
testq %rax, %rax
je 0x3991
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x768f(%rip), %rdi      # 0xafd8
leaq 0x46b4(%rip), %rsi      # 0x8004
callq 0x32e0
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x32e0
leaq 0x46a5(%rip), %rsi      # 0x800c
movq %rax, %rdi
jmp 0x397a
movq 0x7665(%rip), %rdi      # 0xafd8
leaq 0x46a6(%rip), %rsi      # 0x8020
callq 0x32e0
movq %rax, %rdi
callq 0x3190
movl $0x1, %edi
callq 0x3370
callq 0x3520
leaq 0x46bf(%rip), %rdi      # 0x805c
callq 0x31c0
leaq 0x46b3(%rip), %rdi      # 0x805c
callq 0x33b0
leaq 0x46a7(%rip), %rdi      # 0x805c
callq 0x31c0
leaq 0x469b(%rip), %rdi      # 0x805c
callq 0x33b0
movq %rax, %rbx
jmp 0x3a06
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x39d7
movl %r13d, (%r14)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a06
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x3a06
jmp 0x3a23
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x3a06
movl 0xc(%rsp), %eax
movl %eax, (%r14)
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a26
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x3a26
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a41
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x34a0
nop