#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 */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char const *const, int /*<<< orphan*/ *);
size_t fread(char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int mkstemp(char *);
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ strcmp(char const *const, char *);
size_t strlen(char const *const);
int /*<<< orphan*/ unlink(char *);
int main(void) {
  char name[] = "/tmp/tst-freopen.XXXXXX";
  const char *const test = "Let's test freopen.\n";
  char temp[strlen(test) + 1];
  int fd = mkstemp(name);
  FILE *f;
  if (fd == -1) {
    printf("%u: cannot open temporary file: %m\n", 36);
    exit(1);
  }
  f = fdopen(fd, "w");
  if (f == NULL) {
    printf("%u: cannot fdopen temporary file: %m\n", 43);
    exit(1);
  }
  fputs(test, f);
  fclose(f);
  f = fopen(name, "r");
  if (f == NULL) {
    printf("%u: cannot fopen temporary file: %m\n", 53);
    exit(1);
  }
  if (fread(temp, 1, strlen(test), f) != strlen(test)) {
    printf("%u: couldn't read the file back: %m\n", 59);
    exit(1);
  }
  temp[strlen(test)] = '\0';
  if (strcmp(test, temp)) {
    printf("%u: read different string than was written:\n%s%s", 67, test, temp);
    exit(1);
  }
  f = freopen(name, "r+", f);
  if (f == NULL) {
    printf("%u: cannot freopen temporary file: %m\n", 74);
    exit(1);
  }
  if (fseek(f, 0, SEEK_SET) != 0) {
    printf("%u: couldn't fseek to start: %m\n", 80);
    exit(1);
  }
  if (fread(temp, 1, strlen(test), f) != strlen(test)) {
    printf("%u: couldn't read the file back: %m\n", 86);
    exit(1);
  }
  temp[strlen(test)] = '\0';
  if (strcmp(test, temp)) {
    printf("%u: read different string than was written:\n%s%s", 94, test, temp);
    exit(1);
  }
  fclose(f);
  unlink(name);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe2a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe27(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe24(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe21(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   10a0 <mkstemp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    122e <main+0x6e>
lea    0xe15(%rip),%rdi
mov    $0x24,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x44(%rbp),%edi
lea    0xe19(%rip),%rsi
call   10c0 <fdopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1269 <main+0xa9>
lea    0xe00(%rip),%rdi
mov    $0x2b,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x50(%rbp),%rsi
lea    0xda4(%rip),%rdi
call   1070 <fputs@plt>
mov    -0x50(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x20(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12be <main+0xfe>
lea    0xdd3(%rip),%rdi
mov    $0x35,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rcx
mov    $0x1,%esi
mov    $0x14,%edx
call   1040 <fread@plt>
cmp    $0x14,%rax
je     12fc <main+0x13c>
lea    0xdba(%rip),%rdi
mov    $0x3b,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movb   $0x0,-0x2c(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xd0d(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <main+0x182>
lea    -0x40(%rbp),%rcx
lea    0xda0(%rip),%rdi
mov    $0x43,%esi
lea    0xce7(%rip),%rdx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    -0x50(%rbp),%rdx
lea    0xda5(%rip),%rsi
call   1080 <freopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1382 <main+0x1c2>
lea    0xd8d(%rip),%rdi
mov    $0x4a,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x50(%rbp),%rdi
mov    0x2c53(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
cmp    $0x0,%rax
je     13bd <main+0x1fd>
lea    0xd79(%rip),%rdi
mov    $0x50,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rcx
mov    $0x1,%esi
mov    $0x14,%edx
call   1040 <fread@plt>
cmp    $0x14,%rax
je     13fb <main+0x23b>
lea    0xcbb(%rip),%rdi
mov    $0x56,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movb   $0x0,-0x2c(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xc0e(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1441 <main+0x281>
lea    -0x40(%rbp),%rcx
lea    0xca1(%rip),%rdi
mov    $0x5e,%esi
lea    0xbe8(%rip),%rdx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x50(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x20(%rbp),%rdi
call   1030 <unlink@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xe34(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x5858585858582e,%rax
mov    %rax,0x30(%rsp)
lea    0x20(%rsp),%rdi
call   1090 <mkstemp@plt>
cmp    $0xffffffff,%eax
jne    1200 <main+0x40>
lea    0xe37(%rip),%rdi
mov    $0x24,%esi
jmp    12d6 <main+0x116>
lea    0xe4a(%rip),%rsi
mov    %eax,%edi
call   10b0 <fdopen@plt>
test   %rax,%rax
jne    1224 <main+0x64>
lea    0xe39(%rip),%rdi
mov    $0x2b,%esi
jmp    12d6 <main+0x116>
mov    %rax,%rbx
lea    0xdea(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xe2a(%rip),%rsi
lea    0x20(%rsp),%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    126c <main+0xac>
lea    0xe16(%rip),%rdi
mov    $0x35,%esi
jmp    12d6 <main+0x116>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x14,%edx
mov    $0x1,%esi
mov    %rax,%rcx
call   1040 <fread@plt>
cmp    $0x14,%rax
jne    12ca <main+0x10a>
movb   $0x0,0x14(%rsp)
lea    0xd82(%rip),%rdi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    12e7 <main+0x127>
lea    0xe4c(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    %rbx,%rdx
call   1070 <freopen@plt>
test   %rax,%rax
jne    130e <main+0x14e>
lea    0xe36(%rip),%rdi
mov    $0x4a,%esi
jmp    12d6 <main+0x116>
lea    0xdcf(%rip),%rdi
mov    $0x3b,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xdd7(%rip),%rdi
lea    0xd23(%rip),%rdx
mov    %rsp,%rcx
mov    $0x43,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    %rax,%rbx
mov    0x2cc8(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
test   %rax,%rax
jne    1376 <main+0x1b6>
mov    %rsp,%rdi
mov    $0x14,%edx
mov    $0x1,%esi
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    $0x14,%rax
jne    1387 <main+0x1c7>
movb   $0x0,0x14(%rsp)
lea    0xcc8(%rip),%rdi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1398 <main+0x1d8>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0x20(%rsp),%rdi
call   1030 <unlink@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xda3(%rip),%rdi
mov    $0x50,%esi
jmp    12d6 <main+0x116>
lea    0xd12(%rip),%rdi
mov    $0x56,%esi
jmp    12d6 <main+0x116>
lea    0xd26(%rip),%rdi
lea    0xc72(%rip),%rdx
mov    %rsp,%rcx
mov    $0x5e,%esi
jmp    12fd <main+0x13d>

LLVM IR (-O0):
@__const.main.name = [24 x i8] c"/tmp/tst-freopen.XXXXXX\00"
@.str = [21 x i8] c"Let's test freopen.\0A\00"
@.str.1 = [36 x i8] c"%u: cannot open temporary file: %m\0A\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [38 x i8] c"%u: cannot fdopen temporary file: %m\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [37 x i8] c"%u: cannot fopen temporary file: %m\0A\00"
@.str.6 = [37 x i8] c"%u: couldn't read the file back: %m\0A\00"
@.str.7 = [49 x i8] c"%u: read different string than was written:\0A%s%s\00"
@.str.8 = [3 x i8] c"r+\00"
@.str.9 = [39 x i8] c"%u: cannot freopen temporary file: %m\0A\00"
@SEEK_SET = global i32 0
@.str.10 = [33 x i8] c"%u: couldn't fseek to start: %m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca i8*
%4 = alloca [21 x i8]
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
%7 = bitcast [24 x i8]* %2 to i8*
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %3
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%9 = call i32 @mkstemp(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 36)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %0
%16 = load i32, i32* %5
%17 = call i32* @fdopen(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 43)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %15
%24 = load i32*, i32** %6
%25 = call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i32* %24)
%26 = load i32*, i32** %6
%27 = call i32 @fclose(i32* %26)
%28 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %29, i32** %6
%30 = load i32*, i32** %6
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %23
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 53)
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %23
%36 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%37 = load i32*, i32** %6
%38 = call i64 @fread(i8* %36, i32 1, i64 20, i32* %37)
%39 = icmp ne i64 %38, 20
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 59)
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %35
%44 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 20
store i8 0, i8* %44
%45 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%46 = call i64 @strcmp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%50 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* %49)
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %43
%53 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%54 = load i32*, i32** %6
%55 = call i32* @freopen(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %54)
store i32* %55, i32** %6
%56 = load i32*, i32** %6
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 74)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %52
%62 = load i32*, i32** %6
%63 = load i32, i32* @SEEK_SET
%64 = call i64 @fseek(i32* %62, i32 0, i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 80)
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %61
%70 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%71 = load i32*, i32** %6
%72 = call i64 @fread(i8* %70, i32 1, i64 20, i32* %71)
%73 = icmp ne i64 %72, 20
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 86)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %69
%78 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 20
store i8 0, i8* %78
%79 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%80 = call i64 @strcmp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %77
%83 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%84 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 94, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %77
%87 = load i32*, i32** %6
%88 = call i32 @fclose(i32* %87)
%89 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%90 = call i32 @unlink(i8* %89)
%91 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.name = [24 x i8] c"/tmp/tst-freopen.XXXXXX\00"
@.str = [21 x i8] c"Let's test freopen.\0A\00"
@.str.1 = [36 x i8] c"%u: cannot open temporary file: %m\0A\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [38 x i8] c"%u: cannot fdopen temporary file: %m\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [37 x i8] c"%u: cannot fopen temporary file: %m\0A\00"
@.str.6 = [37 x i8] c"%u: couldn't read the file back: %m\0A\00"
@.str.7 = [49 x i8] c"%u: read different string than was written:\0A%s%s\00"
@.str.8 = [3 x i8] c"r+\00"
@.str.9 = [39 x i8] c"%u: cannot freopen temporary file: %m\0A\00"
@SEEK_SET = global i32 0
@.str.10 = [33 x i8] c"%u: couldn't fseek to start: %m\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [21 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%5 = call i32 @mkstemp(i8* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 36)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32* @fdopen(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 43)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %10
%17 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 20, i64 1, i32* %11)
%18 = call i32 @fclose(i32* %11)
%19 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 53)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %16
%25 = call i64 @fread(i8* %4, i32 1, i64 20, i32* %19)
%26 = icmp eq i64 %25, 20
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 59)
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %24
%31 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 20
store i8 0, i8* %31
%32 = call i64 @strcmp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %30
%38 = call i32* @freopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %19)
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 74)
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %37
%44 = load i32, i32* @SEEK_SET
%45 = call i64 @fseek(i32* %38, i32 0, i32 %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 80)
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %43
%51 = call i64 @fread(i8* %4, i32 1, i64 20, i32* %38)
%52 = icmp eq i64 %51, 20
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 86)
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %50
store i8 0, i8* %31
%57 = call i64 @strcmp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 94, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %56
%63 = call i32 @fclose(i32* %38)
%64 = call i32 @unlink(i8* %3)
%65 = call i32 @exit(i32 0)
unreachable
}