// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/apps/parasail_aligner.cpp
// Function: posix_signal_handler(int, siginfo_t*, void*)
void posix_signal_handler(int sig, siginfo_t *siginfo, void *context)
{
    (void)context;
    switch (sig)
    {
    case SIGSEGV:
        fputs("Caught SIGSEGV: Segmentation Fault\n", stderr);
        break;
    case SIGINT:
        fputs("Caught SIGINT: Interactive attention signal, (usually ctrl+c)\n", stderr);
        break;
    case SIGFPE:
        switch (siginfo->si_code)
        {
        case FPE_INTDIV:
            fputs("Caught SIGFPE: (integer divide by zero)\n", stderr);
            break;
        case FPE_INTOVF:
            fputs("Caught SIGFPE: (integer overflow)\n", stderr);
            break;
        case FPE_FLTDIV:
            fputs("Caught SIGFPE: (floating-point divide by zero)\n", stderr);
            break;
        case FPE_FLTOVF:
            fputs("Caught SIGFPE: (floating-point overflow)\n", stderr);
            break;
        case FPE_FLTUND:
            fputs("Caught SIGFPE: (floating-point underflow)\n", stderr);
            break;
        case FPE_FLTRES:
            fputs("Caught SIGFPE: (floating-point inexact result)\n", stderr);
            break;
        case FPE_FLTINV:
            fputs("Caught SIGFPE: (floating-point invalid operation)\n", stderr);
            break;
        case FPE_FLTSUB:
            fputs("Caught SIGFPE: (subscript out of range)\n", stderr);
            break;
        default:
            fputs("Caught SIGFPE: Arithmetic Exception\n", stderr);
            break;
        }
    case SIGILL:
        switch (siginfo->si_code)
        {
        case ILL_ILLOPC:
            fputs("Caught SIGILL: (illegal opcode)\n", stderr);
            break;
        case ILL_ILLOPN:
            fputs("Caught SIGILL: (illegal operand)\n", stderr);
            break;
        case ILL_ILLADR:
            fputs("Caught SIGILL: (illegal addressing mode)\n", stderr);
            break;
        case ILL_ILLTRP:
            fputs("Caught SIGILL: (illegal trap)\n", stderr);
            break;
        case ILL_PRVOPC:
            fputs("Caught SIGILL: (privileged opcode)\n", stderr);
            break;
        case ILL_PRVREG:
            fputs("Caught SIGILL: (privileged register)\n", stderr);
            break;
        case ILL_COPROC:
            fputs("Caught SIGILL: (coprocessor error)\n", stderr);
            break;
        case ILL_BADSTK:
            fputs("Caught SIGILL: (internal stack error)\n", stderr);
            break;
        default:
            fputs("Caught SIGILL: Illegal Instruction\n", stderr);
            break;
        }
        break;
    case SIGTERM:
        fputs("Caught SIGTERM: a termination request was sent to the program\n", stderr);
        break;
    case SIGABRT:
        fputs("Caught SIGABRT: usually caused by an abort() or assert()\n", stderr);
        break;
    default:
        break;
    }
    fflush(stderr);
    _exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x4(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0xd, %eax
ja 0x2b625c
movq -0x20(%rbp), %rax
leaq 0xaf8165(%rip), %rcx    # 0xdae138
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xcc4fed(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8ce7(%rip), %rdi    # 0xdaecd4
callq 0x2af350
jmp 0x2b625e
movq 0xcc4fd2(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8cf0(%rip), %rdi    # 0xdaecf8
callq 0x2af350
jmp 0x2b625e
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x7, %eax
ja 0x2b6107
movq -0x28(%rbp), %rax
leaq 0xaf813b(%rip), %rcx    # 0xdae170
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xcc4f8b(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8ce8(%rip), %rdi    # 0xdaed37
callq 0x2af350
jmp 0x2b611d
movq 0xcc4f70(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8cf6(%rip), %rdi    # 0xdaed60
callq 0x2af350
jmp 0x2b611d
movq 0xcc4f55(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8cfe(%rip), %rdi    # 0xdaed83
callq 0x2af350
jmp 0x2b611d
movq 0xcc4f3a(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d13(%rip), %rdi    # 0xdaedb3
callq 0x2af350
jmp 0x2b611d
movq 0xcc4f22(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d25(%rip), %rdi    # 0xdaeddd
callq 0x2af350
jmp 0x2b611d
movq 0xcc4f0a(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d38(%rip), %rdi    # 0xdaee08
callq 0x2af350
jmp 0x2b611d
movq 0xcc4ef2(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d50(%rip), %rdi    # 0xdaee38
callq 0x2af350
jmp 0x2b611d
movq 0xcc4eda(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d6b(%rip), %rdi    # 0xdaee6b
callq 0x2af350
jmp 0x2b611d
movq 0xcc4ec2(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d7c(%rip), %rdi    # 0xdaee94
callq 0x2af350
jmp 0x2b611f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x7, %eax
ja 0x2b6214
movq -0x30(%rbp), %rax
leaq 0xaf804e(%rip), %rcx    # 0xdae190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xcc4e7e(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d5d(%rip), %rdi    # 0xdaeeb9
callq 0x2af350
jmp 0x2b622a
movq 0xcc4e63(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d63(%rip), %rdi    # 0xdaeeda
callq 0x2af350
jmp 0x2b622a
movq 0xcc4e48(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d6a(%rip), %rdi    # 0xdaeefc
callq 0x2af350
jmp 0x2b622a
movq 0xcc4e2d(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d79(%rip), %rdi    # 0xdaef26
callq 0x2af350
jmp 0x2b622a
movq 0xcc4e15(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d80(%rip), %rdi    # 0xdaef45
callq 0x2af350
jmp 0x2b622a
movq 0xcc4dfd(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d8c(%rip), %rdi    # 0xdaef69
callq 0x2af350
jmp 0x2b622a
movq 0xcc4de5(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8d9a(%rip), %rdi    # 0xdaef8f
callq 0x2af350
jmp 0x2b622a
movq 0xcc4dcd(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8da6(%rip), %rdi    # 0xdaefb3
callq 0x2af350
jmp 0x2b622a
movq 0xcc4db5(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8db5(%rip), %rdi    # 0xdaefda
callq 0x2af350
jmp 0x2b625e
movq 0xcc4d9d(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8dc1(%rip), %rdi    # 0xdaeffe
callq 0x2af350
jmp 0x2b625e
movq 0xcc4d85(%rip), %rax    # 0xf7afd0
movq (%rax), %rsi
leaq 0xaf8de8(%rip), %rdi    # 0xdaf03d
callq 0x2af350
jmp 0x2b625e
jmp 0x2b625e
movq 0xcc4d6b(%rip), %rax    # 0xf7afd0
movq (%rax), %rdi
callq 0x2af370
movl $0x1, %edi
callq 0x2af4b0
nopw (%rax,%rax)