#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, ...);
int sfd_assemble(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *sfd_compile(int /*<<< orphan*/ *, char *);
scalar_t__ sfd_fix_code_style(char *);
int /*<<< orphan*/ *sfd_preproc(int /*<<< orphan*/ *, char *);
int sfd_strlen(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    fputs("No Input File(s)\n", stderr);
  else {
    int i;
    for (i = 1; i < argc; i++) {
      FILE *in;
      int l = sfd_strlen(argv[i]);
      char *out = malloc(l + 1);
      strcpy(out, argv[i]);
      if (l < 2 || out[l - 2] != '.' ||
          (out[l - 1] != 'c' && out[l - 1] != 'C'))
        fprintf(stderr, "File \"%s\" is Not a C Source File\n", argv[i]);
      else {
        printf("Fixing Formatting and Style in %s\n", argv[i]);
        if (sfd_fix_code_style(argv[i]) == 0) {
          int result = -1;
          in = fopen(argv[i], "r");
          out[l - 1] = 'i';
          in = sfd_preproc(in, out);
          out[l - 1] = 's';
          in = sfd_compile(in, out);
          out[l - 2] = '\0';
          result = sfd_assemble(in, out);
          printf("%s File \"%s\"\n",
                 (result == 0) ? "Successfully Compiled" : "Failed to Compile",
                 argv[i]);
          free(out);
        } else
          fprintf(stderr, "File \"%s\" Could Not be Opened or Does Not Exist\n",
                  argv[i]);
      }
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11fa <main+0x3a>
mov    0x2df9(%rip),%rax
mov    (%rax),%esi
lea    0xe10(%rip),%rdi
call   1080 <fputs@plt>
jmp    13fe <main+0x23e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13f9 <main+0x239>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <sfd_strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
cmpl   $0x2,-0x24(%rbp)
jl     129d <main+0xdd>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    129d <main+0xdd>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x63,%eax
je     12c3 <main+0x103>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x43,%eax
je     12c3 <main+0x103>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd59(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    13e6 <main+0x226>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <sfd_fix_code_style@plt>
cmp    $0x0,%rax
jne    13c0 <main+0x200>
movl   $0xffffffff,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd45(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x69,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10d0 <sfd_preproc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x73,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10e0 <sfd_compile@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1090 <sfd_assemble@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
lea    0xcf3(%rip),%rsi
lea    0xcd6(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rsi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
jmp    13e1 <main+0x221>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcb3(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    13e6 <main+0x226>
jmp    13eb <main+0x22b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1201 <main+0x41>
jmp    13fe <main+0x23e>
mov    $0xffffffff,%eax
add    $0x40,%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
jge    11f9 <main+0x39>
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
lea    0xe20(%rip),%rdi
call   1080 <fputs@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%r15,8),%rdi
call   1060 <sfd_strlen@plt>
mov    %eax,%r13d
lea    0x1(%r13),%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    (%rbx,%r15,8),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
cmp    $0x2,%r13d
jl     1290 <main+0xd0>
lea    -0x2(%r13),%r14d
cmpb   $0x2e,(%r12,%r14,1)
jne    1290 <main+0xd0>
add    $0xffffffff,%r13d
movzbl (%r12,%r13,1),%eax
or     $0x20,%al
cmp    $0x63,%al
jne    1290 <main+0xd0>
mov    (%rbx,%r15,8),%rsi
lea    0xdd5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rbx,%r15,8),%rdi
call   1050 <sfd_fix_code_style@plt>
test   %rax,%rax
je     12bb <main+0xfb>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r15,8),%rdx
lea    0xe07(%rip),%rsi
jmp    12a4 <main+0xe4>
nopw   0x0(%rax,%rax,1)
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r15,8),%rdx
lea    0xd6e(%rip),%rsi
call   10a0 <fprintf@plt>
add    $0x1,%r15
cmp    %r15,%rbp
jne    1210 <main+0x50>
jmp    11e5 <main+0x25>
mov    (%rbx,%r15,8),%rdi
lea    0xd91(%rip),%rsi
call   10c0 <fopen@plt>
movb   $0x69,(%r12,%r13,1)
mov    %rax,%rdi
mov    %r12,%rsi
call   10d0 <sfd_preproc@plt>
movb   $0x73,(%r12,%r13,1)
mov    %rax,%rdi
mov    %r12,%rsi
call   10e0 <sfd_compile@plt>
movb   $0x0,(%r12,%r14,1)
mov    %rax,%rdi
mov    %r12,%rsi
call   1090 <sfd_assemble@plt>
test   %eax,%eax
lea    0xd79(%rip),%rsi
lea    0xd5c(%rip),%rax
cmove  %rax,%rsi
mov    (%rbx,%r15,8),%rdx
lea    0xd3f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    12a9 <main+0xe9>

LLVM IR (-O0):
@.str = [18 x i8] c"No Input File(s)\0A\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"File \22%s\22 is Not a C Source File\0A\00"
@.str.2 = [35 x i8] c"Fixing Formatting and Style in %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [14 x i8] c"%s File \22%s\22\0A\00"
@.str.5 = [22 x i8] c"Successfully Compiled\00"
@.str.6 = [18 x i8] c"Failed to Compile\00"
@.str.7 = [49 x i8] c"File \22%s\22 Could Not be Opened or Does Not Exist\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %146
16: ; preds = %2
store i32 1, i32* %6
br label %17
17: ; preds = %142, %16
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %145
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @sfd_strlen(i8* %26)
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
%30 = call i8* @malloc(i32 %29)
store i8* %30, i8** %9
%31 = load i8*, i8** %9
%32 = load i8**, i8*** %5
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 @strcpy(i8* %31, i8* %36)
%38 = load i32, i32* %8
%39 = icmp slt i32 %38, 2
br i1 %39, label %67, label %40
40: ; preds = %21
%41 = load i8*, i8** %9
%42 = load i32, i32* %8
%43 = sub nsw i32 %42, 2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %41, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 46
br i1 %48, label %67, label %49
49: ; preds = %40
%50 = load i8*, i8** %9
%51 = load i32, i32* %8
%52 = sub nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %50, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 99
br i1 %57, label %58, label %75
58: ; preds = %49
%59 = load i8*, i8** %9
%60 = load i32, i32* %8
%61 = sub nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %59, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 67
br i1 %66, label %67, label %75
67: ; preds = %58, %40, %21
%68 = load i32, i32* @stderr
%69 = load i8**, i8*** %5
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %69, i64 %71
%73 = load i8*, i8** %72
%74 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %73)
br label %141
75: ; preds = %58, %49
%76 = load i8**, i8*** %5
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %80)
%82 = load i8**, i8*** %5
%83 = load i32, i32* %6
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %82, i64 %84
%86 = load i8*, i8** %85
%87 = call i64 @sfd_fix_code_style(i8* %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %132
89: ; preds = %75
store i32 -1, i32* %10
%90 = load i8**, i8*** %5
%91 = load i32, i32* %6
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32* @fopen(i8* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %95, i32** %7
%96 = load i8*, i8** %9
%97 = load i32, i32* %8
%98 = sub nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %96, i64 %99
store i8 105, i8* %100
%101 = load i32*, i32** %7
%102 = load i8*, i8** %9
%103 = call i32* @sfd_preproc(i32* %101, i8* %102)
store i32* %103, i32** %7
%104 = load i8*, i8** %9
%105 = load i32, i32* %8
%106 = sub nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
store i8 115, i8* %108
%109 = load i32*, i32** %7
%110 = load i8*, i8** %9
%111 = call i32* @sfd_compile(i32* %109, i8* %110)
store i32* %111, i32** %7
%112 = load i8*, i8** %9
%113 = load i32, i32* %8
%114 = sub nsw i32 %113, 2
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %112, i64 %115
store i8 0, i8* %116
%117 = load i32*, i32** %7
%118 = load i8*, i8** %9
%119 = call i32 @sfd_assemble(i32* %117, i8* %118)
store i32 %119, i32* %10
%120 = load i32, i32* %10
%121 = icmp eq i32 %120, 0
%122 = zext i1 %121 to i64
%123 = select i1 %121, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0)
%124 = load i8**, i8*** %5
%125 = load i32, i32* %6
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8*, i8** %124, i64 %126
%128 = load i8*, i8** %127
%129 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %123, i8* %128)
%130 = load i8*, i8** %9
%131 = call i32 @free(i8* %130)
br label %140
132: ; preds = %75
%133 = load i32, i32* @stderr
%134 = load i8**, i8*** %5
%135 = load i32, i32* %6
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8*, i8** %134, i64 %136
%138 = load i8*, i8** %137
%139 = call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i8* %138)
br label %140
140: ; preds = %132, %89
br label %141
141: ; preds = %140, %67
br label %142
142: ; preds = %141
%143 = load i32, i32* %6
%144 = add nsw i32 %143, 1
store i32 %144, i32* %6
br label %17
145: ; preds = %17
br label %146
146: ; preds = %145, %13
ret i32 -1
}

