#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ read_cdata(int /*<<< orphan*/ *);
int /*<<< orphan*/ read_compexdata(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ write_cdata(char *);
int main(int argc, char *argv[]) {
  FILE *in;
  char *prog, *opath;
  prog = argv[1];
  opath = 0;
  in = stdin;
  argc--;
  argv++;
  while (argc > 0) {
    if (argv[0][0] == '-') {
      switch (argv[0][1]) {
      case 'o':
        argc--;
        argv++;
        opath = argv[0];
        break;
      case 'x':
        argc--;
        argv++;
        if ((in = fopen(argv[0], "r")) == 0)
          fprintf(stderr, "%s: unable to open composition exclusion file %s\n",
                  prog, argv[0]);
        else {
          read_compexdata(in);
          fclose(in);
          in = 0;
        }
        break;
      default:
        usage(prog);
      }
    } else {
      if (in != stdin && in != NULL)
        fclose(in);
      if ((in = fopen(argv[0], "r")) == 0)
        fprintf(stderr, "%s: unable to open ctype file %s\n", prog, argv[0]);
      else {
        read_cdata(in);
        fclose(in);
        in = 0;
      }
    }
    argc--;
    argv++;
  }
  if (opath == 0)
    opath = ".";
  write_cdata(opath);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2e47(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    135b <main+0x1eb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12b4 <main+0x144>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x6f,%eax
je     1207 <main+0x97>
jmp    11f6 <main+0x86>
mov    -0x2c(%rbp),%eax
sub    $0x78,%eax
je     122c <main+0xbc>
jmp    12a6 <main+0x136>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    12af <main+0x13f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdb1(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1287 <main+0x117>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xd85(%rip),%rsi
call   1040 <fprintf@plt>
jmp    12a1 <main+0x131>
mov    -0x18(%rbp),%rdi
call   1050 <read_compexdata@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x18(%rbp)
jmp    12af <main+0x13f>
mov    -0x20(%rbp),%rdi
call   1060 <usage@plt>
jmp    1341 <main+0x1d1>
mov    -0x18(%rbp),%rax
mov    0x2d29(%rip),%rcx
cmp    (%rcx),%rax
je     12dc <main+0x16c>
cmpq   $0x0,-0x18(%rbp)
je     12dc <main+0x16c>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd16(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1322 <main+0x1b2>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xd1c(%rip),%rsi
call   1040 <fprintf@plt>
jmp    133c <main+0x1cc>
mov    -0x18(%rbp),%rdi
call   1090 <read_cdata@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x18(%rbp)
jmp    1341 <main+0x1d1>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <main+0x4d>
cmpq   $0x0,-0x28(%rbp)
jne    1371 <main+0x201>
lea    0xce9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <write_cdata@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     12bf <main+0x14f>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%r13
mov    0x2e54(%rip),%rax
mov    (%rax),%r15
xor    %eax,%eax
mov    %rax,(%rsp)
mov    %r13,%rdi
jmp    11c4 <main+0x54>
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%rax
mov    %rax,(%rsp)
add    $0x10,%rbx
cmp    $0x2,%ebp
jl     12b9 <main+0x149>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rdi
lea    0x8(%rbx),%r14
lea    -0x1(%rbp),%r12d
cmpb   $0x2d,(%rdi)
jne    11f0 <main+0x80>
movsbl 0x1(%rdi),%eax
cmp    $0x78,%eax
je     1261 <main+0xf1>
cmp    $0x6f,%eax
je     11a2 <main+0x32>
mov    %r13,%rdi
call   1060 <usage@plt>
mov    %r14,%rbx
jmp    1253 <main+0xe3>
test   %r15,%r15
je     120c <main+0x9c>
mov    0x2dec(%rip),%rax
cmp    (%rax),%r15
je     120c <main+0x9c>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    (%r14),%rdi
lea    0xded(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1232 <main+0xc2>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <read_cdata@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    124d <main+0xdd>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rcx
lea    0xdef(%rip),%rsi
mov    %r13,%rdx
call   1040 <fprintf@plt>
mov    %r14,%rbx
xor    %r15d,%r15d
mov    %r12d,%ebp
cmp    $0x2,%ebp
jge    11c0 <main+0x50>
jmp    12b9 <main+0x149>
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%rdi
add    $0x10,%rbx
lea    0xd8d(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1292 <main+0x122>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <read_compexdata@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
jmp    12ad <main+0x13d>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xd5d(%rip),%rsi
mov    %r13,%rdx
call   1040 <fprintf@plt>
xor    %r15d,%r15d
cmp    $0x2,%ebp
jge    11c0 <main+0x50>
mov    (%rsp),%rax
jmp    12c1 <main+0x151>
xor    %eax,%eax
test   %rax,%rax
lea    0xd8b(%rip),%rdi
cmovne %rax,%rdi
call   1080 <write_cdata@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"%s: unable to open composition exclusion file %s\0A\00"
@.str.2 = [34 x i8] c"%s: unable to open ctype file %s\0A\00"
@.str.3 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %7
store i8* null, i8** %8
%12 = load i32*, i32** @stdin
store i32* %12, i32** %6
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
br label %17
17: ; preds = %99, %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %104
20: ; preds = %17
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br i1 %27, label %28, label %70
28: ; preds = %20
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
switch i32 %34, label %66 [
i32 111, label %35
i32 120, label %43
]
35: ; preds = %28
%36 = load i32, i32* %4
%37 = add nsw i32 %36, -1
store i32 %37, i32* %4
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i32 1
store i8** %39, i8*** %5
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
store i8* %42, i8** %8
br label %69
43: ; preds = %28
%44 = load i32, i32* %4
%45 = add nsw i32 %44, -1
store i32 %45, i32* %4
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i32 1
store i8** %47, i8*** %5
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i32* @fopen(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %51, i32** %6
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %60
53: ; preds = %43
%54 = load i32, i32* @stderr
%55 = load i8*, i8** %7
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %55, i8* %58)
br label %65
60: ; preds = %43
%61 = load i32*, i32** %6
%62 = call i32 @read_compexdata(i32* %61)
%63 = load i32*, i32** %6
%64 = call i32 @fclose(i32* %63)
store i32* null, i32** %6
br label %65
65: ; preds = %60, %53
br label %69
66: ; preds = %28
%67 = load i8*, i8** %7
%68 = call i32 @usage(i8* %67)
br label %69
69: ; preds = %66, %65, %35
br label %99
70: ; preds = %20
%71 = load i32*, i32** %6
%72 = load i32*, i32** @stdin
%73 = icmp ne i32* %71, %72
br i1 %73, label %74, label %80
74: ; preds = %70
%75 = load i32*, i32** %6
%76 = icmp ne i32* %75, null
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = load i32*, i32** %6
%79 = call i32 @fclose(i32* %78)
br label %80
80: ; preds = %77, %74, %70
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 0
%83 = load i8*, i8** %82
%84 = call i32* @fopen(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %84, i32** %6
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %93
86: ; preds = %80
%87 = load i32, i32* @stderr
%88 = load i8*, i8** %7
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %88, i8* %91)
br label %98
93: ; preds = %80
%94 = load i32*, i32** %6
%95 = call i32 @read_cdata(i32* %94)
%96 = load i32*, i32** %6
%97 = call i32 @fclose(i32* %96)
store i32* null, i32** %6
br label %98
98: ; preds = %93, %86
br label %99
99: ; preds = %98, %69
%100 = load i32, i32* %4
%101 = add nsw i32 %100, -1
store i32 %101, i32* %4
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i32 1
store i8** %103, i8*** %5
br label %17
104: ; preds = %17
%105 = load i8*, i8** %8
%106 = icmp eq i8* %105, null
br i1 %106, label %107, label %108
107: ; preds = %104
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %8
br label %108
108: ; preds = %107, %104
%109 = load i8*, i8** %8
%110 = call i32 @write_cdata(i8* %109)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"%s: unable to open composition exclusion file %s\0A\00"
@.str.2 = [34 x i8] c"%s: unable to open ctype file %s\0A\00"
@.str.3 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %69
6: ; preds = %2
%7 = load i32*, i32** @stdin
br label %8
8: ; preds = %66, %6
%9 = phi i8* [ %68, %66 ], [ %4, %6 ]
%10 = phi i8* [ %64, %66 ], [ null, %6 ]
%11 = phi i32 [ %63, %66 ], [ %0, %6 ]
%12 = phi i32* [ %62, %66 ], [ %7, %6 ]
%13 = phi i8** [ %61, %66 ], [ %1, %6 ]
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = add nsw i32 %11, -1
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %41
18: ; preds = %8
%19 = getelementptr inbounds i8, i8* %9, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %39 [
i32 111, label %22
i32 120, label %26
]
22: ; preds = %18
%23 = add nsw i32 %11, -2
%24 = getelementptr inbounds i8*, i8** %13, i64 2
%25 = load i8*, i8** %24
br label %60
26: ; preds = %18
%27 = add nsw i32 %11, -2
%28 = getelementptr inbounds i8*, i8** %13, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %28
%35 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %34)
br label %60
36: ; preds = %26
%37 = tail call i32 @read_compexdata(i32* %30)
%38 = tail call i32 @fclose(i32* %30)
br label %60
39: ; preds = %18
%40 = tail call i32 @usage(i8* %4)
br label %60
41: ; preds = %8
%42 = load i32*, i32** @stdin
%43 = icmp ne i32* %12, %42
%44 = icmp ne i32* %12, null
%45 = and i1 %44, %43
br i1 %45, label %46, label %49
46: ; preds = %41
%47 = tail call i32 @fclose(i32* %12)
%48 = load i8*, i8** %14
br label %49
49: ; preds = %46, %41
%50 = phi i8* [ %48, %46 ], [ %9, %41 ]
%51 = tail call i32* @fopen(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = load i8*, i8** %14
%56 = tail call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %55)
br label %60
57: ; preds = %49
%58 = tail call i32 @read_cdata(i32* %51)
%59 = tail call i32 @fclose(i32* %51)
br label %60
60: ; preds = %53, %57, %22, %39, %36, %32
%61 = phi i8** [ %14, %39 ], [ %28, %32 ], [ %28, %36 ], [ %24, %22 ], [ %14, %53 ], [ %14, %57 ]
%62 = phi i32* [ %12, %39 ], [ null, %32 ], [ null, %36 ], [ %12, %22 ], [ null, %53 ], [ null, %57 ]
%63 = phi i32 [ %15, %39 ], [ %27, %32 ], [ %27, %36 ], [ %23, %22 ], [ %15, %53 ], [ %15, %57 ]
%64 = phi i8* [ %10, %39 ], [ %10, %32 ], [ %10, %36 ], [ %25, %22 ], [ %10, %53 ], [ %10, %57 ]
%65 = icmp sgt i32 %63, 1
br i1 %65, label %66, label %69
66: ; preds = %60
%67 = getelementptr inbounds i8*, i8** %61, i64 1
%68 = load i8*, i8** %67
br label %8
69: ; preds = %60, %2
%70 = phi i8* [ null, %2 ], [ %64, %60 ]
%71 = icmp eq i8* %70, null
%72 = select i1 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %70
%73 = tail call i32 @write_cdata(i8* %72)
ret i32 0
}