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

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strcspn(char *, char *);
int strlen(char *);
char *strtok(char *, char const *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  FILE *fp, *tfp, *rfp;
  char path[1035];
  char comPath[1024];
  char tempcomPath[1024];
  const char s[2] = " ";
  char *token;
  int nLen;
  int natoiResult, nMatchedResult = 0;
  char MatchedName[100];
  fp = popen("/bin/ls ./Authorized/", "r");
  if (fp == NULL) {
    printf("Failed to run command\n");
    exit(1);
  }
  while (fgets(path, sizeof(path) - 1, fp) != NULL) {
    printf("%s", path);
    path[strcspn(path, "\n")] = 0;
    nLen = strlen(path);
    printf("Length : %d", nLen);
    sprintf(comPath,
            "br -algorithm FaceRecognition -compare ./uploads/myImage.png "
            "./Authorized/%s/ > OUTPUT.txt",
            path);
    system(comPath);
    printf("/n%s", comPath);
    tfp = fopen("OUTPUT.txt", "r");
    while (fgets(tempcomPath, sizeof(tempcomPath) - 1, tfp) != NULL) {
      printf("OUTFILE DATA: %s", tempcomPath);
      token = strtok(tempcomPath, s);
      while (token != NULL) {
        printf(" %s\n", token);
        natoiResult = atoi(token);
        printf("INTERGER VAL: %d", atoi(token));
        if (natoiResult >= 3) {
          nMatchedResult = natoiResult;
          strcpy(MatchedName, path);
          sprintf(MatchedName, "%s,%d", path, nMatchedResult);
        }
        token = strtok(NULL, s);
      }
    }
  }
  rfp = fopen("result.txt", "w");
  fputs(MatchedName, rfp);
  pclose(tfp);
  pclose(fp);
  pclose(rfp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xcc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe00(%rip),%ax
mov    %ax,-0xc42(%rbp)
movl   $0x0,-0xc5c(%rbp)
lea    0xdea(%rip),%rdi
lea    0xdf9(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    124b <main+0x6b>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1250 <main+0x70>
lea    -0x440(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x40a,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     142c <main+0x24c>
lea    -0x440(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x440(%rbp),%rdi
lea    0xd9d(%rip),%rsi
call   1090 <strcspn@plt>
movb   $0x0,-0x440(%rbp,%rax,1)
lea    -0x440(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc54(%rbp)
mov    -0xc54(%rbp),%esi
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x840(%rbp),%rdi
lea    -0x440(%rbp),%rdx
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   10f0 <sprintf@plt>
lea    -0x840(%rbp),%rdi
call   1050 <system@plt>
lea    -0x840(%rbp),%rsi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd84(%rip),%rdi
lea    0xd08(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0xc40(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x3ff,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     1427 <main+0x247>
lea    -0xc40(%rbp),%rsi
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc40(%rbp),%rdi
lea    -0xc42(%rbp),%rsi
call   10d0 <strtok@plt>
mov    %rax,-0xc50(%rbp)
cmpq   $0x0,-0xc50(%rbp)
je     1422 <main+0x242>
mov    -0xc50(%rbp),%rsi
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc50(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xc58(%rbp)
mov    -0xc50(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,%esi
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x3,-0xc58(%rbp)
jl     1406 <main+0x226>
mov    -0xc58(%rbp),%eax
mov    %eax,-0xc5c(%rbp)
lea    -0xcc0(%rbp),%rdi
lea    -0x440(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xcc0(%rbp),%rdi
lea    -0x440(%rbp),%rdx
mov    -0xc5c(%rbp),%ecx
lea    0xcc5(%rip),%rsi
mov    $0x0,%al
call   10f0 <sprintf@plt>
lea    -0xc42(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <strtok@plt>
mov    %rax,-0xc50(%rbp)
jmp    1367 <main+0x187>
jmp    1319 <main+0x139>
jmp    1250 <main+0x70>
lea    0xc97(%rip),%rdi
lea    0xc9b(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
lea    -0xcc0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rdi
call   1070 <pclose@plt>
mov    -0x18(%rbp),%rdi
call   1070 <pclose@plt>
mov    -0x28(%rbp),%rdi
call   1070 <pclose@plt>
xor    %eax,%eax
add    $0xcc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xca8,%rsp
movw   $0x20,0xe(%rsp)
lea    0xdf1(%rip),%rdi
lea    0xe00(%rip),%rsi
call   10c0 <popen@plt>
test   %rax,%rax
je     1439 <main+0x249>
mov    %rax,%r12
lea    0x90(%rsp),%rdi
mov    $0x40a,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     13e8 <main+0x1f8>
lea    0x90(%rsp),%rbx
lea    0xe(%rsp),%r15
lea    0x20(%rsp),%r13
mov    %r12,0x18(%rsp)
jmp    1281 <main+0x91>
xchg   %ax,%ax
mov    %r14,%rbx
mov    %r14,%rdi
mov    $0x40a,%esi
mov    0x18(%rsp),%r12
mov    %r12,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     13e8 <main+0x1f8>
lea    0xe0a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
lea    0xdfc(%rip),%rsi
call   10a0 <strcspn@plt>
movb   $0x0,0x90(%rsp,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xd60(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x8a0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xd51(%rip),%rsi
mov    %rbx,%r14
mov    %rbx,%rdx
xor    %eax,%eax
call   1100 <sprintf@plt>
mov    %rbp,%rdi
call   1060 <system@plt>
lea    0xd90(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd74(%rip),%rdi
lea    0xd0f(%rip),%rsi
call   10d0 <fopen@plt>
lea    0x4a0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %rax,0x10(%rsp)
mov    %rax,%rdx
jmp    1345 <main+0x155>
cs nopw 0x0(%rax,%rax,1)
lea    0x4a0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    0x10(%rsp),%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     1260 <main+0x70>
lea    0xd2a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10e0 <strtok@plt>
test   %rax,%rax
je     1330 <main+0x140>
mov    %rax,%r12
jmp    1392 <main+0x1a2>
nopl   0x0(%rax)
xor    %edi,%edi
mov    %r15,%rsi
call   10e0 <strtok@plt>
mov    %rax,%r12
test   %rax,%rax
je     1330 <main+0x140>
lea    0xcfc(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebx
lea    0xce6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0x3,%ebx
jl     1380 <main+0x190>
mov    %r13,%rdi
mov    %r14,%rbp
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
lea    0xcd1(%rip),%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1100 <sprintf@plt>
jmp    1380 <main+0x190>
lea    0xcc2(%rip),%rdi
lea    0xcc6(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
lea    0x20(%rsp),%rdi
mov    %rax,%rsi
call   1090 <fputs@plt>
mov    0x10(%rsp),%rdi
call   1080 <pclose@plt>
mov    %r12,%rdi
call   1080 <pclose@plt>
mov    %rbp,%rdi
call   1080 <pclose@plt>
xor    %eax,%eax
add    $0xca8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc7e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@__const.main.s = [2 x i8] c" \00"
@.str = [22 x i8] c"/bin/ls ./Authorized/\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"Failed to run command\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [12 x i8] c"Length : %d\00"
@.str.6 = [91 x i8] c"br -algorithm FaceRecognition -compare ./uploads/myImage.png ./Authorized/%s/ > OUTPUT.txt\00"
@.str.7 = [5 x i8] c"/n%s\00"
@.str.8 = [11 x i8] c"OUTPUT.txt\00"
@.str.9 = [17 x i8] c"OUTFILE DATA: %s\00"
@.str.10 = [5 x i8] c" %s\0A\00"
@.str.11 = [17 x i8] c"INTERGER VAL: %d\00"
@.str.12 = [6 x i8] c"%s,%d\00"
@.str.13 = [11 x i8] c"result.txt\00"
@.str.14 = [2 x i8] c"w\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 [1035 x i8]
%10 = alloca [1024 x i8]
%11 = alloca [1024 x i8]
%12 = alloca [2 x i8]
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [2 x i8]* %12 to i8*
store i32 0, i32* %16
%19 = call i32* @popen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i32*, i32** %6
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
br label %26
26: ; preds = %86, %25
%27 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%28 = load i32*, i32** %6
%29 = call i32* @fgets(i8* %27, i32 1034, i32* %28)
%30 = icmp ne i32* %29, null
br i1 %30, label %31, label %87
31: ; preds = %26
%32 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%35 = call i64 @strcspn(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%36 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 %35
store i8 0, i8* %36
%37 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
store i32 %38, i32* %14
%39 = load i32, i32* %14
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%42 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%43 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %41, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%45 = call i32 @system(i8* %44)
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %46)
%48 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %48, i32** %7
br label %49
49: ; preds = %85, %31
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%51 = load i32*, i32** %7
%52 = call i32* @fgets(i8* %50, i32 1023, i32* %51)
%53 = icmp ne i32* %52, null
br i1 %53, label %54, label %86
54: ; preds = %49
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%58 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%59 = call i8* @strtok(i8* %57, i8* %58)
store i8* %59, i8** %13
br label %60
60: ; preds = %82, %54
%61 = load i8*, i8** %13
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %85
63: ; preds = %60
%64 = load i8*, i8** %13
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %64)
%66 = load i8*, i8** %13
%67 = call i32 @atoi(i8* %66)
store i32 %67, i32* %15
%68 = load i8*, i8** %13
%69 = call i32 @atoi(i8* %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %15
%72 = icmp sge i32 %71, 3
br i1 %72, label %73, label %82
73: ; preds = %63
%74 = load i32, i32* %15
store i32 %74, i32* %16
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %17, i64 0, i64 0
%76 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%77 = call i32 @strcpy(i8* %75, i8* %76)
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %17, i64 0, i64 0
%79 = getelementptr inbounds [1035 x i8], [1035 x i8]* %9, i64 0, i64 0
%80 = load i32, i32* %16
%81 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %79, i32 %80)
br label %82
82: ; preds = %73, %63
%83 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%84 = call i8* @strtok(i8* null, i8* %83)
store i8* %84, i8** %13
br label %60
85: ; preds = %60
br label %49
86: ; preds = %49
br label %26
87: ; preds = %26
%88 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
store i32* %88, i32** %8
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %17, i64 0, i64 0
%90 = load i32*, i32** %8
%91 = call i32 @fputs(i8* %89, i32* %90)
%92 = load i32*, i32** %7
%93 = call i32 @pclose(i32* %92)
%94 = load i32*, i32** %6
%95 = call i32 @pclose(i32* %94)
%96 = load i32*, i32** %8
%97 = call i32 @pclose(i32* %96)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/bin/ls ./Authorized/\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [12 x i8] c"Length : %d\00"
@.str.6 = [91 x i8] c"br -algorithm FaceRecognition -compare ./uploads/myImage.png ./Authorized/%s/ > OUTPUT.txt\00"
@.str.7 = [5 x i8] c"/n%s\00"
@.str.8 = [11 x i8] c"OUTPUT.txt\00"
@.str.9 = [17 x i8] c"OUTFILE DATA: %s\00"
@.str.10 = [5 x i8] c" %s\0A\00"
@.str.11 = [17 x i8] c"INTERGER VAL: %d\00"
@.str.12 = [6 x i8] c"%s,%d\00"
@.str.13 = [11 x i8] c"result.txt\00"
@.str.14 = [2 x i8] c"w\00"
@str = [22 x i8] c"Failed to run command\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1035 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca i16
%7 = alloca [100 x i8]
%8 = getelementptr inbounds [1035 x i8], [1035 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = bitcast i16* %6 to i8*
store i16 32, i16* %6
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = tail call i32* @popen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = call i32* @fgets(i8* %8, i32 1034, i32* %13)
%17 = icmp eq i32* %16, null
br i1 %17, label %55, label %24
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %36, %24
%22 = call i32* @fgets(i8* %8, i32 1034, i32* %13)
%23 = icmp eq i32* %22, null
br i1 %23, label %55, label %24
24: ; preds = %15, %21
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%26 = call i64 @strcspn(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%27 = getelementptr inbounds [1035 x i8], [1035 x i8]* %3, i64 0, i64 %26
store i8 0, i8* %27
%28 = call i32 @strlen(i8* %8)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str.6, i64 0, i64 0), i8* %8)
%31 = call i32 @system(i8* %9)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%33 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32* @fgets(i8* %10, i32 1023, i32* %33)
%35 = icmp eq i32* %34, null
br i1 %35, label %21, label %39
36: ; preds = %52, %39
%37 = call i32* @fgets(i8* %10, i32 1023, i32* %33)
%38 = icmp eq i32* %37, null
br i1 %38, label %21, label %39
39: ; preds = %24, %36
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %10)
%41 = call i8* @strtok(i8* %10, i8* %11)
%42 = icmp eq i8* %41, null
br i1 %42, label %36, label %43
43: ; preds = %39, %52
%44 = phi i8* [ %53, %52 ], [ %41, %39 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %44)
%46 = call i32 @atoi(i8* %44)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %46)
%48 = icmp sgt i32 %46, 2
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = call i32 @strcpy(i8* %12, i8* %8)
%51 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %8, i32 %46)
br label %52
52: ; preds = %49, %43
%53 = call i8* @strtok(i8* null, i8* %11)
%54 = icmp eq i8* %53, null
br i1 %54, label %36, label %43
55: ; preds = %21, %15
%56 = phi i32* [ undef, %15 ], [ %33, %21 ]
%57 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%58 = call i32 @fputs(i8* %12, i32* %57)
%59 = call i32 @pclose(i32* %56)
%60 = call i32 @pclose(i32* %13)
%61 = call i32 @pclose(i32* %57)
ret i32 0
}