#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 ssize_t;

/* Variables and functions */
int /*<<< orphan*/ convert_unified_hunks_to_context(char **, size_t *, int *,
                                                    unsigned long *);
int /*<<< orphan*/ copy_context_hunks(char **, size_t *, int *,
                                      unsigned long *);
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fwrite(char *, size_t, int, int /*<<< orphan*/);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char *, char *, int);
void do_convert_to_context(void) {
  char *line = NULL;
  size_t linelen = 0;
  unsigned long linenum = 0;
  ssize_t got = getline(&line, &linelen, stdin);
  if (got == -1)
    return;
  linenum++;
  for (;;) {
    int is_context = 0;
    for (;;) {
      if (feof(stdin))
        goto eof;
      if (!strncmp(line, "--- ", 4)) {
        is_context = 0;
        break;
      }
      if (!strncmp(line, "*** ", 4)) {
        is_context = 1;
        break;
      }
      fwrite(line, (size_t)got, 1, stdout);
      got = getline(&line, &linelen, stdin);
      if (got == -1)
        goto eof;
      linenum++;
    }
    if (is_context) {
      fwrite(line, (size_t)got, 1, stdout);
      got = getline(&line, &linelen, stdin);
      if (got == -1)
        goto eof;
      linenum++;
      if (strncmp(line, "--- ", 4))
        continue;
      fwrite(line, (size_t)got, 1, stdout);
      got = getline(&line, &linelen, stdin);
      if (got == -1)
        goto eof;
      linenum++;
      if (strncmp(line, "***************", 15))
        continue;
      fwrite(line, (size_t)got, 1, stdout);
      copy_context_hunks(&line, &linelen, &got, &linenum);
    } else {
      printf("*** %s", line + 4);
      got = getline(&line, &linelen, stdin);
      if (got == -1)
        goto eof;
      linenum++;
      if (strncmp(line, "+++ ", 4))
        continue;
      printf("--- ");
      fwrite(line + 4, (size_t)got - 4, 1, stdout);
      puts("***************");
      convert_unified_hunks_to_context(&line, &linelen, &got, &linenum);
    }
  }
eof:
  if (line)
    free(line);
  return;
}


