#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 */
typedef struct TYPE_9__ TYPE_1__;

/* Type definitions */
struct TYPE_9__ {
  int _fileno;
};
typedef TYPE_1__ FILE;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(TYPE_1__ *);
TYPE_1__ *fdopen(int, char *);
int fileno(TYPE_1__ *);
TYPE_1__ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, TYPE_1__ *);
char getc(TYPE_1__ *);
int lseek(int, int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
TYPE_1__ *stderr;
char *tmpnam(int /*<<< orphan*/ *);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char *argv[]) {
  char *name;
  FILE *fp = NULL;
  int retval = 0;
  int fd;
  name = tmpnam(NULL);
  fp = fopen(name, "w");
  printf("fopen fd: %d\n", fileno(fp));
  if (!(fp != NULL)) {
    fputs("test failed: "
          "fp != NULL"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  if (!(fileno(fp) == 3)) {
    fputs("test failed: "
          "fileno(fp) == 3"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  fputs("foobar and baz", fp);
  fclose(fp);
  fp = NULL;
  fd = open(name, O_RDONLY);
  printf("open fd: %d\n", fd);
  if (!(fd == 3)) {
    fputs("test failed: "
          "fd == 3"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  if (!(lseek(fd, 5, SEEK_SET) == 5)) {
    fputs("test failed: "
          "lseek (fd, 5, SEEK_SET) == 5"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  fp = fdopen(fd, "r");
  printf("fdopen fd: %d\n", fp->_fileno);
  if (!(fp != NULL)) {
    fputs("test failed: "
          "fp != NULL"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  if (!(fileno(fp) == 3)) {
    fputs("test failed: "
          "fileno(fp) == 3"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  if (!(getc(fp) == 'r')) {
    fputs("test failed: "
          "getc (fp) == 'r'"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
  if (!(getc(fp) == ' ')) {
    fputs("test failed: "
          "getc (fp) == ' '"
          "\n",
          stderr);
    retval = 1;
    goto the_end;
  };
the_end:
  if (fp != NULL)
    fclose(fp);
  unlink(name);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <tmpnam@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%esi
lea    0xdfa(%rip),%rdi
call   1050 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
jne    123a <main+0x8a>
mov    0x2db9(%rip),%rax
mov    (%rax),%rsi
lea    0xde7(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
cmp    $0x3,%eax
je     126e <main+0xbe>
mov    0x2d85(%rip),%rax
mov    (%rax),%rsi
lea    0xdcc(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x20(%rbp),%rsi
lea    0xdce(%rip),%rdi
call   1070 <fputs@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d4e(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xded(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x3,-0x28(%rbp)
je     12df <main+0x12f>
mov    0x2d14(%rip),%rax
mov    (%rax),%rsi
lea    0xd88(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x28(%rbp),%edi
mov    0x2ce7(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1060 <lseek@plt>
cmp    $0x5,%eax
je     1320 <main+0x170>
mov    0x2cd3(%rip),%rax
mov    (%rax),%rsi
lea    0xd5d(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x28(%rbp),%edi
lea    0xd6d(%rip),%rsi
call   1090 <fdopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xd59(%rip),%rdi
call   1050 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1372 <main+0x1c2>
mov    0x2c81(%rip),%rax
mov    (%rax),%rsi
lea    0xcaf(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
cmp    $0x3,%eax
je     13a6 <main+0x1f6>
mov    0x2c4d(%rip),%rax
mov    (%rax),%rsi
lea    0xc94(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x20(%rbp),%rdi
call   10d0 <getc@plt>
movsbl %al,%eax
cmp    $0x72,%eax
je     13dd <main+0x22d>
mov    0x2c16(%rip),%rax
mov    (%rax),%rsi
lea    0xcdc(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
mov    -0x20(%rbp),%rdi
call   10d0 <getc@plt>
movsbl %al,%eax
cmp    $0x20,%eax
je     1414 <main+0x264>
mov    0x2bdf(%rip),%rax
mov    (%rax),%rsi
lea    0xcc4(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x1,-0x24(%rbp)
jmp    1419 <main+0x269>
jmp    1419 <main+0x269>
cmpq   $0x0,-0x20(%rbp)
je     142d <main+0x27d>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   10c0 <tmpnam@plt>
mov    %rax,%r14
lea    0xe3b(%rip),%rsi
mov    %rax,%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <fileno@plt>
lea    0xe23(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
test   %rbx,%rbx
je     12cf <main+0x11f>
mov    %rbx,%rdi
call   1070 <fileno@plt>
cmp    $0x3,%eax
jne    12e7 <main+0x137>
lea    0xe40(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1090 <open@plt>
mov    %eax,%ebx
lea    0xe60(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
cmp    $0x3,%ebx
jne    1316 <main+0x166>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
mov    $0x5,%esi
call   1060 <lseek@plt>
cmp    $0x5,%eax
jne    132e <main+0x17e>
lea    0xe24(%rip),%rsi
mov    $0x3,%edi
call   1080 <fdopen@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xe10(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <fileno@plt>
cmp    $0x3,%eax
jne    12e7 <main+0x137>
mov    %rbx,%rdi
call   10d0 <getc@plt>
cmp    $0x72,%al
jne    1362 <main+0x1b2>
mov    %rbx,%rdi
call   10d0 <getc@plt>
xor    %ebp,%ebp
cmp    $0x20,%al
je     130c <main+0x15c>
mov    0x2d18(%rip),%rax
mov    (%rax),%rcx
lea    0xdfd(%rip),%rdi
jmp    1373 <main+0x1c3>
mov    0x2d02(%rip),%rax
mov    (%rax),%rcx
lea    0xd30(%rip),%rdi
mov    $0x18,%esi
jmp    1344 <main+0x194>
mov    0x2cea(%rip),%rax
mov    (%rax),%rcx
lea    0xd31(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    1353 <main+0x1a3>
mov    0x2cbb(%rip),%rax
mov    (%rax),%rcx
lea    0xd2f(%rip),%rdi
mov    $0x15,%esi
jmp    1344 <main+0x194>
mov    0x2ca3(%rip),%rax
mov    (%rax),%rcx
lea    0xd2d(%rip),%rdi
mov    $0x2a,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    $0x1,%ebp
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2c6f(%rip),%rax
mov    (%rax),%rcx
lea    0xd35(%rip),%rdi
mov    $0x1e,%esi
jmp    12fd <main+0x14d>

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32 }
@.str = [2 x i8] c"w\00"
@.str.1 = [14 x i8] c"fopen fd: %d\0A\00"
@.str.2 = [25 x i8] c"test failed: fp != NULL\0A\00"
@stderr = global %struct.TYPE_9__* null
@.str.3 = [30 x i8] c"test failed: fileno(fp) == 3\0A\00"
@.str.4 = [15 x i8] c"foobar and baz\00"
@O_RDONLY = global i32 0
@.str.5 = [13 x i8] c"open fd: %d\0A\00"
@.str.6 = [22 x i8] c"test failed: fd == 3\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [43 x i8] c"test failed: lseek (fd, 5, SEEK_SET) == 5\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [15 x i8] c"fdopen fd: %d\0A\00"
@.str.10 = [31 x i8] c"test failed: getc (fp) == 'r'\0A\00"
@.str.11 = [31 x i8] c"test failed: getc (fp) == ' '\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.TYPE_9__*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.TYPE_9__* null, %struct.TYPE_9__** %7
store i32 0, i32* %8
%10 = call i8* @tmpnam(i32* null)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call %struct.TYPE_9__* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store %struct.TYPE_9__* %12, %struct.TYPE_9__** %7
%13 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%14 = call i32 @fileno(%struct.TYPE_9__* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%17 = icmp ne %struct.TYPE_9__* %16, null
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%20 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_9__* %19)
store i32 1, i32* %8
br label %87
21: ; preds = %2
%22 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%23 = call i32 @fileno(%struct.TYPE_9__* %22)
%24 = icmp eq i32 %23, 3
br i1 %24, label %28, label %25
25: ; preds = %21
%26 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%27 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), %struct.TYPE_9__* %26)
store i32 1, i32* %8
br label %87
28: ; preds = %21
%29 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%30 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), %struct.TYPE_9__* %29)
%31 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%32 = call i32 @fclose(%struct.TYPE_9__* %31)
store %struct.TYPE_9__* null, %struct.TYPE_9__** %7
%33 = load i8*, i8** %6
%34 = load i32, i32* @O_RDONLY
%35 = call i32 @open(i8* %33, i32 %34)
store i32 %35, i32* %9
%36 = load i32, i32* %9
%37 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %9
%39 = icmp eq i32 %38, 3
br i1 %39, label %43, label %40
40: ; preds = %28
%41 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%42 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), %struct.TYPE_9__* %41)
store i32 1, i32* %8
br label %87
43: ; preds = %28
%44 = load i32, i32* %9
%45 = load i32, i32* @SEEK_SET
%46 = call i32 @lseek(i32 %44, i32 5, i32 %45)
%47 = icmp eq i32 %46, 5
br i1 %47, label %51, label %48
48: ; preds = %43
%49 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%50 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), %struct.TYPE_9__* %49)
store i32 1, i32* %8
br label %87
51: ; preds = %43
%52 = load i32, i32* %9
%53 = call %struct.TYPE_9__* @fdopen(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store %struct.TYPE_9__* %53, %struct.TYPE_9__** %7
%54 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%55 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %54, i32 0, i32 0
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %56)
%58 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%59 = icmp ne %struct.TYPE_9__* %58, null
br i1 %59, label %63, label %60
60: ; preds = %51
%61 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%62 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_9__* %61)
store i32 1, i32* %8
br label %87
63: ; preds = %51
%64 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%65 = call i32 @fileno(%struct.TYPE_9__* %64)
%66 = icmp eq i32 %65, 3
br i1 %66, label %70, label %67
67: ; preds = %63
%68 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%69 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), %struct.TYPE_9__* %68)
store i32 1, i32* %8
br label %87
70: ; preds = %63
%71 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%72 = call signext i8 @getc(%struct.TYPE_9__* %71)
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 114
br i1 %74, label %78, label %75
75: ; preds = %70
%76 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%77 = call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), %struct.TYPE_9__* %76)
store i32 1, i32* %8
br label %87
78: ; preds = %70
%79 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%80 = call signext i8 @getc(%struct.TYPE_9__* %79)
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 32
br i1 %82, label %86, label %83
83: ; preds = %78
%84 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%85 = call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), %struct.TYPE_9__* %84)
store i32 1, i32* %8
br label %87
86: ; preds = %78
br label %87
87: ; preds = %86, %83, %75, %67, %60, %48, %40, %25, %18
%88 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%89 = icmp ne %struct.TYPE_9__* %88, null
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load %struct.TYPE_9__*, %struct.TYPE_9__** %7
%92 = call i32 @fclose(%struct.TYPE_9__* %91)
br label %93
93: ; preds = %90, %87
%94 = load i8*, i8** %6
%95 = call i32 @unlink(i8* %94)
%96 = load i32, i32* %8
ret i32 %96
}

LLVM IR (-O2):
%struct.TYPE_9__ = type { i32 }
@.str = [2 x i8] c"w\00"
@.str.1 = [14 x i8] c"fopen fd: %d\0A\00"
@.str.2 = [25 x i8] c"test failed: fp != NULL\0A\00"
@stderr = global %struct.TYPE_9__* null
@.str.3 = [30 x i8] c"test failed: fileno(fp) == 3\0A\00"
@.str.4 = [15 x i8] c"foobar and baz\00"
@O_RDONLY = global i32 0
@.str.5 = [13 x i8] c"open fd: %d\0A\00"
@.str.6 = [22 x i8] c"test failed: fd == 3\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [43 x i8] c"test failed: lseek (fd, 5, SEEK_SET) == 5\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [15 x i8] c"fdopen fd: %d\0A\00"
@.str.10 = [31 x i8] c"test failed: getc (fp) == 'r'\0A\00"
@.str.11 = [31 x i8] c"test failed: getc (fp) == ' '\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @tmpnam(i32* null)
%4 = tail call %struct.TYPE_9__* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fileno(%struct.TYPE_9__* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = icmp eq %struct.TYPE_9__* %4, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 24, i64 1, %struct.TYPE_9__* %9)
br label %60
11: ; preds = %2
%12 = tail call i32 @fileno(%struct.TYPE_9__* %4)
%13 = icmp eq i32 %12, 3
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i64 29, i64 1, %struct.TYPE_9__* %15)
br label %56
17: ; preds = %11
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i64 14, i64 1, %struct.TYPE_9__* %4)
%19 = tail call i32 @fclose(%struct.TYPE_9__* %4)
%20 = load i32, i32* @O_RDONLY
%21 = tail call i32 @open(i8* %3, i32 %20)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = icmp eq i32 %21, 3
br i1 %23, label %27, label %24
24: ; preds = %17
%25 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i64 21, i64 1, %struct.TYPE_9__* %25)
br label %60
27: ; preds = %17
%28 = load i32, i32* @SEEK_SET
%29 = tail call i32 @lseek(i32 3, i32 5, i32 %28)
%30 = icmp eq i32 %29, 5
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i64 42, i64 1, %struct.TYPE_9__* %32)
br label %60
34: ; preds = %27
%35 = tail call %struct.TYPE_9__* @fdopen(i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%36 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %35, i64 0, i32 0
%37 = load i32, i32* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %37)
%39 = tail call i32 @fileno(%struct.TYPE_9__* %35)
%40 = icmp eq i32 %39, 3
br i1 %40, label %44, label %41
41: ; preds = %34
%42 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%43 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i64 29, i64 1, %struct.TYPE_9__* %42)
br label %56
44: ; preds = %34
%45 = tail call signext i8 @getc(%struct.TYPE_9__* %35)
%46 = icmp eq i8 %45, 114
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%49 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i64 30, i64 1, %struct.TYPE_9__* %48)
br label %56
50: ; preds = %44
%51 = tail call signext i8 @getc(%struct.TYPE_9__* %35)
%52 = icmp eq i8 %51, 32
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load %struct.TYPE_9__*, %struct.TYPE_9__** @stderr
%55 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i64 30, i64 1, %struct.TYPE_9__* %54)
br label %56
56: ; preds = %50, %53, %47, %41, %14
%57 = phi i32 [ 1, %14 ], [ 1, %41 ], [ 1, %47 ], [ 1, %53 ], [ 0, %50 ]
%58 = phi %struct.TYPE_9__* [ %4, %14 ], [ %35, %41 ], [ %35, %47 ], [ %35, %53 ], [ %35, %50 ]
%59 = tail call i32 @fclose(%struct.TYPE_9__* %58)
br label %60
60: ; preds = %8, %24, %31, %56
%61 = phi i32 [ %57, %56 ], [ 1, %31 ], [ 1, %24 ], [ 1, %8 ]
%62 = tail call i32 @unlink(i8* %3)
ret i32 %61
}