#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*/ fflush(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strstr(char *, char *);
char *find_root_source(char *wdir, char *source) {
  int i, j;
  char buffer[1024], root[256], *p, *q, *ret_pt;
  FILE *infile;
  buffer[0] = 0x0;
  strcat(buffer, wdir);
  strcat(buffer, "/graph.dot");
  infile = fopen(buffer, "r");
  if (infile == NULL) {
    fprintf(stderr, "declare_vars: file open error, %s\n", buffer);
    fflush(NULL);
    return NULL;
  }
  while (fgets(buffer, 1024, infile)) {
    if (p = strstr(buffer, "->")) {
      if (q = strstr(p, source)) {
        i = j = 0;
        while (buffer + i != p - 1) {
          if (!strncmp(buffer + i, ":out", 4)) {
            root[j++] = '_';
            i++;
          } else if (!strncmp(buffer + i, ":in_", 4)) {
            root[j++] = '_';
            i += 4;
          } else
            root[j++] = buffer[i++];
        }
        buffer[i] = root[j] = 0x0;
        ret_pt = find_root_source(wdir, buffer);
        if (ret_pt)
          return ret_pt;
        else {
          ret_pt = (char *)malloc(j + 1);
          i = 0;
          while (root[i] != 0x0)
            ret_pt[i] = root[i++];
          ret_pt[i] = 0x0;
          return ret_pt;
        }
      }
    }
  }
  return (char *)0x0;
}


