#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*/ uint64_t;
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
int strlen(char *);
char *strrchr(char *, char);
scalar_t__ strstr(char *, char *);
char *strtok(char *, char *);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
bool find_ld_in_memory(uint64_t *addr1, uint64_t *addr2) {
  FILE *f = NULL;
  char buffer[1024] = {0};
  char *tmp = NULL;
  char *start = NULL;
  char *end = NULL;
  bool found = false;
  if ((f = fopen("/proc/self/maps", "r")) == NULL) {
    fprintf(stderr,
            "[%s:%d] "
            "fopen"
            " %s\n",
            strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/"
                    "heads/master/main.c",
                    '/') > 0
                ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/m1m1x/"
                          "memdlopen/refs/heads/master/main.c",
                          '/') +
                      1
                : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/"
                  "heads/master/main.c",
            377, strerror(errno));
    ;
    return found;
  }
  while (fgets(buffer, sizeof(buffer), f)) {
    if (strstr(buffer, "r-xp") == 0) {
      continue;
    }
    if (strstr(buffer, "ld-2.19.so") == 0) {
      continue;
    }
    buffer[strlen(buffer) - 1] = 0;
    tmp = strrchr(buffer, ' ');
    if (tmp == NULL || tmp[0] != ' ')
      continue;
    ++tmp;
    start = strtok(buffer, "-");
    *addr1 = strtoul(start, NULL, 16);
    end = strtok(NULL, " ");
    *addr2 = strtoul(end, NULL, 16);
    fprintf(stdout,
            "[%s:%d] "
            "found ld : [%lx,%lx]"
            "\n",
            strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/"
                    "heads/master/main.c",
                    '/') > 0
                ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/m1m1x/"
                          "memdlopen/refs/heads/master/main.c",
                          '/') +
                      1
                : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/"
                  "heads/master/main.c",
            401, *addr1, *addr2);
    ;
    found = true;
  }
  fclose(f);
  return found;
}


