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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ print_subsys(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char buff[256];
  FILE *list_subs = 0;
  if (argc < 2) {
    printf("Need a file name\n");
    return -1;
  }
  list_subs = fopen(argv[1], "r");
  if (list_subs != NULL) {
    while (fgets(buff, sizeof(buff), list_subs) != NULL) {
      for (int i = 0; i < 256; i++) {
        if (buff[i] == '\n')
          buff[i] = 0;
      }
      print_subsys(buff);
    }
    fclose(list_subs);
  }
  printf("converting");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x118(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1196 <main+0x46>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1270 <main+0x120>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
je     125d <main+0x10d>
jmp    11c4 <main+0x74>
lea    -0x110(%rbp),%rdi
mov    -0x118(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1251 <main+0x101>
movl   $0x0,-0x11c(%rbp)
cmpl   $0x100,-0x11c(%rbp)
jge    1240 <main+0xf0>
movslq -0x11c(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1227 <main+0xd7>
movslq -0x11c(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
jmp    122c <main+0xdc>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    11f0 <main+0xa0>
lea    -0x110(%rbp),%rdi
call   1030 <print_subsys@plt>
jmp    11c4 <main+0x74>
mov    -0x118(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xdb0(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
cmp    $0x1,%edi
jg     1185 <main+0x25>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    140c <main+0x2ac>
mov    0x8(%rsi),%rdi
lea    0xe90(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     13fe <main+0x29e>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f6 <main+0x296>
xor    %ecx,%ecx
movdqa 0xe3c(%rip),%xmm4
movdqa 0xe44(%rip),%xmm5
mov    %rsp,%r14
jmp    11f1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x10,%rcx
cmp    $0x100,%rcx
je     13c0 <main+0x260>
movq   (%rsp,%rcx,1),%xmm2
movdqa %xmm2,%xmm1
pcmpeqb %xmm4,%xmm1
movd   %xmm1,%eax
test   $0x1,%al
je     120a <main+0xaa>
movb   $0x0,(%rsp,%rcx,1)
movq   0x8(%rsp,%rcx,1),%xmm0
movdqa %xmm1,%xmm3
pslld  $0x8,%xmm3
movd   %xmm3,%eax
shr    $0x10,%eax
test   $0x1,%al
je     122f <main+0xcf>
mov    %rcx,%rax
or     $0x1,%rax
movb   $0x0,(%rsp,%rax,1)
pshuflw $0x55,%xmm2,%xmm3
pcmpeqb %xmm4,%xmm3
pextrw $0x2,%xmm3,%eax
test   $0x1,%al
je     124c <main+0xec>
mov    %rcx,%rax
or     $0x2,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm1,%xmm3
psllq  $0x18,%xmm3
pextrw $0x3,%xmm3,%eax
test   $0x1,%al
je     1269 <main+0x109>
mov    %rcx,%rax
or     $0x3,%rax
movb   $0x0,(%rsp,%rax,1)
pshufd $0x55,%xmm2,%xmm2
pcmpeqb %xmm5,%xmm2
pextrw $0x4,%xmm2,%eax
test   $0x1,%al
je     1286 <main+0x126>
mov    %rcx,%rax
or     $0x4,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%eax
test   $0x1,%al
je     12a3 <main+0x143>
mov    %rcx,%rax
or     $0x5,%rax
movb   $0x0,(%rsp,%rax,1)
pextrw $0x3,%xmm1,%eax
test   $0x1,%al
je     12b7 <main+0x157>
mov    %rcx,%rax
or     $0x6,%rax
movb   $0x0,(%rsp,%rax,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%eax
test   $0x1,%al
je     12d0 <main+0x170>
mov    %rcx,%rax
or     $0x7,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm0,%xmm1
pcmpeqb %xmm4,%xmm1
movd   %xmm1,%eax
test   $0x1,%al
je     12eb <main+0x18b>
mov    %rcx,%rax
or     $0x8,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm1,%xmm2
pslld  $0x8,%xmm2
movd   %xmm2,%eax
shr    $0x10,%eax
test   $0x1,%al
je     130a <main+0x1aa>
mov    %rcx,%rax
or     $0x9,%rax
movb   $0x0,(%rsp,%rax,1)
pshuflw $0x55,%xmm0,%xmm2
pcmpeqb %xmm4,%xmm2
pextrw $0x2,%xmm2,%eax
test   $0x1,%al
je     1327 <main+0x1c7>
mov    %rcx,%rax
or     $0xa,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm1,%xmm2
psllq  $0x18,%xmm2
pextrw $0x3,%xmm2,%eax
test   $0x1,%al
je     1344 <main+0x1e4>
mov    %rcx,%rax
or     $0xb,%rax
movb   $0x0,(%rsp,%rax,1)
pshufd $0x55,%xmm0,%xmm0
pcmpeqb %xmm5,%xmm0
pextrw $0x4,%xmm0,%eax
test   $0x1,%al
je     1361 <main+0x201>
mov    %rcx,%rax
or     $0xc,%rax
movb   $0x0,(%rsp,%rax,1)
movdqa %xmm1,%xmm0
pslldq $0x5,%xmm0
pextrw $0x5,%xmm0,%eax
test   $0x1,%al
je     137e <main+0x21e>
mov    %rcx,%rax
or     $0xd,%rax
movb   $0x0,(%rsp,%rax,1)
pextrw $0x3,%xmm1,%eax
test   $0x1,%al
je     1392 <main+0x232>
mov    %rcx,%rax
or     $0xe,%rax
movb   $0x0,(%rsp,%rax,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%eax
test   $0x1,%al
je     11e0 <main+0x80>
mov    %rcx,%rax
or     $0xf,%rax
movb   $0x0,(%rsp,%rax,1)
jmp    11e0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <print_subsys@plt>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
movdqa 0xc30(%rip),%xmm5
movdqa 0xc18(%rip),%xmm4
mov    $0x0,%ecx
test   %rax,%rax
jne    11f1 <main+0x91>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xc1d(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Need a file name\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"converting\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %53
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %7
%18 = load i32*, i32** %7
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %51
20: ; preds = %13
br label %21
21: ; preds = %45, %20
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%23 = load i32*, i32** %7
%24 = call i32* @fgets(i8* %22, i32 256, i32* %23)
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %48
26: ; preds = %21
store i32 0, i32* %8
br label %27
27: ; preds = %42, %26
%28 = load i32, i32* %8
%29 = icmp slt i32 %28, 256
br i1 %29, label %30, label %45
30: ; preds = %27
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 10
br i1 %36, label %37, label %41
37: ; preds = %30
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %39
store i8 0, i8* %40
br label %41
41: ; preds = %37, %30
br label %42
42: ; preds = %41
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
br label %27
45: ; preds = %27
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%47 = call i32 @print_subsys(i8* %46)
br label %21
48: ; preds = %21
%49 = load i32*, i32** %7
%50 = call i32 @fclose(i32* %49)
br label %51
51: ; preds = %48, %13
%52 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %53
53: ; preds = %51, %11
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"converting\00"
@str = [17 x i8] c"Need a file name\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %117
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %115, label %13
13: ; preds = %8
%14 = call i32* @fgets(i8* %4, i32 256, i32* %11)
%15 = icmp eq i32* %14, null
br i1 %15, label %113, label %16
16: ; preds = %13, %107
%17 = phi i64 [ %108, %107 ], [ 0, %13 ]
%18 = or i64 %17, 8
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %17
%20 = bitcast i8* %19 to <8 x i8>*
%21 = load <8 x i8>, <8 x i8>* %20
%22 = getelementptr inbounds i8, i8* %19, i64 8
%23 = bitcast i8* %22 to <8 x i8>*
%24 = load <8 x i8>, <8 x i8>* %23
%25 = icmp eq <8 x i8> %21, <i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10>
%26 = icmp eq <8 x i8> %24, <i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10>
%27 = extractelement <8 x i1> %25, i64 0
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %17
store i8 0, i8* %29
br label %30
30: ; preds = %28, %16
%31 = extractelement <8 x i1> %25, i64 1
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = or i64 %17, 1
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %33
store i8 0, i8* %34
br label %35
35: ; preds = %32, %30
%36 = extractelement <8 x i1> %25, i64 2
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = or i64 %17, 2
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %38
store i8 0, i8* %39
br label %40
40: ; preds = %37, %35
%41 = extractelement <8 x i1> %25, i64 3
br i1 %41, label %42, label %45
42: ; preds = %40
%43 = or i64 %17, 3
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %43
store i8 0, i8* %44
br label %45
45: ; preds = %42, %40
%46 = extractelement <8 x i1> %25, i64 4
br i1 %46, label %47, label %50
47: ; preds = %45
%48 = or i64 %17, 4
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %48
store i8 0, i8* %49
br label %50
50: ; preds = %47, %45
%51 = extractelement <8 x i1> %25, i64 5
br i1 %51, label %52, label %55
52: ; preds = %50
%53 = or i64 %17, 5
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %53
store i8 0, i8* %54
br label %55
55: ; preds = %52, %50
%56 = extractelement <8 x i1> %25, i64 6
br i1 %56, label %57, label %60
57: ; preds = %55
%58 = or i64 %17, 6
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %58
store i8 0, i8* %59
br label %60
60: ; preds = %57, %55
%61 = extractelement <8 x i1> %25, i64 7
br i1 %61, label %62, label %65
62: ; preds = %60
%63 = or i64 %17, 7
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %63
store i8 0, i8* %64
br label %65
65: ; preds = %62, %60
%66 = extractelement <8 x i1> %26, i64 0
br i1 %66, label %67, label %69
67: ; preds = %65
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %18
store i8 0, i8* %68
br label %69
69: ; preds = %67, %65
%70 = extractelement <8 x i1> %26, i64 1
br i1 %70, label %71, label %74
71: ; preds = %69
%72 = or i64 %17, 9
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %72
store i8 0, i8* %73
br label %74
74: ; preds = %71, %69
%75 = extractelement <8 x i1> %26, i64 2
br i1 %75, label %76, label %79
76: ; preds = %74
%77 = or i64 %17, 10
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %77
store i8 0, i8* %78
br label %79
79: ; preds = %76, %74
%80 = extractelement <8 x i1> %26, i64 3
br i1 %80, label %81, label %84
81: ; preds = %79
%82 = or i64 %17, 11
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %82
store i8 0, i8* %83
br label %84
84: ; preds = %81, %79
%85 = extractelement <8 x i1> %26, i64 4
br i1 %85, label %86, label %89
86: ; preds = %84
%87 = or i64 %17, 12
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %87
store i8 0, i8* %88
br label %89
89: ; preds = %86, %84
%90 = extractelement <8 x i1> %26, i64 5
br i1 %90, label %91, label %94
91: ; preds = %89
%92 = or i64 %17, 13
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %92
store i8 0, i8* %93
br label %94
94: ; preds = %91, %89
%95 = extractelement <8 x i1> %26, i64 6
br i1 %95, label %96, label %99
96: ; preds = %94
%97 = or i64 %17, 14
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %97
store i8 0, i8* %98
br label %99
99: ; preds = %96, %94
%100 = extractelement <8 x i1> %26, i64 7
br i1 %100, label %101, label %104
101: ; preds = %99
%102 = or i64 %17, 15
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %102
store i8 0, i8* %103
br label %104
104: ; preds = %101, %99
%105 = add nuw i64 %17, 16
%106 = icmp eq i64 %105, 256
br i1 %106, label %109, label %107
107: ; preds = %104, %109
%108 = phi i64 [ %105, %104 ], [ 0, %109 ]
br label %16
109: ; preds = %104
%110 = call i32 @print_subsys(i8* %4)
%111 = call i32* @fgets(i8* %4, i32 256, i32* %11)
%112 = icmp eq i32* %111, null
br i1 %112, label %113, label %107
113: ; preds = %109, %13
%114 = call i32 @fclose(i32* %11)
br label %115
115: ; preds = %113, %8
%116 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %117
117: ; preds = %115, %6
%118 = phi i32 [ -1, %6 ], [ 0, %115 ]
ret i32 %118
}