#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 */
char *dcc_find_extension_const(char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int dcc_is_source(const char *sfile) {
  const char *dot, *ext;
  dot = dcc_find_extension_const(sfile);
  if (!dot)
    return 0;
  ext = dot + 1;
  switch (ext[0]) {
  case 'i':
    return !strcmp(ext, "i") || !strcmp(ext, "ii");
  case 'c':
    return !strcmp(ext, "c") || !strcmp(ext, "cc") || !strcmp(ext, "cpp") ||
           !strcmp(ext, "cxx") || !strcmp(ext, "cp") || !strcmp(ext, "c++");
  case 'C':
    return !strcmp(ext, "C");
  case 'm':
    return !strcmp(ext, "m") || !strcmp(ext, "mm") || !strcmp(ext, "mi") ||
           !strcmp(ext, "mii");
  case 'M':
    return !strcmp(ext, "M");
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<dcc_is_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dcc_find_extension_const@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <dcc_is_source+0x30>
movl   $0x0,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x2a,%eax
ja     1374 <dcc_is_source+0x254>
mov    -0x28(%rbp),%rax
lea    0xe80(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rdi
lea    0xf34(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
je     11c4 <dcc_is_source+0xa4>
mov    -0x20(%rbp),%rdi
lea    0xf13(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
mov    -0x20(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
je     128f <dcc_is_source+0x16f>
mov    -0x20(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
je     128f <dcc_is_source+0x16f>
mov    -0x20(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
je     128f <dcc_is_source+0x16f>
mov    -0x20(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
je     128f <dcc_is_source+0x16f>
mov    -0x20(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
je     128f <dcc_is_source+0x16f>
mov    -0x20(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
mov    -0x20(%rbp),%rdi
lea    0xe14(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
mov    -0x20(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2b(%rbp)
je     133f <dcc_is_source+0x21f>
mov    -0x20(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2b(%rbp)
je     133f <dcc_is_source+0x21f>
mov    -0x20(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2b(%rbp)
je     133f <dcc_is_source+0x21f>
mov    -0x20(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2b(%rbp)
mov    -0x2b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
mov    -0x20(%rbp),%rdi
lea    0xd70(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    137b <dcc_is_source+0x25b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_is_source>:
push   %rbp
push   %rbx
push   %rax
call   1030 <dcc_find_extension_const@plt>
test   %rax,%rax
je     1162 <dcc_is_source+0x42>
mov    %rax,%rbx
movsbl 0x1(%rax),%eax
xor    %ebp,%ebp
add    $0xffffffbd,%eax
cmp    $0x2a,%eax
ja     125d <dcc_is_source+0x13d>
add    $0x1,%rbx
lea    0xeb3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf61(%rip),%rsi
jmp    124f <dcc_is_source+0x12f>
xor    %ebp,%ebp
jmp    125d <dcc_is_source+0x13d>
lea    0xf5a(%rip),%rsi
jmp    124f <dcc_is_source+0x12f>
lea    0xf31(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%bpl
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xf16(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xf02(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xeef(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xecc(%rip),%rsi
jmp    124f <dcc_is_source+0x12f>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1268 <dcc_is_source+0x148>
lea    0xebd(%rip),%rsi
jmp    124f <dcc_is_source+0x12f>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%bpl
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     125d <dcc_is_source+0x13d>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
sete   %bpl
movzbl %bpl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%bpl
jmp    125d <dcc_is_source+0x13d>

LLVM IR (-O0):
@.str = [2 x i8] c"i\00"
@.str.1 = [3 x i8] c"ii\00"
@.str.2 = [2 x i8] c"c\00"
@.str.3 = [3 x i8] c"cc\00"
@.str.4 = [4 x i8] c"cpp\00"
@.str.5 = [4 x i8] c"cxx\00"
@.str.6 = [3 x i8] c"cp\00"
@.str.7 = [4 x i8] c"c++\00"
@.str.8 = [2 x i8] c"C\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [3 x i8] c"mm\00"
@.str.11 = [3 x i8] c"mi\00"
@.str.12 = [4 x i8] c"mii\00"
@.str.13 = [2 x i8] c"M\00"
define i32 @dcc_is_source(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @dcc_find_extension_const(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %91
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %90 [
i32 105, label %18
i32 99, label %30
i32 67, label %58
i32 109, label %64
i32 77, label %84
]
18: ; preds = %11
%19 = load i8*, i8** %5
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8*, i8** %5
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
%26 = xor i1 %25, true
br label %27
27: ; preds = %22, %18
%28 = phi i1 [ true, %18 ], [ %26, %22 ]
%29 = zext i1 %28 to i32
store i32 %29, i32* %2
br label %91
30: ; preds = %11
%31 = load i8*, i8** %5
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %55
34: ; preds = %30
%35 = load i8*, i8** %5
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %55
38: ; preds = %34
%39 = load i8*, i8** %5
%40 = call i32 @strcmp(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %55
42: ; preds = %38
%43 = load i8*, i8** %5
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %55
46: ; preds = %42
%47 = load i8*, i8** %5
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = load i8*, i8** %5
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
%54 = xor i1 %53, true
br label %55
55: ; preds = %50, %46, %42, %38, %34, %30
%56 = phi i1 [ true, %46 ], [ true, %42 ], [ true, %38 ], [ true, %34 ], [ true, %30 ], [ %54, %50 ]
%57 = zext i1 %56 to i32
store i32 %57, i32* %2
br label %91
58: ; preds = %11
%59 = load i8*, i8** %5
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
%62 = xor i1 %61, true
%63 = zext i1 %62 to i32
store i32 %63, i32* %2
br label %91
64: ; preds = %11
%65 = load i8*, i8** %5
%66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %81
68: ; preds = %64
%69 = load i8*, i8** %5
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %81
72: ; preds = %68
%73 = load i8*, i8** %5
%74 = call i32 @strcmp(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %72
%77 = load i8*, i8** %5
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
%80 = xor i1 %79, true
br label %81
81: ; preds = %76, %72, %68, %64
%82 = phi i1 [ true, %72 ], [ true, %68 ], [ true, %64 ], [ %80, %76 ]
%83 = zext i1 %82 to i32
store i32 %83, i32* %2
br label %91
84: ; preds = %11
%85 = load i8*, i8** %5
%86 = call i32 @strcmp(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%87 = icmp ne i32 %86, 0
%88 = xor i1 %87, true
%89 = zext i1 %88 to i32
store i32 %89, i32* %2
br label %91
90: ; preds = %11
store i32 0, i32* %2
br label %91
91: ; preds = %90, %84, %81, %58, %55, %27, %10
%92 = load i32, i32* %2
ret i32 %92
}

LLVM IR (-O2):
@.str = [2 x i8] c"i\00"
@.str.1 = [3 x i8] c"ii\00"
@.str.2 = [2 x i8] c"c\00"
@.str.3 = [3 x i8] c"cc\00"
@.str.4 = [4 x i8] c"cpp\00"
@.str.5 = [4 x i8] c"cxx\00"
@.str.6 = [3 x i8] c"cp\00"
@.str.7 = [4 x i8] c"c++\00"
@.str.8 = [2 x i8] c"C\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [3 x i8] c"mm\00"
@.str.11 = [3 x i8] c"mi\00"
@.str.12 = [4 x i8] c"mii\00"
@.str.13 = [2 x i8] c"M\00"
define i32 @dcc_is_source(i8* %0) {
%2 = tail call i8* @dcc_find_extension_const(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %50, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %50 [
i32 105, label %8
i32 99, label %14
i32 67, label %32
i32 109, label %35
i32 77, label %47
]
8: ; preds = %4
%9 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %50, label %11
11: ; preds = %8
%12 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br label %50
14: ; preds = %4
%15 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %50, label %17
17: ; preds = %14
%18 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %50, label %20
20: ; preds = %17
%21 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %50, label %23
23: ; preds = %20
%24 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %50, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %50, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br label %50
32: ; preds = %4
%33 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br label %50
35: ; preds = %4
%36 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %50, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %50, label %41
41: ; preds = %38
%42 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %41
%45 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br label %50
47: ; preds = %4
%48 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br label %50
50: ; preds = %4, %35, %38, %41, %44, %14, %17, %20, %23, %26, %29, %8, %11, %1, %47, %32
%51 = phi i1 [ %49, %47 ], [ %34, %32 ], [ false, %1 ], [ true, %8 ], [ %13, %11 ], [ true, %26 ], [ true, %23 ], [ true, %20 ], [ true, %17 ], [ true, %14 ], [ %31, %29 ], [ true, %41 ], [ true, %38 ], [ true, %35 ], [ %46, %44 ], [ false, %4 ]
%52 = zext i1 %51 to i32
ret i32 %52
}