#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 */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ stat(char *, struct stat *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int check_logs(char *working_dir) {
  FILE *jobptr;
  FILE *logp;
  char sys_command[1000];
  char current_directory[2000];
  char filestring[5000];
  char filestring2[5000];
  char filestring3[5000];
  struct stat st;
  sprintf(sys_command, "ls %s/Variants/logs/*job | wc -l", working_dir);
  printf("syscommand is %s\n", sys_command);
  jobptr = popen(sys_command, "r");
  if (fgets(filestring, 5000, jobptr) == NULL) {
    printf("nothing returned\n");
  } else {
    printf("list count is %s\n", filestring);
  }
  fclose(jobptr);
  sprintf(sys_command, "ls %s/Variants/logs/*out | wc -l", working_dir);
  printf("syscommand is %s\n", sys_command);
  jobptr = popen(sys_command, "r");
  if (fgets(filestring2, 5000, jobptr) == NULL) {
    printf("nothing returned\n");
  } else {
    printf("list count is %s\n", filestring2);
  }
  if (strcmp(filestring, filestring2) == 0) {
    sprintf(sys_command, "grep Exited %s/Variants/logs/*", working_dir);
    printf("sys command is %s\n", sys_command);
    logp = popen(sys_command, "r");
    if (fgets(filestring3, 5000, logp) == NULL) {
      printf("everything worked\n");
      fclose(jobptr);
      return 1;
    } else {
      printf("the logp is not null\n");
      sprintf(current_directory, "%s/Variants/logs/failed/", working_dir);
      if (stat(current_directory, &st) == 0) {
        printf("failed job and failed directory so exit out \n");
        return 5;
      } else {
        printf("current directory is %s\n", current_directory);
        sprintf(sys_command, "mkdir %s/Variants/logs/failed", working_dir);
        system(sys_command);
      }
    }
  }
  fclose(jobptr);
}