x86 assembly (clang, -O0):
<find_ld_in_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
movq   $0x0,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
movq   $0x0,-0x438(%rbp)
movl   $0x0,-0x43c(%rbp)
lea    0xdf0(%rip),%rdi
lea    0xdf9(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    12d5 <find_ld_in_memory+0x125>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x440(%rbp)
lea    0xde4(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
cmp    $0x0,%rax
jbe    1275 <find_ld_in_memory+0xc5>
lea    0xdc9(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x448(%rbp)
jmp    1288 <find_ld_in_memory+0xd8>
lea    0xda8(%rip),%rax
mov    %rax,-0x448(%rbp)
jmp    1288 <find_ld_in_memory+0xd8>
mov    -0x448(%rbp),%rax
mov    %rax,-0x450(%rbp)
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x440(%rbp),%edi
mov    -0x450(%rbp),%rdx
mov    %rax,%r8
lea    0xd57(%rip),%rsi
mov    $0x179,%ecx
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x43c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14be <find_ld_in_memory+0x30e>
jmp    12da <find_ld_in_memory+0x12a>
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     14ac <find_ld_in_memory+0x2fc>
lea    -0x420(%rbp),%rdi
lea    0xda0(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
jne    131b <find_ld_in_memory+0x16b>
jmp    12da <find_ld_in_memory+0x12a>
lea    -0x420(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
jne    133d <find_ld_in_memory+0x18d>
jmp    12da <find_ld_in_memory+0x12a>
lea    -0x420(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x420(%rbp),%rdi
mov    $0x20,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
je     138f <find_ld_in_memory+0x1df>
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1394 <find_ld_in_memory+0x1e4>
jmp    12da <find_ld_in_memory+0x12a>
mov    -0x428(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xd03(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10b0 <strtoul@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcd1(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10b0 <strtoul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2bb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x454(%rbp)
lea    0xbfd(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
cmp    $0x0,%rax
jbe    145c <find_ld_in_memory+0x2ac>
lea    0xbe2(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x460(%rbp)
jmp    146f <find_ld_in_memory+0x2bf>
lea    0xbc1(%rip),%rax
mov    %rax,-0x460(%rbp)
jmp    146f <find_ld_in_memory+0x2bf>
mov    -0x454(%rbp),%edi
mov    -0x460(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq (%rax),%r8
mov    -0x18(%rbp),%rax
mov    (%rax),%r9d
lea    0xc2a(%rip),%rsi
mov    $0x191,%ecx
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x43c(%rbp)
jmp    12da <find_ld_in_memory+0x12a>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x43c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ld_in_memory>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x10(%rsp),%rdi
xor    %r14d,%r14d
mov    $0x400,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe1e(%rip),%rdi
lea    0xe27(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1327 <find_ld_in_memory+0x177>
mov    %rax,%r12
mov    %rbx,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     131d <find_ld_in_memory+0x16d>
lea    0xe83(%rip),%r13
lea    0xe81(%rip),%rbp
xor    %r14d,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r13,%rsi
call   10d0 <strstr@plt>
test   %rax,%rax
je     1276 <find_ld_in_memory+0xc6>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10d0 <strstr@plt>
test   %rax,%rax
je     1276 <find_ld_in_memory+0xc6>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1276 <find_ld_in_memory+0xc6>
cmpb   $0x20,(%rax)
je     1290 <find_ld_in_memory+0xe0>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1230 <find_ld_in_memory+0x80>
jmp    131d <find_ld_in_memory+0x16d>
mov    %rbx,%rdi
lea    0xe1d(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <strtoul@plt>
mov    %eax,(%r15)
xor    %edi,%edi
lea    0xdff(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <strtoul@plt>
mov    0x8(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x2cf4(%rip),%rcx
mov    (%rcx),%edi
movslq (%r15),%r8
lea    0xdd3(%rip),%rsi
lea    0xdb1(%rip),%rdx
mov    $0x191,%ecx
mov    %eax,%r9d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   1070 <fgets@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1230 <find_ld_in_memory+0x80>
mov    %r12,%rdi
call   1030 <fclose@plt>
jmp    1360 <find_ld_in_memory+0x1b0>
mov    0x2cb2(%rip),%rax
mov    (%rax),%ebx
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xccd(%rip),%rsi
lea    0xd54(%rip),%rdx
xor    %r14d,%r14d
mov    %ebx,%edi
mov    $0x179,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14d,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/proc/self/maps\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"[%s:%d] fopen %s\0A\00"
@.str.3 = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/heads/master/main.c\00"
@errno = global i32 0
@.str.4 = [5 x i8] c"r-xp\00"
@.str.5 = [11 x i8] c"ld-2.19.so\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [2 x i8] c" \00"
@stdout = global i32 0
@.str.8 = [30 x i8] c"[%s:%d] found ld : [%lx,%lx]\0A\00"
define i32 @find_ld_in_memory(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [1024 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* null, i32** %6
%12 = bitcast [1024 x i8]* %7 to i8*
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i32 0, i32* %11
%13 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %6
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %29
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i8* @strrchr(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), i8 signext 47)
%18 = icmp ugt i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i8* @strrchr(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), i8 signext 47)
%21 = getelementptr inbounds i8, i8* %20, i64 1
br label %23
22: ; preds = %15
br label %23
23: ; preds = %22, %19
%24 = phi i8* [ %21, %19 ], [ getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), %22 ]
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %24, i32 377, i8* %26)
%28 = load i32, i32* %11
store i32 %28, i32* %3
br label %94
29: ; preds = %2
br label %30
30: ; preds = %81, %61, %44, %39, %29
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%32 = load i32*, i32** %6
%33 = call i64 @fgets(i8* %31, i32 1024, i32* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %90
35: ; preds = %30
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%37 = call i64 @strstr(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %35
br label %30
40: ; preds = %35
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%42 = call i64 @strstr(i8* %41, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %40
br label %30
45: ; preds = %40
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%47 = call i32 @strlen(i8* %46)
%48 = sub nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 %49
store i8 0, i8* %50
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%52 = call i8* @strrchr(i8* %51, i8 signext 32)
store i8* %52, i8** %8
%53 = load i8*, i8** %8
%54 = icmp eq i8* %53, null
br i1 %54, label %61, label %55
55: ; preds = %45
%56 = load i8*, i8** %8
%57 = getelementptr inbounds i8, i8* %56, i64 0
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp ne i32 %59, 32
br i1 %60, label %61, label %62
61: ; preds = %55, %45
br label %30
62: ; preds = %55
%63 = load i8*, i8** %8
%64 = getelementptr inbounds i8, i8* %63, i32 1
store i8* %64, i8** %8
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%66 = call i8* @strtok(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i8* %66, i8** %9
%67 = load i8*, i8** %9
%68 = call i32 @strtoul(i8* %67, i32* null, i32 16)
%69 = load i32*, i32** %4
store i32 %68, i32* %69
%70 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i8* %70, i8** %10
%71 = load i8*, i8** %10
%72 = call i32 @strtoul(i8* %71, i32* null, i32 16)
%73 = load i32*, i32** %5
store i32 %72, i32* %73
%74 = load i32, i32* @stdout
%75 = call i8* @strrchr(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), i8 signext 47)
%76 = icmp ugt i8* %75, null
br i1 %76, label %77, label %80
77: ; preds = %62
%78 = call i8* @strrchr(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), i8 signext 47)
%79 = getelementptr inbounds i8, i8* %78, i64 1
br label %81
80: ; preds = %62
br label %81
81: ; preds = %80, %77
%82 = phi i8* [ %79, %77 ], [ getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0), %80 ]
%83 = load i32*, i32** %4
%84 = load i32, i32* %83
%85 = sext i32 %84 to i64
%86 = inttoptr i64 %85 to i8*
%87 = load i32*, i32** %5
%88 = load i32, i32* %87
%89 = call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %82, i32 401, i8* %86, i32 %88)
store i32 1, i32* %11
br label %30
90: ; preds = %30
%91 = load i32*, i32** %6
%92 = call i32 @fclose(i32* %91)
%93 = load i32, i32* %11
store i32 %93, i32* %3
br label %94
94: ; preds = %90, %23
%95 = load i32, i32* %3
ret i32 %95
}

LLVM IR (-O2):
@.str = [16 x i8] c"/proc/self/maps\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"[%s:%d] fopen %s\0A\00"
@.str.3 = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/m1m1x/memdlopen/refs/heads/master/main.c\00"
@errno = global i32 0
@.str.4 = [5 x i8] c"r-xp\00"
@.str.5 = [11 x i8] c"ld-2.19.so\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [2 x i8] c" \00"
@stdout = global i32 0
@.str.8 = [30 x i8] c"[%s:%d] found ld : [%lx,%lx]\0A\00"
define i32 @find_ld_in_memory(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i64 @fgets(i8* %4, i32 1024, i32* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %48, label %46
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 124), i32 377, i8* %13)
br label %51
15: ; preds = %46, %31
%16 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %31, label %21
21: ; preds = %18
%22 = call i32 @strlen(i8* %4)
%23 = add nsw i32 %22, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %24
store i8 0, i8* %25
%26 = call i8* @strrchr(i8* %4, i8 signext 32)
%27 = icmp eq i8* %26, null
br i1 %27, label %31, label %28
28: ; preds = %21
%29 = load i8, i8* %26
%30 = icmp eq i8 %29, 32
br i1 %30, label %34, label %31
31: ; preds = %21, %28, %15, %18
%32 = call i64 @fgets(i8* %4, i32 1024, i32* %5)
%33 = icmp eq i64 %32, 0
br i1 %33, label %48, label %15
34: ; preds = %28
%35 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%36 = call i32 @strtoul(i8* nocapture %35, i32* null, i32 16)
store i32 %36, i32* %0
%37 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%38 = call i32 @strtoul(i8* nocapture %37, i32* null, i32 16)
store i32 %38, i32* %1
%39 = load i32, i32* @stdout
%40 = load i32, i32* %0
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i8*
%43 = call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 124), i32 401, i8* %42, i32 %38)
%44 = call i64 @fgets(i8* %4, i32 1024, i32* %5)
%45 = icmp eq i64 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %7, %34
%47 = phi i32 [ 1, %34 ], [ 0, %7 ]
br label %15
48: ; preds = %34, %31, %7
%49 = phi i32 [ 0, %7 ], [ %47, %31 ], [ 1, %34 ]
%50 = call i32 @fclose(i32* %5)
br label %51
51: ; preds = %48, %10
%52 = phi i32 [ 0, %10 ], [ %49, %48 ]
ret i32 %52
}