#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen_http(char *, char *);
int /*<<< orphan*/ loop_delay(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *);
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  FILE *stream;
  char *url;
  int loops, i, j;
  char method[256];
  char server[256];
  char path[256];
  char buffer[80];
  if (argc != 3) {
    printf("Use: %s <url> <loops>\n", argv[0]);
    return EXIT_FAILURE;
  }
  url = argv[1];
  loops = atoi(argv[2]);
  printf("url:   %s\n", url);
  printf("loops: %d\n", loops);
  sscanf(url, "%[^:]://%[^/]%s", method, server, path);
  printf("method: %s\n", method);
  printf("server: %s\n", server);
  printf("path:   %s\n", path);
  for (i = 0; i < loops; i++) {
    printf("Making connection...\n");
    stream = fopen_http(server, path);
    if (!stream) {
      printf("FAILURE: fopen_http(): %s\n", strerror(errno));
      return -1;
    }
    printf("Getting data...\n");
    for (j = 0; j < 5; j++) {
      fgets(buffer, 80, stream);
      if (ferror(stream)) {
        printf("FAILURE: stream has an error: %s\n", strerror(errno));
        return -1;
      }
      printf(">>> %s", buffer);
      loop_delay(1);
    }
    printf("Closing connection...\n");
    fclose(stream);
    loop_delay(1);
  }
  printf("SUCCESS\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11d9 <main+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13d2 <main+0x242>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    -0x230(%rbp),%rcx
lea    -0x330(%rbp),%r8
lea    0xdf5(%rip),%rsi
call   1090 <sscanf@plt>
lea    -0x130(%rbp),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x230(%rbp),%rsi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x330(%rbp),%rsi
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13b8 <main+0x228>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x230(%rbp),%rdi
lea    -0x330(%rbp),%rsi
call   1070 <fopen_http@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12ea <main+0x15a>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13d2 <main+0x242>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1389 <main+0x1f9>
lea    -0x380(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x50,%esi
call   1080 <fgets@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     135c <main+0x1cc>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13d2 <main+0x242>
lea    -0x380(%rbp),%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12ff <main+0x16f>
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1283 <main+0xf3>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x358,%rsp
cmp    $0x3,%edi
jne    13ef <main+0x24f>
mov    0x8(%rsi),%rbp
mov    0x10(%rsi),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebx
lea    0xe47(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe41(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe3c(%rip),%rsi
lea    0x250(%rsp),%r14
lea    0x150(%rsp),%r15
lea    0x50(%rsp),%r12
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   10a0 <sscanf@plt>
lea    0xe1f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe1a(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe15(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    13da <main+0x23a>
lea    0x150(%rsp),%r15
lea    0x50(%rsp),%r12
mov    %rsp,%rbp
lea    0xe35(%rip),%r13
nopl   0x0(%rax)
lea    0xe36(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <fopen_http@plt>
test   %rax,%rax
je     1441 <main+0x2a1>
mov    %rax,%r14
lea    0xe28(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    140b <main+0x26b>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    140b <main+0x26b>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    140b <main+0x26b>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    140b <main+0x26b>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
jne    140b <main+0x26b>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
lea    0xd18(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    $0x1,%edi
call   1030 <loop_delay@plt>
add    $0xffffffff,%ebx
jne    1270 <main+0xd0>
lea    0xcc4(%rip),%rdi
call   1040 <puts@plt>
mov    0x2be3(%rip),%rax
jmp    1407 <main+0x267>
mov    (%rsi),%rsi
lea    0xc07(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2bd1(%rip),%rax
mov    (%rax),%eax
jmp    142f <main+0x28f>
mov    0x2bce(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xc5c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%eax
add    $0x358,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xc0b(%rip),%rdi
jmp    1420 <main+0x280>

LLVM IR (-O0):
@.str = [23 x i8] c"Use: %s <url> <loops>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [11 x i8] c"url: %s\0A\00"
@.str.2 = [11 x i8] c"loops: %d\0A\00"
@.str.3 = [16 x i8] c"%[^:]://%[^/]%s\00"
@.str.4 = [12 x i8] c"method: %s\0A\00"
@.str.5 = [12 x i8] c"server: %s\0A\00"
@.str.6 = [12 x i8] c"path: %s\0A\00"
@.str.7 = [22 x i8] c"Making connection...\0A\00"
@.str.8 = [27 x i8] c"FAILURE: fopen_http(): %s\0A\00"
@errno = global i32 0
@.str.9 = [17 x i8] c"Getting data...\0A\00"
@.str.10 = [34 x i8] c"FAILURE: stream has an error: %s\0A\00"
@.str.11 = [7 x i8] c">>> %s\00"
@.str.12 = [23 x i8] c"Closing connection...\0A\00"
@.str.13 = [9 x i8] c"SUCCESS\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
%12 = alloca [256 x i8]
%13 = alloca [256 x i8]
%14 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @EXIT_FAILURE
store i32 %22, i32* %3
br label %95
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
store i8* %26, i8** %7
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %8
%31 = load i8*, i8** %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = load i32, i32* %8
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i8*, i8** %7
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%39 = call i32 @sscanf(i8* %35, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %36, i8* %37, i8* %38)
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %44)
store i32 0, i32* %9
br label %46
46: ; preds = %89, %23
%47 = load i32, i32* %9
%48 = load i32, i32* %8
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %92
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%54 = call i32* @fopen_http(i8* %52, i8* %53)
store i32* %54, i32** %6
%55 = load i32*, i32** %6
%56 = icmp ne i32* %55, null
br i1 %56, label %61, label %57
57: ; preds = %50
%58 = load i32, i32* @errno
%59 = call i8* @strerror(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %59)
store i32 -1, i32* %3
br label %95
61: ; preds = %50
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %10
br label %63
63: ; preds = %81, %61
%64 = load i32, i32* %10
%65 = icmp slt i32 %64, 5
br i1 %65, label %66, label %84
66: ; preds = %63
%67 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%68 = load i32*, i32** %6
%69 = call i32 @fgets(i8* %67, i32 80, i32* %68)
%70 = load i32*, i32** %6
%71 = call i64 @ferror(i32* %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %66
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %75)
store i32 -1, i32* %3
br label %95
77: ; preds = %66
%78 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %78)
%80 = call i32 @loop_delay(i32 1)
br label %81
81: ; preds = %77
%82 = load i32, i32* %10
%83 = add nsw i32 %82, 1
store i32 %83, i32* %10
br label %63
84: ; preds = %63
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%86 = load i32*, i32** %6
%87 = call i32 @fclose(i32* %86)
%88 = call i32 @loop_delay(i32 1)
br label %89
89: ; preds = %84
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
store i32 %91, i32* %9
br label %46
92: ; preds = %46
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%94 = load i32, i32* @EXIT_SUCCESS
store i32 %94, i32* %3
br label %95
95: ; preds = %92, %73, %57, %17
%96 = load i32, i32* %3
ret i32 %96
}

LLVM IR (-O2):
@.str = [23 x i8] c"Use: %s <url> <loops>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [11 x i8] c"url: %s\0A\00"
@.str.2 = [11 x i8] c"loops: %d\0A\00"
@.str.3 = [16 x i8] c"%[^:]://%[^/]%s\00"
@.str.4 = [12 x i8] c"method: %s\0A\00"
@.str.5 = [12 x i8] c"server: %s\0A\00"
@.str.6 = [12 x i8] c"path: %s\0A\00"
@.str.8 = [27 x i8] c"FAILURE: fopen_http(): %s\0A\00"
@errno = global i32 0
@.str.10 = [34 x i8] c"FAILURE: stream has an error: %s\0A\00"
@.str.11 = [7 x i8] c">>> %s\00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"SUCCESS\00"
@str.14 = [21 x i8] c"Making connection...\00"
@str.15 = [16 x i8] c"Getting data...\00"
@str.16 = [22 x i8] c"Closing connection...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [80 x i8]
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 3
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
br label %82
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%24 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %8)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%28 = icmp sgt i32 %21, 0
br i1 %28, label %29, label %79
29: ; preds = %16, %71
%30 = phi i32 [ %77, %71 ], [ 0, %16 ]
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.14, i64 0, i64 0))
%32 = call i32* @fopen_http(i8* %8, i8* %9)
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i32, i32* @errno
%36 = call i8* @strerror(i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %36)
br label %82
38: ; preds = %29
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.15, i64 0, i64 0))
%40 = call i32 @fgets(i8* %10, i32 80, i32* %32)
%41 = call i64 @ferror(i32* %32)
%42 = icmp eq i64 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %65, %59, %53, %47, %38
%44 = load i32, i32* @errno
%45 = call i8* @strerror(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %45)
br label %82
47: ; preds = %38
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %10)
%49 = call i32 @loop_delay(i32 1)
%50 = call i32 @fgets(i8* %10, i32 80, i32* %32)
%51 = call i64 @ferror(i32* %32)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %43
53: ; preds = %47
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %10)
%55 = call i32 @loop_delay(i32 1)
%56 = call i32 @fgets(i8* %10, i32 80, i32* %32)
%57 = call i64 @ferror(i32* %32)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %43
59: ; preds = %53
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %10)
%61 = call i32 @loop_delay(i32 1)
%62 = call i32 @fgets(i8* %10, i32 80, i32* %32)
%63 = call i64 @ferror(i32* %32)
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %43
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %10)
%67 = call i32 @loop_delay(i32 1)
%68 = call i32 @fgets(i8* %10, i32 80, i32* %32)
%69 = call i64 @ferror(i32* %32)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %43
71: ; preds = %65
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %10)
%73 = call i32 @loop_delay(i32 1)
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%75 = call i32 @fclose(i32* %32)
%76 = call i32 @loop_delay(i32 1)
%77 = add nuw nsw i32 %30, 1
%78 = icmp eq i32 %77, %21
br i1 %78, label %79, label %29
79: ; preds = %71, %16
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%81 = load i32, i32* @EXIT_SUCCESS
br label %82
82: ; preds = %79, %43, %34, %12
%83 = phi i32 [ %15, %12 ], [ -1, %43 ], [ -1, %34 ], [ %81, %79 ]
ret i32 %83
}