x86 assembly (clang, -O0):
<find_root_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x540,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x0,-0x420(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x420(%rbp),%rdi
lea    0xe38(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x420(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x540(%rbp)
cmpq   $0x0,-0x540(%rbp)
jne    1227 <find_root_source+0x97>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
lea    -0x420(%rbp),%rdx
lea    0xe01(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <fflush@plt>
movq   $0x0,-0x8(%rbp)
jmp    145e <find_root_source+0x2ce>
jmp    122c <find_root_source+0x9c>
lea    -0x420(%rbp),%rdi
mov    -0x540(%rbp),%rdx
mov    $0x400,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1456 <find_root_source+0x2c6>
lea    -0x420(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x528(%rbp)
cmp    $0x0,%rax
je     1451 <find_root_source+0x2c1>
mov    -0x528(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x530(%rbp)
cmp    $0x0,%rax
je     144c <find_root_source+0x2bc>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x420(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    -0x528(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
je     138b <find_root_source+0x1fb>
lea    -0x420(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xd5b(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    130e <find_root_source+0x17e>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movb   $0x5f,-0x520(%rbp,%rax,1)
5f
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1386 <find_root_source+0x1f6>
lea    -0x420(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xd15(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1359 <find_root_source+0x1c9>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movb   $0x5f,-0x520(%rbp,%rax,1)
5f
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    1381 <find_root_source+0x1f1>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cltq
mov    -0x420(%rbp,%rax,1),%cl
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %cl,-0x520(%rbp,%rax,1)
jmp    1386 <find_root_source+0x1f6>
jmp    12a1 <find_root_source+0x111>
movslq -0x20(%rbp),%rax
movb   $0x0,-0x520(%rbp,%rax,1)
movslq -0x1c(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1040 <find_root_source@plt>
mov    %rax,-0x538(%rbp)
cmpq   $0x0,-0x538(%rbp)
je     13d8 <find_root_source+0x248>
mov    -0x538(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    145e <find_root_source+0x2ce>
mov    -0x20(%rbp),%edi
add    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x538(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
movsbl -0x520(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     142d <find_root_source+0x29d>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cltq
mov    -0x520(%rbp,%rax,1),%dl
mov    -0x538(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    13f1 <find_root_source+0x261>
mov    -0x538(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x538(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    145e <find_root_source+0x2ce>
jmp    1451 <find_root_source+0x2c1>
jmp    122c <find_root_source+0x9c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x540,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_root_source>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x518,%rsp
mov    %rsi,%r12
mov    %rdi,%rbp
movb   $0x0,0x110(%rsp)
lea    0x110(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
lea    0xe33(%rip),%rsi
mov    %rbx,%rdi
call   1090 <fopen@plt>
test   %rax,%rax
je     130c <find_root_source+0x17c>
mov    %rax,%r13
lea    0x110(%rsp),%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1335 <find_root_source+0x1a5>
mov    %rbp,0x8(%rsp)
lea    0xe1a(%rip),%r14
lea    0x110(%rsp),%rbp
xor    %r15d,%r15d
jmp    1249 <find_root_source+0xb9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     139d <find_root_source+0x20d>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     1230 <find_root_source+0xa0>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     1230 <find_root_source+0xa0>
add    $0xffffffffffffffff,%rbx
xor    %r12d,%r12d
cmp    %rbx,%rbp
je     133d <find_root_source+0x1ad>
lea    0x110(%rsp),%rbp
lea    0xda8(%rip),%r15
lea    0xda6(%rip),%r13
xor    %r14d,%r14d
jmp    12c1 <find_root_source+0x131>
nopw   0x0(%rax,%rax,1)
movb   $0x5f,0x10(%rsp,%r12,1)
add    $0x1,%r14d
add    $0x1,%r12
movslq %r14d,%rax
lea    (%rsp,%rax,1),%rbp
add    $0x110,%rbp
cmp    %rbx,%rbp
je     133a <find_root_source+0x1aa>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12a0 <find_root_source+0x110>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1300 <find_root_source+0x170>
add    $0x1,%r14d
movzbl 0x0(%rbp),%eax
mov    %al,0x10(%rsp,%r12,1)
jmp    12aa <find_root_source+0x11a>
nopl   0x0(%rax,%rax,1)
movb   $0x5f,0x10(%rsp,%r12,1)
add    $0x4,%r14d
jmp    12aa <find_root_source+0x11a>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xcf1(%rip),%rsi
lea    0x110(%rsp),%rdx
call   1060 <fprintf@plt>
xor    %r15d,%r15d
xor    %edi,%edi
call   1080 <fflush@plt>
jmp    139d <find_root_source+0x20d>
xor    %r15d,%r15d
jmp    139d <find_root_source+0x20d>
mov    %rbx,%rbp
mov    %r12d,%eax
movb   $0x0,0x10(%rsp,%rax,1)
movb   $0x0,0x0(%rbp)
lea    0x110(%rsp),%rsi
mov    0x8(%rsp),%rdi
call   1040 <find_root_source@plt>
mov    %rax,%r15
test   %rax,%rax
jne    139d <find_root_source+0x20d>
add    $0x1,%r12d
mov    %r12d,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    0x10(%rsp),%al
test   %al,%al
je     1396 <find_root_source+0x206>
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %al,0x1(%r15,%rcx,1)
movzbl 0x11(%rsp,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1380 <find_root_source+0x1f0>
mov    %ecx,%eax
jmp    1398 <find_root_source+0x208>
xor    %eax,%eax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
add    $0x518,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/graph.dot\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [35 x i8] c"declare_vars: file open error, %s\0A\00"
@.str.3 = [3 x i8] c"->\00"
@.str.4 = [5 x i8] c":out\00"
@.str.5 = [5 x i8] c":in_\00"
define i8* @find_root_source(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1024 x i8]
%9 = alloca [256 x i8]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8 0, i8* %14
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %13
%22 = load i32*, i32** %13
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %29
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i32 @fflush(i32* null)
store i8* null, i8** %3
br label %138
29: ; preds = %2
br label %30
30: ; preds = %136, %29
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%32 = load i32*, i32** %13
%33 = call i64 @fgets(i8* %31, i32 1024, i32* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %137
35: ; preds = %30
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%37 = call i8* @strstr(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %37, i8** %10
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %136
39: ; preds = %35
%40 = load i8*, i8** %10
%41 = load i8*, i8** %5
%42 = call i8* @strstr(i8* %40, i8* %41)
store i8* %42, i8** %11
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %135
44: ; preds = %39
store i32 0, i32* %7
store i32 0, i32* %6
br label %45
45: ; preds = %92, %44
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
%50 = load i8*, i8** %10
%51 = getelementptr inbounds i8, i8* %50, i64 -1
%52 = icmp ne i8* %49, %51
br i1 %52, label %53, label %93
53: ; preds = %45
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = call i32 @strncmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%59 = icmp ne i32 %58, 0
br i1 %59, label %67, label %60
60: ; preds = %53
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %63
store i8 95, i8* %64
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %92
67: ; preds = %53
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = call i32 @strncmp(i8* %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%73 = icmp ne i32 %72, 0
br i1 %73, label %81, label %74
74: ; preds = %67
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %77
store i8 95, i8* %78
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 4
store i32 %80, i32* %6
br label %91
81: ; preds = %67
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
store i32 %83, i32* %6
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
%89 = sext i32 %87 to i64
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %89
store i8 %86, i8* %90
br label %91
91: ; preds = %81, %74
br label %92
92: ; preds = %91, %60
br label %45
93: ; preds = %45
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %95
store i8 0, i8* %96
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %98
store i8 0, i8* %99
%100 = load i8*, i8** %4
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%102 = call i8* @find_root_source(i8* %100, i8* %101)
store i8* %102, i8** %12
%103 = load i8*, i8** %12
%104 = icmp ne i8* %103, null
br i1 %104, label %105, label %107
105: ; preds = %93
%106 = load i8*, i8** %12
store i8* %106, i8** %3
br label %138
107: ; preds = %93
%108 = load i32, i32* %7
%109 = add nsw i32 %108, 1
%110 = call i64 @malloc(i32 %109)
%111 = inttoptr i64 %110 to i8*
store i8* %111, i8** %12
store i32 0, i32* %6
br label %112
112: ; preds = %119, %107
%113 = load i32, i32* %6
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp ne i32 %117, 0
br i1 %118, label %119, label %129
119: ; preds = %112
%120 = load i32, i32* %6
%121 = add nsw i32 %120, 1
store i32 %121, i32* %6
%122 = sext i32 %120 to i64
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %122
%124 = load i8, i8* %123
%125 = load i8*, i8** %12
%126 = load i32, i32* %6
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
store i8 %124, i8* %128
br label %112
129: ; preds = %112
%130 = load i8*, i8** %12
%131 = load i32, i32* %6
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %130, i64 %132
store i8 0, i8* %133
%134 = load i8*, i8** %12
store i8* %134, i8** %3
br label %138
135: ; preds = %39
br label %136
136: ; preds = %135, %35
br label %30
137: ; preds = %30
store i8* null, i8** %3
br label %138
138: ; preds = %137, %129, %105, %24
%139 = load i8*, i8** %3
ret i8* %139
}

LLVM IR (-O2):
@.str = [11 x i8] c"/graph.dot\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [35 x i8] c"declare_vars: file open error, %s\0A\00"
@.str.3 = [3 x i8] c"->\00"
@.str.4 = [5 x i8] c":out\00"
@.str.5 = [5 x i8] c":in_\00"
define i8* @find_root_source(i8* %0, i8* nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
store i8 0, i8* %5
%7 = call i32 @strcat(i8* %5, i8* %0)
%8 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i64 @fgets(i8* %5, i32 1024, i32* %9)
%13 = icmp eq i64 %12, 0
br i1 %13, label %83, label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%17 = call i32 @fflush(i32* null)
br label %83
18: ; preds = %11, %80
%19 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %80, label %21
21: ; preds = %18
%22 = call i8* @strstr(i8* %19, i8* dereferenceable(1) %1)
%23 = icmp eq i8* %22, null
br i1 %23, label %80, label %24
24: ; preds = %21
%25 = getelementptr inbounds i8, i8* %19, i64 -1
%26 = icmp eq i8* %5, %25
br i1 %26, label %54, label %27
27: ; preds = %24, %46
%28 = phi i64 [ %48, %46 ], [ 0, %24 ]
%29 = phi i8* [ %50, %46 ], [ %5, %24 ]
%30 = phi i32 [ %47, %46 ], [ 0, %24 ]
%31 = call i32 @strncmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %27
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %28
store i8 95, i8* %34
%35 = add nsw i32 %30, 1
br label %46
36: ; preds = %27
%37 = call i32 @strncmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %28
store i8 95, i8* %40
%41 = add nsw i32 %30, 4
br label %46
42: ; preds = %36
%43 = add nsw i32 %30, 1
%44 = load i8, i8* %29
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %28
store i8 %44, i8* %45
br label %46
46: ; preds = %39, %42, %33
%47 = phi i32 [ %43, %42 ], [ %41, %39 ], [ %35, %33 ]
%48 = add nuw i64 %28, 1
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %49
%51 = icmp eq i8* %50, %25
br i1 %51, label %52, label %27
52: ; preds = %46
%53 = trunc i64 %48 to i32
br label %54
54: ; preds = %52, %24
%55 = phi i32 [ 0, %24 ], [ %53, %52 ]
%56 = phi i8* [ %5, %24 ], [ %25, %52 ]
%57 = zext i32 %55 to i64
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %57
store i8 0, i8* %58
store i8 0, i8* %56
%59 = call i8* @find_root_source(i8* %0, i8* %5)
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %83
61: ; preds = %54
%62 = add nuw nsw i32 %55, 1
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i8*
%65 = load i8, i8* %6
%66 = icmp eq i8 %65, 0
br i1 %66, label %77, label %67
67: ; preds = %61, %67
%68 = phi i64 [ %70, %67 ], [ 0, %61 ]
%69 = phi i8 [ %73, %67 ], [ %65, %61 ]
%70 = add nuw nsw i64 %68, 1
%71 = getelementptr inbounds i8, i8* %64, i64 %70
store i8 %69, i8* %71
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %70
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 0
br i1 %74, label %75, label %67
75: ; preds = %67
%76 = and i64 %70, 4294967295
br label %77
77: ; preds = %75, %61
%78 = phi i64 [ 0, %61 ], [ %76, %75 ]
%79 = getelementptr inbounds i8, i8* %64, i64 %78
store i8 0, i8* %79
br label %83
80: ; preds = %21, %18
%81 = call i64 @fgets(i8* %5, i32 1024, i32* %9)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %18
83: ; preds = %80, %11, %54, %77, %14
%84 = phi i8* [ null, %14 ], [ %64, %77 ], [ %59, %54 ], [ null, %11 ], [ null, %80 ]
ret i8* %84
}