x86 assembly (clang, -O0):
<check_logs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x46a0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe5f(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x410(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x1f70(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1388,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1204 <check_logs+0x84>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1219 <check_logs+0x99>
lea    -0x1f70(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe25(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x410(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x3300(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1388,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1297 <check_logs+0x117>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12ac <check_logs+0x12c>
lea    -0x3300(%rbp),%rsi
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1f70(%rbp),%rdi
lea    -0x3300(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13ec <check_logs+0x26c>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd9f(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x410(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x4690(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1388,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    134e <check_logs+0x1ce>
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f5 <check_logs+0x275>
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xbe0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd67(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xbe0(%rbp),%rdi
lea    -0x4698(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
jne    13aa <check_logs+0x22a>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    13f5 <check_logs+0x275>
lea    -0xbe0(%rbp),%rsi
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd64(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <system@plt>
jmp    13e7 <check_logs+0x267>
jmp    13ec <check_logs+0x26c>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x46a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_logs>:
push   %r15
push   %r14
push   %rbx
sub    $0x4680,%rsp
mov    %rdi,%r14
lea    0xe5a(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   10b0 <sprintf@plt>
lea    0xe64(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe65(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <popen@plt>
mov    %rax,%rbx
lea    0x1f60(%rsp),%rdi
mov    $0x1388,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     120b <check_logs+0x7b>
lea    0xe3b(%rip),%rdi
lea    0x1f60(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1217 <check_logs+0x87>
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe21(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   10b0 <sprintf@plt>
lea    0xde4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <popen@plt>
mov    %rax,%rbx
lea    0xbd0(%rsp),%rdi
mov    $0x1388,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     128b <check_logs+0xfb>
lea    0xdbb(%rip),%rdi
lea    0xbd0(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1297 <check_logs+0x107>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0x1f60(%rsp),%rdi
lea    0xbd0(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12c6 <check_logs+0x136>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x4680,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xd9b(%rip),%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   10b0 <sprintf@plt>
lea    0xda3(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd3e(%rip),%rsi
mov    %r15,%rdi
call   10a0 <popen@plt>
lea    0x32f0(%rsp),%rdi
mov    $0x1388,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1389 <check_logs+0x1f9>
lea    0xdcc(%rip),%rdi
call   1030 <puts@plt>
lea    0xd70(%rip),%rsi
lea    0x400(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   10b0 <sprintf@plt>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1090 <stat@plt>
test   %rax,%rax
je     13a7 <check_logs+0x217>
lea    0xd5d(%rip),%rdi
lea    0x400(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd60(%rip),%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   10b0 <sprintf@plt>
mov    %r15,%rdi
call   1050 <system@plt>
jmp    12b1 <check_logs+0x121>
lea    0xd9c(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x1,%eax
jmp    12b9 <check_logs+0x129>
lea    0xd51(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%eax
jmp    12b9 <check_logs+0x129>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [33 x i8] c"ls %s/Variants/logs/*job | wc -l\00"
@.str.1 = [18 x i8] c"syscommand is %s\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [18 x i8] c"nothing returned\0A\00"
@.str.4 = [18 x i8] c"list count is %s\0A\00"
@.str.5 = [33 x i8] c"ls %s/Variants/logs/*out | wc -l\00"
@.str.6 = [31 x i8] c"grep Exited %s/Variants/logs/*\00"
@.str.7 = [19 x i8] c"sys command is %s\0A\00"
@.str.8 = [19 x i8] c"everything worked\0A\00"
@.str.9 = [22 x i8] c"the logp is not null\0A\00"
@.str.10 = [25 x i8] c"%s/Variants/logs/failed/\00"
@.str.11 = [46 x i8] c"failed job and failed directory so exit out \0A\00"
@.str.12 = [25 x i8] c"current directory is %s\0A\00"
@.str.13 = [30 x i8] c"mkdir %s/Variants/logs/failed\00"
define i32 @check_logs(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [1000 x i8]
%7 = alloca [2000 x i8]
%8 = alloca [5000 x i8]
%9 = alloca [5000 x i8]
%10 = alloca [5000 x i8]
%11 = alloca %struct.stat
store i8* %0, i8** %3
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%13 = load i8*, i8** %3
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%18 = call i32* @popen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %18, i32** %4
%19 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%20 = load i32*, i32** %4
%21 = call i32* @fgets(i8* %19, i32 5000, i32* %20)
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %28
25: ; preds = %1
%26 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %25, %23
%29 = load i32*, i32** %4
%30 = call i32 @fclose(i32* %29)
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%32 = load i8*, i8** %3
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%37 = call i32* @popen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %37, i32** %4
%38 = getelementptr inbounds [5000 x i8], [5000 x i8]* %9, i64 0, i64 0
%39 = load i32*, i32** %4
%40 = call i32* @fgets(i8* %38, i32 5000, i32* %39)
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %44
42: ; preds = %28
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %47
44: ; preds = %28
%45 = getelementptr inbounds [5000 x i8], [5000 x i8]* %9, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %42
%48 = getelementptr inbounds [5000 x i8], [5000 x i8]* %8, i64 0, i64 0
%49 = getelementptr inbounds [5000 x i8], [5000 x i8]* %9, i64 0, i64 0
%50 = call i64 @strcmp(i8* %48, i8* %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %88
52: ; preds = %47
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%54 = load i8*, i8** %3
%55 = call i32 @sprintf(i8* %53, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %54)
%56 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %56)
%58 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%59 = call i32* @popen(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %59, i32** %5
%60 = getelementptr inbounds [5000 x i8], [5000 x i8]* %10, i64 0, i64 0
%61 = load i32*, i32** %5
%62 = call i32* @fgets(i8* %60, i32 5000, i32* %61)
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %68
64: ; preds = %52
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%66 = load i32*, i32** %4
%67 = call i32 @fclose(i32* %66)
store i32 1, i32* %2
br label %91
68: ; preds = %52
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%70 = getelementptr inbounds [2000 x i8], [2000 x i8]* %7, i64 0, i64 0
%71 = load i8*, i8** %3
%72 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* %71)
%73 = getelementptr inbounds [2000 x i8], [2000 x i8]* %7, i64 0, i64 0
%74 = call i64 @stat(i8* %73, %struct.stat* %11)
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %68
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0))
store i32 5, i32* %2
br label %91
78: ; preds = %68
%79 = getelementptr inbounds [2000 x i8], [2000 x i8]* %7, i64 0, i64 0
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %79)
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%82 = load i8*, i8** %3
%83 = call i32 @sprintf(i8* %81, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%85 = call i32 @system(i8* %84)
br label %86
86: ; preds = %78
br label %87
87: ; preds = %86
br label %88
88: ; preds = %87, %47
%89 = load i32*, i32** %4
%90 = call i32 @fclose(i32* %89)
br label %91
91: ; preds = %88, %76, %64
%92 = load i32, i32* %2
ret i32 %92
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [33 x i8] c"ls %s/Variants/logs/*job | wc -l\00"
@.str.1 = [18 x i8] c"syscommand is %s\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.4 = [18 x i8] c"list count is %s\0A\00"
@.str.5 = [33 x i8] c"ls %s/Variants/logs/*out | wc -l\00"
@.str.6 = [31 x i8] c"grep Exited %s/Variants/logs/*\00"
@.str.7 = [19 x i8] c"sys command is %s\0A\00"
@.str.10 = [25 x i8] c"%s/Variants/logs/failed/\00"
@.str.12 = [25 x i8] c"current directory is %s\0A\00"
@.str.13 = [30 x i8] c"mkdir %s/Variants/logs/failed\00"
@str = [21 x i8] c"the logp is not null\00"
@str.14 = [45 x i8] c"failed job and failed directory so exit out \00"
@str.15 = [18 x i8] c"everything worked\00"
@str.17 = [17 x i8] c"nothing returned\00"
define i32 @check_logs(i8* %0) {
%2 = alloca [1000 x i8]
%3 = alloca [2000 x i8]
%4 = alloca [5000 x i8]
%5 = alloca [5000 x i8]
%6 = alloca [5000 x i8]
%7 = alloca %struct.stat
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [5000 x i8], [5000 x i8]* %6, i64 0, i64 0
%13 = bitcast %struct.stat* %7 to i8*
%14 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%16 = call i32* @popen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32* @fgets(i8* %10, i32 5000, i32* %16)
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %1
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.17, i64 0, i64 0))
br label %23
21: ; preds = %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %10)
br label %23
23: ; preds = %21, %19
%24 = call i32 @fclose(i32* %16)
%25 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%27 = call i32* @popen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32* @fgets(i8* %11, i32 5000, i32* %27)
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %32
30: ; preds = %23
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.17, i64 0, i64 0))
br label %34
32: ; preds = %23
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %11)
br label %34
34: ; preds = %32, %30
%35 = call i64 @strcmp(i8* %10, i8* %11)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %57
37: ; preds = %34
%38 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%40 = call i32* @popen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32* @fgets(i8* %12, i32 5000, i32* %40)
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %46
43: ; preds = %37
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.15, i64 0, i64 0))
%45 = call i32 @fclose(i32* %27)
br label %59
46: ; preds = %37
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%48 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%49 = call i64 @stat(i8* %9, %struct.stat* %7)
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.14, i64 0, i64 0))
br label %59
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %9)
%55 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %0)
%56 = call i32 @system(i8* %8)
br label %57
57: ; preds = %53, %34
%58 = call i32 @fclose(i32* %27)
br label %59
59: ; preds = %57, %51, %43
%60 = phi i32 [ 1, %43 ], [ 5, %51 ], [ undef, %57 ]
ret i32 %60
}