#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 dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int fscanf(int /*<<< orphan*/ *, char *, int *, int *);
int getpid();
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int dirTest() {
  struct dirent *dp;
  DIR *dir = opendir("/");
  printf("TESTING DIRS\n");
  printf("Opened the dir: %p\n", dir);
  while ((dp = readdir(dir)) != NULL) {
    printf("%s\n", dp->d_name);
  }
  closedir(dir);
  dir = opendir("/test");
  if (dir == NULL) {
    printf("Dir did not exist! Creating!\n");
    mkdir("/test", 0x0777);
  } else {
    printf("DIR /test exists!\n");
  }
  char buffer[128];
  sprintf(buffer, "/proc/%d", getpid());
  dir = opendir(buffer);
  printf("Opened the dir (%s): %p\n", buffer, dir);
  while ((dp = readdir(dir)) != NULL) {
    printf("%s\n", dp->d_name);
  }
  closedir(dir);
  FILE *f = fopen("/test/file.txt", "w+");
  if (f == NULL) {
    printf("ERROR: could not open file for writing!!\n");
  } else {
    fprintf(f, "before 13");
    FILE *rd = fopen("/test/file.txt", "r");
    fprintf(f, " after 14");
    fflush(f);
    if (rd == NULL) {
      printf("ERROR: could not open file for reading!!\n");
    } else {
      int before = 0;
      int after = 0;
      int ret = fscanf(rd, "before %d after %d", &before, &after);
      printf("SUCCESS: read %d, %d from 'pipe' (%d)\n", before, after, ret);
      fclose(rd);
    }
    fclose(f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<dirTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    0xe2e(%rip),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x10(%rbp)
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     122c <dirTest+0x6c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    11fb <dirTest+0x3b>
mov    -0x10(%rbp),%rdi
call   1090 <closedir@plt>
lea    0xdec(%rip),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1274 <dirTest+0xb4>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdc3(%rip),%rdi
mov    $0x777,%esi
call   1030 <mkdir@plt>
jmp    1282 <dirTest+0xc2>
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0xb8(%rbp),%rdi
mov    %eax,%edx
lea    0xdb8(%rip),%rsi
call   10e0 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x10(%rbp)
lea    -0x90(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1306 <dirTest+0x146>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12d5 <dirTest+0x115>
mov    -0x10(%rbp),%rdi
call   1090 <closedir@plt>
lea    0xd6b(%rip),%rdi
lea    0xd73(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    134a <dirTest+0x18a>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    142a <dirTest+0x26a>
mov    -0x98(%rbp),%rdi
lea    0xd65(%rip),%rsi
call   10a0 <fprintf@plt>
lea    0xd1d(%rip),%rdi
lea    0xd5c(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x98(%rbp),%rdi
lea    0xd44(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x98(%rbp),%rdi
call   10c0 <fflush@plt>
cmpq   $0x0,-0xa0(%rbp)
jne    13b7 <dirTest+0x1f7>
lea    0xd28(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    141e <dirTest+0x25e>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa0(%rbp),%rdi
lea    0xd24(%rip),%rsi
lea    -0xa4(%rbp),%rdx
lea    -0xa8(%rbp),%rcx
call   1080 <fscanf@plt>
mov    %eax,-0xac(%rbp)
mov    -0xa4(%rbp),%esi
mov    -0xa8(%rbp),%edx
mov    -0xac(%rbp),%ecx
lea    0xd05(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xa0(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x98(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirTest>:
push   %r14
push   %rbx
sub    $0x98,%rsp
lea    0xe1f(%rip),%rdi
call   1070 <opendir@plt>
mov    %rax,%rbx
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
lea    0xe06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     1227 <dirTest+0x57>
mov    (%rax),%rdi
call   1040 <puts@plt>
jmp    1210 <dirTest+0x40>
mov    %rbx,%rdi
call   10a0 <closedir@plt>
lea    0xde0(%rip),%rdi
call   1070 <opendir@plt>
test   %rax,%rax
je     124e <dirTest+0x7e>
lea    0xe66(%rip),%rdi
call   1040 <puts@plt>
jmp    126b <dirTest+0x9b>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
lea    0xdb5(%rip),%rdi
mov    $0x777,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xda3(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%edx
call   10e0 <sprintf@plt>
mov    %r14,%rdi
call   1070 <opendir@plt>
mov    %rax,%rbx
lea    0xd8b(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     12c7 <dirTest+0xf7>
mov    (%rax),%rdi
call   1040 <puts@plt>
jmp    12b0 <dirTest+0xe0>
mov    %rbx,%rdi
call   10a0 <closedir@plt>
lea    0xd68(%rip),%rdi
lea    0xd70(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     138e <dirTest+0x1be>
mov    %rax,%rbx
lea    0xd5b(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
lea    0xd30(%rip),%rdi
lea    0xd45(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r14
lea    0xd38(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   10c0 <fflush@plt>
test   %r14,%r14
je     139c <dirTest+0x1cc>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xd0c(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r14,%rdi
call   1090 <fscanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xcfe(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
jmp    13a8 <dirTest+0x1d8>
lea    0xd53(%rip),%rdi
call   1040 <puts@plt>
jmp    13b0 <dirTest+0x1e0>
lea    0xd1c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [2 x i8] c"/\00"
@.str.1 = [14 x i8] c"TESTING DIRS\0A\00"
@.str.2 = [20 x i8] c"Opened the dir: %p\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [6 x i8] c"/test\00"
@.str.5 = [30 x i8] c"Dir did not exist! Creating!\0A\00"
@.str.6 = [19 x i8] c"DIR /test exists!\0A\00"
@.str.7 = [9 x i8] c"/proc/%d\00"
@.str.8 = [25 x i8] c"Opened the dir (%s): %p\0A\00"
@.str.9 = [15 x i8] c"/test/file.txt\00"
@.str.10 = [3 x i8] c"w+\00"
@.str.11 = [42 x i8] c"ERROR: could not open file for writing!!\0A\00"
@.str.12 = [10 x i8] c"before 13\00"
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [10 x i8] c" after 14\00"
@.str.15 = [42 x i8] c"ERROR: could not open file for reading!!\0A\00"
@.str.16 = [19 x i8] c"before %d after %d\00"
@.str.17 = [39 x i8] c"SUCCESS: read %d, %d from 'pipe' (%d)\0A\00"
define i32 @dirTest() {
%1 = alloca %struct.dirent*
%2 = alloca i32*
%3 = alloca [128 x i8]
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = call i32* @opendir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32*, i32** %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32* %11)
br label %13
13: ; preds = %17, %0
%14 = load i32*, i32** %2
%15 = call %struct.dirent* @readdir(i32* %14)
store %struct.dirent* %15, %struct.dirent** %1
%16 = icmp ne %struct.dirent* %15, null
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load %struct.dirent*, %struct.dirent** %1
%19 = getelementptr inbounds %struct.dirent, %struct.dirent* %18, i32 0, i32 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %13
22: ; preds = %13
%23 = load i32*, i32** %2
%24 = call i32 @closedir(i32* %23)
%25 = call i32* @opendir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32* %25, i32** %2
%26 = load i32*, i32** %2
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 @mkdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 1911)
br label %33
31: ; preds = %22
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%35 = call i32 (...) @getpid()
%36 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%38 = call i32* @opendir(i8* %37)
store i32* %38, i32** %2
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%40 = load i32*, i32** %2
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %39, i32* %40)
br label %42
42: ; preds = %46, %33
%43 = load i32*, i32** %2
%44 = call %struct.dirent* @readdir(i32* %43)
store %struct.dirent* %44, %struct.dirent** %1
%45 = icmp ne %struct.dirent* %44, null
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = load %struct.dirent*, %struct.dirent** %1
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %49)
br label %42
51: ; preds = %42
%52 = load i32*, i32** %2
%53 = call i32 @closedir(i32* %52)
%54 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i32* %54, i32** %4
%55 = load i32*, i32** %4
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
br label %83
59: ; preds = %51
%60 = load i32*, i32** %4
%61 = call i32 @fprintf(i32* %60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%62 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %62, i32** %5
%63 = load i32*, i32** %4
%64 = call i32 @fprintf(i32* %63, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%65 = load i32*, i32** %4
%66 = call i32 @fflush(i32* %65)
%67 = load i32*, i32** %5
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %71
69: ; preds = %59
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
br label %80
71: ; preds = %59
store i32 0, i32* %6
store i32 0, i32* %7
%72 = load i32*, i32** %5
%73 = call i32 @fscanf(i32* %72, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %6, i32* %7)
store i32 %73, i32* %8
%74 = load i32, i32* %6
%75 = load i32, i32* %7
%76 = load i32, i32* %8
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i32 %74, i32 %75, i32 %76)
%78 = load i32*, i32** %5
%79 = call i32 @fclose(i32* %78)
br label %80
80: ; preds = %71, %69
%81 = load i32*, i32** %4
%82 = call i32 @fclose(i32* %81)
br label %83
83: ; preds = %80, %57
ret i32 0
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [2 x i8] c"/\00"
@.str.2 = [20 x i8] c"Opened the dir: %p\0A\00"
@.str.4 = [6 x i8] c"/test\00"
@.str.7 = [9 x i8] c"/proc/%d\00"
@.str.8 = [25 x i8] c"Opened the dir (%s): %p\0A\00"
@.str.9 = [15 x i8] c"/test/file.txt\00"
@.str.10 = [3 x i8] c"w+\00"
@.str.12 = [10 x i8] c"before 13\00"
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [10 x i8] c" after 14\00"
@.str.16 = [19 x i8] c"before %d after %d\00"
@.str.17 = [39 x i8] c"SUCCESS: read %d, %d from 'pipe' (%d)\0A\00"
@str = [13 x i8] c"TESTING DIRS\00"
@str.18 = [18 x i8] c"DIR /test exists!\00"
@str.19 = [41 x i8] c"ERROR: could not open file for reading!!\00"
@str.20 = [41 x i8] c"ERROR: could not open file for writing!!\00"
@str.21 = [29 x i8] c"Dir did not exist! Creating!\00"
define i32 @dirTest() {
%1 = alloca [128 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32* @opendir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%7 = tail call %struct.dirent* @readdir(i32* %4)
%8 = icmp eq %struct.dirent* %7, null
br i1 %8, label %16, label %9
9: ; preds = %0, %9
%10 = phi %struct.dirent* [ %14, %9 ], [ %7, %0 ]
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i64 0, i32 0
%12 = load i8*, i8** %11
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = tail call %struct.dirent* @readdir(i32* %4)
%15 = icmp eq %struct.dirent* %14, null
br i1 %15, label %16, label %9
16: ; preds = %9, %0
%17 = tail call i32 @closedir(i32* %4)
%18 = tail call i32* @opendir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.21, i64 0, i64 0))
%22 = tail call i32 @mkdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 1911)
br label %25
23: ; preds = %16
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.18, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%27 = tail call i32 (...) @getpid()
%28 = call i32 @sprintf(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = call i32* @opendir(i8* %26)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %26, i32* %29)
%31 = call %struct.dirent* @readdir(i32* %29)
%32 = icmp eq %struct.dirent* %31, null
br i1 %32, label %40, label %33
33: ; preds = %25, %33
%34 = phi %struct.dirent* [ %38, %33 ], [ %31, %25 ]
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i64 0, i32 0
%36 = load i8*, i8** %35
%37 = call i32 @puts(i8* dereferenceable(1) %36)
%38 = call %struct.dirent* @readdir(i32* %29)
%39 = icmp eq %struct.dirent* %38, null
br i1 %39, label %40, label %33
40: ; preds = %33, %25
%41 = call i32 @closedir(i32* %29)
%42 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.20, i64 0, i64 0))
br label %64
46: ; preds = %40
%47 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i64 9, i64 1, i32* %42)
%48 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%49 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i64 9, i64 1, i32* %42)
%50 = call i32 @fflush(i32* %42)
%51 = icmp eq i32* %48, null
br i1 %51, label %52, label %54
52: ; preds = %46
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.19, i64 0, i64 0))
br label %62
54: ; preds = %46
%55 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%56 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%57 = call i32 @fscanf(i32* %48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %2, i32* %3)
%58 = load i32, i32* %2
%59 = load i32, i32* %3
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i32 %58, i32 %59, i32 %57)
%61 = call i32 @fclose(i32* %48)
br label %62
62: ; preds = %54, %52
%63 = call i32 @fclose(i32* %42)
br label %64
64: ; preds = %62, %44
ret i32 0
}