#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 */
scalar_t__ EOF;
int d(char);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, ...);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  FILE *fp;
  char u, f, a;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "user_%c=>file_%c=>%c", &u, &f, &a) != EOF) {
    char uperm[18] = {7, 3, 0, 6, 2, 4, 5, 1, 5, 3, 7, 1, 6, 0, 2, 4, 2, 6};
    bool v = true;
    do {
      switch (a) {
      case 'r':
        fscanf(fp, "ead");
        if ((uperm[d(u) * 3 + d(f)] & 4) == 0)
          v = false;
        break;
      case 'w':
        fscanf(fp, "rite");
        if ((uperm[d(u) * 3 + d(f)] & 2) == 0)
          v = false;
        break;
      case 'g':
        fscanf(fp, "rant=>%c", &a);
        if ((uperm[d(u) * 3 + d(f)] & 1) == 0)
          v = false;
        switch (a) {
        case 'r':
          fscanf(fp, "ead=>user_%c", &u);
          uperm[d(u) * 3 + d(f)] |= 4;
          break;
        case 'w':
          fscanf(fp, "rite=>user_%c", &u);
          uperm[d(u) * 3 + d(f)] |= 2;
          break;
        case 'g':
          fscanf(fp, "rant=>user_%c", &u);
          uperm[d(u) * 3 + d(f)] |= 1;
        }
      }
    } while (getc(fp) == ' ' &&
             fscanf(fp, "user_%c=>file_%c=>%c", &u, &f, &a) != EOF);
    puts(v ? "True" : "False");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14ce <main+0x36e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe59(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe47(%rip),%rsi
lea    -0x19(%rbp),%rdx
lea    -0x1a(%rbp),%rcx
lea    -0x1b(%rbp),%r8
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    0x2e01(%rip),%rcx
cmp    (%rcx),%rax
je     14c7 <main+0x367>
mov    0xe79(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe73(%rip),%ax
mov    %ax,-0x20(%rbp)
movl   $0x1,-0x34(%rbp)
movsbl -0x1b(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x67,%eax
je     12ef <main+0x18f>
jmp    122d <main+0xcd>
mov    -0x38(%rbp),%eax
sub    $0x72,%eax
je     124f <main+0xef>
jmp    123e <main+0xde>
mov    -0x38(%rbp),%eax
sub    $0x77,%eax
je     129f <main+0x13f>
jmp    144d <main+0x2ed>
mov    -0x18(%rbp),%rdi
lea    0xdcf(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x3c(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    129a <main+0x13a>
movl   $0x0,-0x34(%rbp)
jmp    144d <main+0x2ed>
mov    -0x18(%rbp),%rdi
lea    0xd83(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x40(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    12ea <main+0x18a>
movl   $0x0,-0x34(%rbp)
jmp    144d <main+0x2ed>
mov    -0x18(%rbp),%rdi
lea    0xd38(%rip),%rsi
lea    -0x1b(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x44(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    133e <main+0x1de>
movl   $0x0,-0x34(%rbp)
movsbl -0x1b(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x67,%eax
je     1405 <main+0x2a5>
jmp    1353 <main+0x1f3>
mov    -0x48(%rbp),%eax
sub    $0x72,%eax
je     1375 <main+0x215>
jmp    1364 <main+0x204>
mov    -0x48(%rbp),%eax
sub    $0x77,%eax
je     13bd <main+0x25d>
jmp    1448 <main+0x2e8>
mov    -0x18(%rbp),%rdi
lea    0xcbb(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x4c(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%ecx
or     $0x4,%ecx
mov    %cl,-0x30(%rbp,%rax,1)
jmp    1448 <main+0x2e8>
mov    -0x18(%rbp),%rdi
lea    0xc80(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x50(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%ecx
or     $0x2,%ecx
mov    %cl,-0x30(%rbp,%rax,1)
jmp    1448 <main+0x2e8>
mov    -0x18(%rbp),%rdi
lea    0xc46(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <d@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x54(%rbp)
movsbl -0x1a(%rbp),%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%ecx
or     $0x1,%ecx
mov    %cl,-0x30(%rbp,%rax,1)
jmp    144d <main+0x2ed>
jmp    1452 <main+0x2f2>
mov    -0x18(%rbp),%rdi
call   1080 <getc@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x55(%rbp)
jne    149a <main+0x33a>
mov    -0x18(%rbp),%rdi
lea    0xb9d(%rip),%rsi
lea    -0x19(%rbp),%rdx
lea    -0x1a(%rbp),%rcx
lea    -0x1b(%rbp),%r8
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    0x2b57(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
test   $0x1,%al
jne    1218 <main+0xb8>
mov    -0x34(%rbp),%ecx
lea    0xbba(%rip),%rdi
lea    0xbae(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <puts@plt>
jmp    11c2 <main+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jne    1408 <main+0x2a8>
mov    0x8(%rsi),%rdi
lea    0xe90(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe83(%rip),%rsi
xor    %r14d,%r14d
lea    0xe(%rsp),%rdx
lea    0xd(%rsp),%rcx
lea    0xf(%rsp),%r8
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2e34(%rip),%rcx
cmp    (%rcx),%rax
je     141d <main+0x2bd>
lea    0xf(%rsp),%r15
lea    0xe(%rsp),%r13
lea    0xd(%rsp),%r12
jmp    1217 <main+0xb7>
xchg   %ax,%ax
test   %r14d,%r14d
lea    0xe8a(%rip),%rdi
lea    0xe88(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
mov    %rbx,%rdi
lea    0xe1d(%rip),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2dda(%rip),%rcx
cmp    (%rcx),%rax
je     141d <main+0x2bd>
movaps 0xe52(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x602,0x20(%rsp)
mov    $0x1,%r14d
movsbl 0xf(%rsp),%eax
cmp    $0x67,%eax
je     1290 <main+0x130>
cmp    $0x77,%eax
je     1320 <main+0x1c0>
cmp    $0x72,%eax
jne    135a <main+0x1fa>
mov    %rbx,%rdi
lea    0xdd3(%rip),%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
testb  $0x4,0x10(%rsp,%rax,1)
jmp    1351 <main+0x1f1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xd98(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
testb  $0x1,0x10(%rsp,%rax,1)
mov    $0x0,%eax
cmove  %eax,%r14d
movsbl 0xf(%rsp),%eax
cmp    $0x67,%eax
je     1399 <main+0x239>
cmp    $0x77,%eax
je     13cf <main+0x26f>
cmp    $0x72,%eax
jne    135a <main+0x1fa>
mov    %rbx,%rdi
lea    0xd48(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
orb    $0x4,0x10(%rsp,%rax,1)
jmp    135a <main+0x1fa>
nop
mov    %rbx,%rdi
lea    0xd03(%rip),%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
testb  $0x2,0x10(%rsp,%rax,1)
mov    $0x0,%eax
cmove  %eax,%r14d
mov    %rbx,%rdi
call   1080 <getc@plt>
cmp    $0x20,%al
jne    11d0 <main+0x70>
mov    %rbx,%rdi
lea    0xca0(%rip),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2c5d(%rip),%rcx
cmp    (%rcx),%rax
jne    1230 <main+0xd0>
jmp    11d0 <main+0x70>
mov    %rbx,%rdi
lea    0xcb3(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
orb    $0x1,0x10(%rsp,%rax,1)
jmp    135a <main+0x1fa>
mov    %rbx,%rdi
lea    0xc6f(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
movsbl 0xe(%rsp),%edi
call   1040 <d@plt>
lea    (%rax,%rax,2),%ebp
movsbl 0xd(%rsp),%edi
call   1040 <d@plt>
add    %ebp,%eax
cltq
orb    $0x2,0x10(%rsp,%rax,1)
jmp    135a <main+0x1fa>
mov    (%rsi),%rsi
lea    0xbee(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [21 x i8] c"user_%c=>file_%c=>%c\00"
@EOF = global i64 0
@__const.main.uperm = [18 x i8] c"\07\03\00\06\02\04\05\01\05\03\07\01\06\00\02\04\02\06"
@.str.3 = [4 x i8] c"ead\00"
@.str.4 = [5 x i8] c"rite\00"
@.str.5 = [9 x i8] c"rant=>%c\00"
@.str.6 = [13 x i8] c"ead=>user_%c\00"
@.str.7 = [14 x i8] c"rite=>user_%c\00"
@.str.8 = [14 x i8] c"rant=>user_%c\00"
@.str.9 = [5 x i8] c"True\00"
@.str.10 = [6 x i8] c"False\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
%9 = alloca i8
%10 = alloca [18 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %153
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i32 1
store i8** %21, i8*** %5
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %6
br label %24
24: ; preds = %146, %19
%25 = load i32*, i32** %6
%26 = call i64 (i32*, i8*, ...) @fscanf(i32* %25, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
%27 = load i64, i64* @EOF
%28 = icmp ne i64 %26, %27
br i1 %28, label %29, label %152
29: ; preds = %24
%30 = bitcast [18 x i8]* %10 to i8*
store i32 1, i32* %11
br label %31
31: ; preds = %144, %29
%32 = load i8, i8* %9
%33 = sext i8 %32 to i32
switch i32 %33, label %133 [
i32 114, label %34
i32 119, label %51
i32 103, label %68
]
34: ; preds = %31
%35 = load i32*, i32** %6
%36 = call i64 (i32*, i8*, ...) @fscanf(i32* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%37 = load i8, i8* %7
%38 = call i32 @d(i8 signext %37)
%39 = mul nsw i32 %38, 3
%40 = load i8, i8* %8
%41 = call i32 @d(i8 signext %40)
%42 = add nsw i32 %39, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = and i32 %46, 4
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %34
store i32 0, i32* %11
br label %50
50: ; preds = %49, %34
br label %133
51: ; preds = %31
%52 = load i32*, i32** %6
%53 = call i64 (i32*, i8*, ...) @fscanf(i32* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%54 = load i8, i8* %7
%55 = call i32 @d(i8 signext %54)
%56 = mul nsw i32 %55, 3
%57 = load i8, i8* %8
%58 = call i32 @d(i8 signext %57)
%59 = add nsw i32 %56, %58
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = and i32 %63, 2
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %51
store i32 0, i32* %11
br label %67
67: ; preds = %66, %51
br label %133
68: ; preds = %31
%69 = load i32*, i32** %6
%70 = call i64 (i32*, i8*, ...) @fscanf(i32* %69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%71 = load i8, i8* %7
%72 = call i32 @d(i8 signext %71)
%73 = mul nsw i32 %72, 3
%74 = load i8, i8* %8
%75 = call i32 @d(i8 signext %74)
%76 = add nsw i32 %73, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = and i32 %80, 1
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %68
store i32 0, i32* %11
br label %84
84: ; preds = %83, %68
%85 = load i8, i8* %9
%86 = sext i8 %85 to i32
switch i32 %86, label %132 [
i32 114, label %87
i32 119, label %102
i32 103, label %117
]
87: ; preds = %84
%88 = load i32*, i32** %6
%89 = call i64 (i32*, i8*, ...) @fscanf(i32* %88, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %7)
%90 = load i8, i8* %7
%91 = call i32 @d(i8 signext %90)
%92 = mul nsw i32 %91, 3
%93 = load i8, i8* %8
%94 = call i32 @d(i8 signext %93)
%95 = add nsw i32 %92, %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = or i32 %99, 4
%101 = trunc i32 %100 to i8
store i8 %101, i8* %97
br label %132
102: ; preds = %84
%103 = load i32*, i32** %6
%104 = call i64 (i32*, i8*, ...) @fscanf(i32* %103, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%105 = load i8, i8* %7
%106 = call i32 @d(i8 signext %105)
%107 = mul nsw i32 %106, 3
%108 = load i8, i8* %8
%109 = call i32 @d(i8 signext %108)
%110 = add nsw i32 %107, %109
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %111
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = or i32 %114, 2
%116 = trunc i32 %115 to i8
store i8 %116, i8* %112
br label %132
117: ; preds = %84
%118 = load i32*, i32** %6
%119 = call i64 (i32*, i8*, ...) @fscanf(i32* %118, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %7)
%120 = load i8, i8* %7
%121 = call i32 @d(i8 signext %120)
%122 = mul nsw i32 %121, 3
%123 = load i8, i8* %8
%124 = call i32 @d(i8 signext %123)
%125 = add nsw i32 %122, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %126
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = or i32 %129, 1
%131 = trunc i32 %130 to i8
store i8 %131, i8* %127
br label %132
132: ; preds = %117, %84, %102, %87
br label %133
133: ; preds = %132, %31, %67, %50
br label %134
134: ; preds = %133
%135 = load i32*, i32** %6
%136 = call signext i8 @getc(i32* %135)
%137 = sext i8 %136 to i32
%138 = icmp eq i32 %137, 32
br i1 %138, label %139, label %144
139: ; preds = %134
%140 = load i32*, i32** %6
%141 = call i64 (i32*, i8*, ...) @fscanf(i32* %140, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
%142 = load i64, i64* @EOF
%143 = icmp ne i64 %141, %142
br label %144
144: ; preds = %139, %134
%145 = phi i1 [ false, %134 ], [ %143, %139 ]
br i1 %145, label %31, label %146
146: ; preds = %144
%147 = load i32, i32* %11
%148 = icmp ne i32 %147, 0
%149 = zext i1 %148 to i64
%150 = select i1 %148, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%151 = call i32 @puts(i8* %150)
br label %24
152: ; preds = %24
store i32 0, i32* %3
br label %153
153: ; preds = %152, %14
%154 = load i32, i32* %3
ret i32 %154
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [21 x i8] c"user_%c=>file_%c=>%c\00"
@EOF = global i64 0
@__const.main.uperm = [18 x i8] c"\07\03\00\06\02\04\05\01\05\03\07\01\06\00\02\04\02\06"
@.str.3 = [4 x i8] c"ead\00"
@.str.4 = [5 x i8] c"rite\00"
@.str.5 = [9 x i8] c"rant=>%c\00"
@.str.6 = [13 x i8] c"ead=>user_%c\00"
@.str.7 = [14 x i8] c"rite=>user_%c\00"
@.str.8 = [14 x i8] c"rant=>user_%c\00"
@.str.9 = [5 x i8] c"True\00"
@.str.10 = [6 x i8] c"False\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca [18 x i8]
%7 = icmp eq i32 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %120
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %120, label %18
18: ; preds = %11
%19 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
br label %20
20: ; preds = %18, %113
br label %21
21: ; preds = %109, %20
%22 = phi i32 [ 1, %20 ], [ %106, %109 ]
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
switch i32 %24, label %105 [
i32 114, label %25
i32 119, label %39
i32 103, label %53
]
25: ; preds = %21
%26 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%27 = load i8, i8* %3
%28 = call i32 @d(i8 signext %27)
%29 = mul nsw i32 %28, 3
%30 = load i8, i8* %4
%31 = call i32 @d(i8 signext %30)
%32 = add nsw i32 %31, %29
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = and i8 %35, 4
%37 = icmp eq i8 %36, 0
%38 = select i1 %37, i32 0, i32 %22
br label %105
39: ; preds = %21
%40 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%41 = load i8, i8* %3
%42 = call i32 @d(i8 signext %41)
%43 = mul nsw i32 %42, 3
%44 = load i8, i8* %4
%45 = call i32 @d(i8 signext %44)
%46 = add nsw i32 %45, %43
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = and i8 %49, 2
%51 = icmp eq i8 %50, 0
%52 = select i1 %51, i32 0, i32 %22
br label %105
53: ; preds = %21
%54 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%55 = load i8, i8* %3
%56 = call i32 @d(i8 signext %55)
%57 = mul nsw i32 %56, 3
%58 = load i8, i8* %4
%59 = call i32 @d(i8 signext %58)
%60 = add nsw i32 %59, %57
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = and i8 %63, 1
%65 = icmp eq i8 %64, 0
%66 = select i1 %65, i32 0, i32 %22
%67 = load i8, i8* %5
%68 = sext i8 %67 to i32
switch i32 %68, label %105 [
i32 114, label %69
i32 119, label %81
i32 103, label %93
]
69: ; preds = %53
%70 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%71 = load i8, i8* %3
%72 = call i32 @d(i8 signext %71)
%73 = mul nsw i32 %72, 3
%74 = load i8, i8* %4
%75 = call i32 @d(i8 signext %74)
%76 = add nsw i32 %75, %73
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = or i8 %79, 4
store i8 %80, i8* %78
br label %105
81: ; preds = %53
%82 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%83 = load i8, i8* %3
%84 = call i32 @d(i8 signext %83)
%85 = mul nsw i32 %84, 3
%86 = load i8, i8* %4
%87 = call i32 @d(i8 signext %86)
%88 = add nsw i32 %87, %85
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = or i8 %91, 2
store i8 %92, i8* %90
br label %105
93: ; preds = %53
%94 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %3)
%95 = load i8, i8* %3
%96 = call i32 @d(i8 signext %95)
%97 = mul nsw i32 %96, 3
%98 = load i8, i8* %4
%99 = call i32 @d(i8 signext %98)
%100 = add nsw i32 %99, %97
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 %101
%103 = load i8, i8* %102
%104 = or i8 %103, 1
store i8 %104, i8* %102
br label %105
105: ; preds = %39, %25, %21, %93, %53, %81, %69
%106 = phi i32 [ %22, %21 ], [ %66, %53 ], [ %66, %93 ], [ %66, %81 ], [ %66, %69 ], [ %38, %25 ], [ %52, %39 ]
%107 = call signext i8 @getc(i32* %14)
%108 = icmp eq i8 %107, 32
br i1 %108, label %109, label %113
109: ; preds = %105
%110 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
%111 = load i64, i64* @EOF
%112 = icmp eq i64 %110, %111
br i1 %112, label %113, label %21
113: ; preds = %105, %109
%114 = icmp eq i32 %106, 0
%115 = select i1 %114, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0)
%116 = call i32 @puts(i8* dereferenceable(1) %115)
%117 = call i64 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
%118 = load i64, i64* @EOF
%119 = icmp eq i64 %117, %118
br i1 %119, label %120, label %20
120: ; preds = %113, %11, %8
%121 = phi i32 [ 1, %8 ], [ 0, %11 ], [ 0, %113 ]
ret i32 %121
}