LLVM IR (-O2):
@.str = [18 x i8] c"No Input File(s)\0A\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"File \22%s\22 is Not a C Source File\0A\00"
@.str.2 = [35 x i8] c"Fixing Formatting and Style in %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [14 x i8] c"%s File \22%s\22\0A\00"
@.str.5 = [22 x i8] c"Successfully Compiled\00"
@.str.6 = [18 x i8] c"Failed to Compile\00"
@.str.7 = [49 x i8] c"File \22%s\22 Could Not be Opened or Does Not Exist\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %58
9: ; preds = %4, %55
%10 = phi i64 [ 1, %4 ], [ %56, %55 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @sfd_strlen(i8* %12)
%14 = add nsw i32 %13, 1
%15 = tail call i8* @malloc(i32 %14)
%16 = load i8*, i8** %11
%17 = tail call i32 @strcpy(i8* %15, i8* %16)
%18 = icmp slt i32 %13, 2
br i1 %18, label %30, label %19
19: ; preds = %9
%20 = add nsw i32 %13, -2
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %15, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 46
br i1 %24, label %25, label %30
25: ; preds = %19
%26 = add nsw i32 %13, -1
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %15, i64 %27
%29 = load i8, i8* %28
switch i8 %29, label %30 [
i8 99, label %34
i8 67, label %34
]
30: ; preds = %25, %19, %9
%31 = load i32, i32* @stderr
%32 = load i8*, i8** %11
%33 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %32)
br label %55
34: ; preds = %25, %25
%35 = load i8*, i8** %11
%36 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = load i8*, i8** %11
%38 = tail call i64 @sfd_fix_code_style(i8* %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %51
40: ; preds = %34
%41 = load i8*, i8** %11
%42 = tail call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8 105, i8* %28
%43 = tail call i32* @sfd_preproc(i32* %42, i8* %15)
store i8 115, i8* %28
%44 = tail call i32* @sfd_compile(i32* %43, i8* %15)
store i8 0, i8* %22
%45 = tail call i32 @sfd_assemble(i32* %44, i8* %15)
%46 = icmp eq i32 %45, 0
%47 = select i1 %46, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0)
%48 = load i8*, i8** %11
%49 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %47, i8* %48)
%50 = tail call i32 @free(i8* %15)
br label %55
51: ; preds = %34
%52 = load i32, i32* @stderr
%53 = load i8*, i8** %11
%54 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %40, %51, %30
%56 = add nuw nsw i64 %10, 1
%57 = icmp eq i64 %56, %5
br i1 %57, label %58, label %9
58: ; preds = %55, %6
ret i32 -1
}