#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int sigar_signum_get(char *name) {
  if ((strncmp(name, "SIG", 3) == 0)) {
    name += 3;
  }
  switch (*name) {
  case 'A':
    break;
  case 'B':
    break;
  case 'C':
    break;
  case 'E':
    break;
  case 'F':
    break;
  case 'H':
    break;
  case 'I':
    break;
  case 'K':
    break;
  case 'P':
    break;
  case 'Q':
    break;
  case 'S':
    break;
  case 'T':
    break;
  case 'U':
    break;
  case 'V':
    break;
  case 'W':
    break;
  case 'X':
    break;
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<sigar_signum_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf39(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1147 <sigar_signum_get+0x37>
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x17,%eax
ja     11c4 <sigar_signum_get+0xb4>
mov    -0x10(%rbp),%rax
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
jmp    11c9 <sigar_signum_get+0xb9>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigar_signum_get>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"SIG\00"
define i32 @sigar_signum_get(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
store i8* %8, i8** %2
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %29 [
i32 65, label %13
i32 66, label %14
i32 67, label %15
i32 69, label %16
i32 70, label %17
i32 72, label %18
i32 73, label %19
i32 75, label %20
i32 80, label %21
i32 81, label %22
i32 83, label %23
i32 84, label %24
i32 85, label %25
i32 86, label %26
i32 87, label %27
i32 88, label %28
]
13: ; preds = %9
br label %30
14: ; preds = %9
br label %30
15: ; preds = %9
br label %30
16: ; preds = %9
br label %30
17: ; preds = %9
br label %30
18: ; preds = %9
br label %30
19: ; preds = %9
br label %30
20: ; preds = %9
br label %30
21: ; preds = %9
br label %30
22: ; preds = %9
br label %30
23: ; preds = %9
br label %30
24: ; preds = %9
br label %30
25: ; preds = %9
br label %30
26: ; preds = %9
br label %30
27: ; preds = %9
br label %30
28: ; preds = %9
br label %30
29: ; preds = %9
br label %30
30: ; preds = %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13
ret i32 -1
}

LLVM IR (-O2):
@.str = [4 x i8] c"SIG\00"
define i32 @sigar_signum_get(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 -1
}