x86 assembly (clang, -O0):
<do_convert_to_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    11d8 <do_convert_to_context+0x48>
jmp    14b5 <do_convert_to_context+0x325>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
call   1080 <feof@plt>
cmp    $0x0,%rax
je     1208 <do_convert_to_context+0x78>
jmp    149c <do_convert_to_context+0x30c>
mov    -0x8(%rbp),%rdi
lea    0xded(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1233 <do_convert_to_context+0xa3>
movl   $0x0,-0x20(%rbp)
jmp    12b2 <do_convert_to_context+0x122>
mov    -0x8(%rbp),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    125e <do_convert_to_context+0xce>
movl   $0x1,-0x20(%rbp)
jmp    12b2 <do_convert_to_context+0x122>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rsi
mov    0x2d6b(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    0x2d68(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    12a1 <do_convert_to_context+0x111>
jmp    149c <do_convert_to_context+0x30c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11eb <do_convert_to_context+0x5b>
cmpl   $0x0,-0x20(%rbp)
je     13d7 <do_convert_to_context+0x247>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rsi
mov    0x2d0d(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    12ff <do_convert_to_context+0x16f>
jmp    149c <do_convert_to_context+0x30c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xcea(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     132f <do_convert_to_context+0x19f>
jmp    11e4 <do_convert_to_context+0x54>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rsi
mov    0x2c9a(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1372 <do_convert_to_context+0x1e2>
jmp    149c <do_convert_to_context+0x30c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xc81(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     13a2 <do_convert_to_context+0x212>
jmp    11e4 <do_convert_to_context+0x54>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rsi
mov    0x2c27(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1070 <copy_context_hunks@plt>
jmp    1497 <do_convert_to_context+0x307>
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1415 <do_convert_to_context+0x285>
jmp    149c <do_convert_to_context+0x30c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xbf5(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1445 <do_convert_to_context+0x2b5>
jmp    11e4 <do_convert_to_context+0x54>
lea    0xbb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
movslq -0x1c(%rbp),%rsi
sub    $0x4,%rsi
mov    0x2b6e(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
lea    0xb8d(%rip),%rdi
call   1050 <puts@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1090 <convert_unified_hunks_to_context@plt>
jmp    11e4 <do_convert_to_context+0x54>
cmpq   $0x0,-0x8(%rbp)
je     14b0 <do_convert_to_context+0x320>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    14b5 <do_convert_to_context+0x325>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_convert_to_context>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
mov    0x2e31(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   10a0 <getline@plt>
mov    %eax,0xc(%rsp)
cmp    $0xffffffff,%eax
je     11f7 <do_convert_to_context+0x67>
movq   $0x1,0x18(%rsp)
mov    (%r14),%edi
call   1080 <feof@plt>
test   %rax,%rax
je     1206 <do_convert_to_context+0x76>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     11f7 <do_convert_to_context+0x67>
call   1030 <free@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf3(%rip),%rbx
lea    0x10(%rsp),%r15
lea    0x20(%rsp),%r12
mov    0x2dba(%rip),%rbp
jmp    122d <do_convert_to_context+0x9d>
mov    (%r14),%edi
call   1080 <feof@plt>
test   %rax,%rax
jne    11e8 <do_convert_to_context+0x58>
mov    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
mov    0x10(%rsp),%rsi
test   %rax,%rax
je     12b0 <do_convert_to_context+0x120>
mov    %rsi,%rdi
lea    0xdb2(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
mov    %rax,%r13
mov    0x10(%rsp),%rdi
movslq 0xc(%rsp),%rsi
mov    0x0(%rbp),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    (%r14),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   10a0 <getline@plt>
mov    %eax,0xc(%rsp)
test   %r13,%r13
je     1360 <do_convert_to_context+0x1d0>
cmp    $0xffffffff,%eax
je     11e8 <do_convert_to_context+0x58>
addq   $0x1,0x18(%rsp)
jmp    1220 <do_convert_to_context+0x90>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%rsi
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r14),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   10a0 <getline@plt>
mov    %eax,0xc(%rsp)
cmp    $0xffffffff,%eax
je     11e8 <do_convert_to_context+0x58>
addq   $0x1,0x18(%rsp)
mov    0x10(%rsp),%rdi
lea    0xd32(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1220 <do_convert_to_context+0x90>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%rdi
add    $0x4,%rdi
movslq 0xc(%rsp),%rsi
add    $0xfffffffffffffffc,%rsi
mov    0x0(%rbp),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
lea    0xcd8(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
lea    0xc(%rsp),%rdx
lea    0x18(%rsp),%rcx
call   1090 <convert_unified_hunks_to_context@plt>
jmp    1220 <do_convert_to_context+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     11e8 <do_convert_to_context+0x58>
addq   $0x1,0x18(%rsp)
mov    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1220 <do_convert_to_context+0x90>
mov    0x10(%rsp),%rdi
movslq 0xc(%rsp),%rsi
mov    0x0(%rbp),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    (%r14),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   10a0 <getline@plt>
mov    %eax,0xc(%rsp)
cmp    $0xffffffff,%eax
je     11e8 <do_convert_to_context+0x58>
addq   $0x1,0x18(%rsp)
mov    0x10(%rsp),%rdi
lea    0xc3c(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1220 <do_convert_to_context+0x90>
mov    0x10(%rsp),%rdi
movslq 0xc(%rsp),%rsi
mov    0x0(%rbp),%ecx
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    %r15,%rdi
mov    %r12,%rsi
lea    0xc(%rsp),%rdx
lea    0x18(%rsp),%rcx
call   1070 <copy_context_hunks@plt>
jmp    1220 <do_convert_to_context+0x90>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"--- \00"
@.str.1 = [5 x i8] c"*** \00"
@stdout = global i32 0
@.str.2 = [16 x i8] c"***************\00"
@.str.3 = [7 x i8] c"*** %s\00"
@.str.4 = [5 x i8] c"+++ \00"
define void @do_convert_to_context() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i8* null, i8** %1
store i64 0, i64* %2
store i64 0, i64* %3
%6 = load i32, i32* @stdin
%7 = call i32 @getline(i8** %1, i64* %2, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %0
br label %125
11: ; preds = %0
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %14
14: ; preds = %117, %105, %82, %64, %11
store i32 0, i32* %5
br label %15
15: ; preds = %41, %14
%16 = load i32, i32* @stdin
%17 = call i64 @feof(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
br label %118
20: ; preds = %15
%21 = load i8*, i8** %1
%22 = call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%23 = icmp ne i64 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
store i32 0, i32* %5
br label %44
25: ; preds = %20
%26 = load i8*, i8** %1
%27 = call i64 @strncmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%28 = icmp ne i64 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %25
store i32 1, i32* %5
br label %44
30: ; preds = %25
%31 = load i8*, i8** %1
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = load i32, i32* @stdout
%35 = call i32 @fwrite(i8* %31, i64 %33, i32 1, i32 %34)
%36 = load i32, i32* @stdin
%37 = call i32 @getline(i8** %1, i64* %2, i32 %36)
store i32 %37, i32* %4
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %41
40: ; preds = %30
br label %118
41: ; preds = %30
%42 = load i64, i64* %3
%43 = add i64 %42, 1
store i64 %43, i64* %3
br label %15
44: ; preds = %29, %24
%45 = load i32, i32* %5
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %90
47: ; preds = %44
%48 = load i8*, i8** %1
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = load i32, i32* @stdout
%52 = call i32 @fwrite(i8* %48, i64 %50, i32 1, i32 %51)
%53 = load i32, i32* @stdin
%54 = call i32 @getline(i8** %1, i64* %2, i32 %53)
store i32 %54, i32* %4
%55 = load i32, i32* %4
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %58
57: ; preds = %47
br label %118
58: ; preds = %47
%59 = load i64, i64* %3
%60 = add i64 %59, 1
store i64 %60, i64* %3
%61 = load i8*, i8** %1
%62 = call i64 @strncmp(i8* %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %58
br label %14
65: ; preds = %58
%66 = load i8*, i8** %1
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = load i32, i32* @stdout
%70 = call i32 @fwrite(i8* %66, i64 %68, i32 1, i32 %69)
%71 = load i32, i32* @stdin
%72 = call i32 @getline(i8** %1, i64* %2, i32 %71)
store i32 %72, i32* %4
%73 = load i32, i32* %4
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %76
75: ; preds = %65
br label %118
76: ; preds = %65
%77 = load i64, i64* %3
%78 = add i64 %77, 1
store i64 %78, i64* %3
%79 = load i8*, i8** %1
%80 = call i64 @strncmp(i8* %79, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 15)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %76
br label %14
83: ; preds = %76
%84 = load i8*, i8** %1
%85 = load i32, i32* %4
%86 = sext i32 %85 to i64
%87 = load i32, i32* @stdout
%88 = call i32 @fwrite(i8* %84, i64 %86, i32 1, i32 %87)
%89 = call i32 @copy_context_hunks(i8** %1, i64* %2, i32* %4, i64* %3)
br label %117
90: ; preds = %44
%91 = load i8*, i8** %1
%92 = getelementptr inbounds i8, i8* %91, i64 4
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %92)
%94 = load i32, i32* @stdin
%95 = call i32 @getline(i8** %1, i64* %2, i32 %94)
store i32 %95, i32* %4
%96 = load i32, i32* %4
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %99
98: ; preds = %90
br label %118
99: ; preds = %90
%100 = load i64, i64* %3
%101 = add i64 %100, 1
store i64 %101, i64* %3
%102 = load i8*, i8** %1
%103 = call i64 @strncmp(i8* %102, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %106
105: ; preds = %99
br label %14
106: ; preds = %99
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%108 = load i8*, i8** %1
%109 = getelementptr inbounds i8, i8* %108, i64 4
%110 = load i32, i32* %4
%111 = sext i32 %110 to i64
%112 = sub i64 %111, 4
%113 = load i32, i32* @stdout
%114 = call i32 @fwrite(i8* %109, i64 %112, i32 1, i32 %113)
%115 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%116 = call i32 @convert_unified_hunks_to_context(i8** %1, i64* %2, i32* %4, i64* %3)
br label %117
117: ; preds = %106, %83
br label %14
118: ; preds = %98, %75, %57, %40, %19
%119 = load i8*, i8** %1
%120 = icmp ne i8* %119, null
br i1 %120, label %121, label %124
121: ; preds = %118
%122 = load i8*, i8** %1
%123 = call i32 @free(i8* %122)
br label %124
124: ; preds = %121, %118
br label %125
125: ; preds = %124, %10
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"--- \00"
@.str.1 = [5 x i8] c"*** \00"
@stdout = global i32 0
@.str.2 = [16 x i8] c"***************\00"
@.str.3 = [7 x i8] c"*** %s\00"
@.str.4 = [5 x i8] c"+++ \00"
define void @do_convert_to_context() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%6 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%7 = bitcast i64* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = load i32, i32* @stdin
%10 = call i32 @getline(i8** %1, i64* %2, i32 %9)
store i32 %10, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %101, label %12
12: ; preds = %0
store i64 1, i64* %3
%13 = load i32, i32* @stdin
%14 = call i64 @feof(i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %96
16: ; preds = %12, %39
%17 = load i8*, i8** %1
%18 = call i64 @strncmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%19 = icmp eq i64 %18, 0
%20 = load i8*, i8** %1
br i1 %19, label %69, label %21
21: ; preds = %16
%22 = call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%23 = icmp eq i64 %22, 0
%24 = load i8*, i8** %1
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = load i32, i32* @stdout
%28 = call i32 @fwrite(i8* %24, i64 %26, i32 1, i32 %27)
%29 = load i32, i32* @stdin
%30 = call i32 @getline(i8** %1, i64* %2, i32 %29)
store i32 %30, i32* %4
%31 = icmp eq i32 %30, -1
br i1 %23, label %40, label %32
32: ; preds = %21
br i1 %31, label %96, label %33
33: ; preds = %32
%34 = load i64, i64* %3
%35 = add i64 %34, 1
store i64 %35, i64* %3
%36 = load i32, i32* @stdin
%37 = call i64 @feof(i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %96
39: ; preds = %33, %92
br label %16
40: ; preds = %21
br i1 %31, label %96, label %41
41: ; preds = %40
%42 = load i64, i64* %3
%43 = add i64 %42, 1
store i64 %43, i64* %3
%44 = load i8*, i8** %1
%45 = call i64 @strncmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %92
47: ; preds = %41
%48 = load i8*, i8** %1
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = load i32, i32* @stdout
%52 = call i32 @fwrite(i8* %48, i64 %50, i32 1, i32 %51)
%53 = load i32, i32* @stdin
%54 = call i32 @getline(i8** %1, i64* %2, i32 %53)
store i32 %54, i32* %4
%55 = icmp eq i32 %54, -1
br i1 %55, label %96, label %56
56: ; preds = %47
%57 = load i64, i64* %3
%58 = add i64 %57, 1
store i64 %58, i64* %3
%59 = load i8*, i8** %1
%60 = call i64 @strncmp(i8* %59, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 15)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %92
62: ; preds = %56
%63 = load i8*, i8** %1
%64 = load i32, i32* %4
%65 = sext i32 %64 to i64
%66 = load i32, i32* @stdout
%67 = call i32 @fwrite(i8* %63, i64 %65, i32 1, i32 %66)
%68 = call i32 @copy_context_hunks(i8** %1, i64* %2, i32* %4, i64* %3)
br label %92
69: ; preds = %16
%70 = getelementptr inbounds i8, i8* %20, i64 4
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %70)
%72 = load i32, i32* @stdin
%73 = call i32 @getline(i8** %1, i64* %2, i32 %72)
store i32 %73, i32* %4
%74 = icmp eq i32 %73, -1
br i1 %74, label %96, label %75
75: ; preds = %69
%76 = load i64, i64* %3
%77 = add i64 %76, 1
store i64 %77, i64* %3
%78 = load i8*, i8** %1
%79 = call i64 @strncmp(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %92
81: ; preds = %75
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%83 = load i8*, i8** %1
%84 = getelementptr inbounds i8, i8* %83, i64 4
%85 = load i32, i32* %4
%86 = sext i32 %85 to i64
%87 = add nsw i64 %86, -4
%88 = load i32, i32* @stdout
%89 = call i32 @fwrite(i8* %84, i64 %87, i32 1, i32 %88)
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%91 = call i32 @convert_unified_hunks_to_context(i8** %1, i64* %2, i32* %4, i64* %3)
br label %92
92: ; preds = %62, %81, %75, %56, %41
%93 = load i32, i32* @stdin
%94 = call i64 @feof(i32 %93)
%95 = icmp eq i64 %94, 0
br i1 %95, label %39, label %96
96: ; preds = %40, %47, %69, %92, %32, %33, %12
%97 = load i8*, i8** %1
%98 = icmp eq i8* %97, null
br i1 %98, label %101, label %99
99: ; preds = %96
%100 = call i32 @free(i8* %97)
br label %101
101: ; preds = %96, %99, %0
ret void
}