#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*/ dest;

/* Variables and functions */
int /*<<< orphan*/ fill(char *, char, int);
int length(char const *, int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ movsb(char *, char const *, int, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char const *);
int strlen(char const *);
int doTest() {
  const char *src = "Hello World";
  char dest[50];
  char d1[101];
  int len = strlen(src) + 1;
  int i;
  int failures = 0;
  movsb(&dest[0], src, len, 0);
  printf("Result after copy  '%s'\n", dest);
  if (strcmp(dest, src) != 0) {
    printf("*** Copy failed ***\n");
    failures++;
  }
  memset(dest, 0, sizeof(dest));
  movsb(&dest[len], &src[len], len + 1, 1);
  printf("Result after reversed copy  '%s'\n", dest);
  if (strcmp(dest, src) != 0) {
    printf("*** Copy failed ***\n");
    failures++;
  }
  printf("src = '%s'\n", src);
  i = length(src, 1024);
  printf("Length gives %d\n", i);
  movsb(&dest[0], src, len, 0);
  printf("dest = '%s'\n", dest);
  movsb(&dest[0], &dest[6], len - 6, 0);
  printf("Result after overlapping copy  '%s'\n", dest);
  memset(d1, -1, 100);
  d1[100] = 99;
  fill(d1, (char)1, 100);
  printf("Filled\n");
  for (i = 0; i < 100; i++)
    if (d1[i] != 1) {
      printf("Fill failed d1[%d] == 0x%02x\n", i, d1[i]);
      failures++;
    }
  if (d1[100] != 99) {
    printf("Fill failed d1[101] == 0x%02x\n", d1[100]);
    failures++;
  }
  return failures;
}


x86 assembly (clang, -O0):
<doTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
movl   $0x0,-0xbc(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xb4(%rbp),%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    -0x40(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     11fd <doTest+0x8d>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1070 <memset@plt>
movslq -0xb4(%rbp),%rax
lea    -0x40(%rbp),%rdi
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xb4(%rbp),%rax
add    %rax,%rsi
mov    -0xb4(%rbp),%edx
add    $0x1,%edx
mov    $0x1,%ecx
call   1030 <movsb@plt>
lea    -0x40(%rbp),%rsi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1282 <doTest+0x112>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1040 <length@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xb8(%rbp),%esi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xb4(%rbp),%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    -0x40(%rbp),%rsi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
add    $0x6,%rsi
mov    -0xb4(%rbp),%edx
sub    $0x6,%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    -0x40(%rbp),%rsi
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x64,%edx
call   1070 <memset@plt>
movb   $0x63,-0x4c(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
call   1080 <fill@plt>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x64,-0xb8(%rbp)
jge    13c9 <doTest+0x259>
movslq -0xb8(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0x1,%eax
je     13b0 <doTest+0x240>
mov    -0xb8(%rbp),%esi
movslq -0xb8(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%edx
ff
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    13b5 <doTest+0x245>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1359 <doTest+0x1e9>
movsbl -0x4c(%rbp),%eax
cmp    $0x63,%eax
je     13f7 <doTest+0x287>
movsbl -0x4c(%rbp),%esi
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doTest>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb0,%rsp
lea    0xe6a(%rip),%r12
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%r14d
lea    0x1(%r14),%r15d
mov    %rsp,%rbp
xor    %ebx,%ebx
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    0xe4b(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     11ec <doTest+0x6c>
lea    0xef8(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1080 <memset@plt>
movslq %r15d,%rsi
lea    (%rsp,%rsi,1),%rdi
add    %r12,%rsi
lea    0x2(%r14),%edx
mov    $0x1,%ecx
call   1030 <movsb@plt>
lea    0xe08(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1246 <doTest+0xc6>
lea    0xe9c(%rip),%rdi
call   1050 <puts@plt>
add    $0x1,%ebx
lea    0xdfa(%rip),%rdi
lea    0xdac(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
mov    $0x400,%esi
call   1040 <length@plt>
lea    0xde1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    0xdcf(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x6(%rsp),%rsi
add    $0xfffffffb,%r14d
mov    %rbp,%rdi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1030 <movsb@plt>
lea    0xdb5(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xffffffff,%esi
mov    $0x64,%edx
call   1080 <memset@plt>
movb   $0x63,0xa4(%rsp)
63
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x64,%edx
call   1090 <fill@plt>
lea    0xdd5(%rip),%rdi
call   1050 <puts@plt>
lea    0xd8c(%rip),%r14
xor    %ebp,%ebp
jmp    131a <doTest+0x19a>
xchg   %ax,%ax
add    $0x1,%rbp
cmp    $0x64,%rbp
je     1335 <doTest+0x1b5>
movsbl 0x40(%rsp,%rbp,1),%edx
cmp    $0x1,%edx
je     1310 <doTest+0x190>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebx
jmp    1310 <doTest+0x190>
movsbl 0xa4(%rsp),%esi
cmp    $0x63,%esi
je     1353 <doTest+0x1d3>
lea    0xd6b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [25 x i8] c"Result after copy '%s'\0A\00"
@.str.2 = [21 x i8] c"*** Copy failed ***\0A\00"
@.str.3 = [34 x i8] c"Result after reversed copy '%s'\0A\00"
@.str.4 = [12 x i8] c"src = '%s'\0A\00"
@.str.5 = [17 x i8] c"Length gives %d\0A\00"
@.str.6 = [13 x i8] c"dest = '%s'\0A\00"
@.str.7 = [37 x i8] c"Result after overlapping copy '%s'\0A\00"
@.str.8 = [8 x i8] c"Filled\0A\00"
@.str.9 = [30 x i8] c"Fill failed d1[%d] == 0x%02x\0A\00"
@.str.10 = [31 x i8] c"Fill failed d1[101] == 0x%02x\0A\00"
define i32 @doTest() {
%1 = alloca i8*
%2 = alloca [50 x i8]
%3 = alloca [101 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
store i32 0, i32* %6
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%11 = load i8*, i8** %1
%12 = load i32, i32* %4
%13 = call i32 @movsb(i8* %10, i8* %11, i32 %12, i32 0)
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%17 = load i8*, i8** %1
%18 = call i64 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %24
24: ; preds = %20, %0
%25 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%26 = call i32 @memset(i8* %25, i32 0, i32 50)
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %28
%30 = load i8*, i8** %1
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
%36 = call i32 @movsb(i8* %29, i8* %33, i32 %35, i32 1)
%37 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%40 = load i8*, i8** %1
%41 = call i64 @strcmp(i8* %39, i8* %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %24
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %47
47: ; preds = %43, %24
%48 = load i8*, i8** %1
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = load i8*, i8** %1
%51 = call i32 @length(i8* %50, i32 1024)
store i32 %51, i32* %5
%52 = load i32, i32* %5
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%55 = load i8*, i8** %1
%56 = load i32, i32* %4
%57 = call i32 @movsb(i8* %54, i8* %55, i32 %56, i32 0)
%58 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %58)
%60 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%61 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 6
%62 = load i32, i32* %4
%63 = sub nsw i32 %62, 6
%64 = call i32 @movsb(i8* %60, i8* %61, i32 %63, i32 0)
%65 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %65)
%67 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%68 = call i32 @memset(i8* %67, i32 -1, i32 100)
%69 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 100
store i8 99, i8* %69
%70 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%71 = call i32 @fill(i8* %70, i8 signext 1, i32 100)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %5
br label %73
73: ; preds = %94, %47
%74 = load i32, i32* %5
%75 = icmp slt i32 %74, 100
br i1 %75, label %76, label %97
76: ; preds = %73
%77 = load i32, i32* %5
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 1
br i1 %82, label %83, label %93
83: ; preds = %76
%84 = load i32, i32* %5
%85 = load i32, i32* %5
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %86
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %84, i32 %89)
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
br label %93
93: ; preds = %83, %76
br label %94
94: ; preds = %93
%95 = load i32, i32* %5
%96 = add nsw i32 %95, 1
store i32 %96, i32* %5
br label %73
97: ; preds = %73
%98 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 100
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 99
br i1 %101, label %102, label %109
102: ; preds = %97
%103 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 100
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %105)
%107 = load i32, i32* %6
%108 = add nsw i32 %107, 1
store i32 %108, i32* %6
br label %109
109: ; preds = %102, %97
%110 = load i32, i32* %6
ret i32 %110
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [25 x i8] c"Result after copy '%s'\0A\00"
@.str.3 = [34 x i8] c"Result after reversed copy '%s'\0A\00"
@.str.4 = [12 x i8] c"src = '%s'\0A\00"
@.str.5 = [17 x i8] c"Length gives %d\0A\00"
@.str.6 = [13 x i8] c"dest = '%s'\0A\00"
@.str.7 = [37 x i8] c"Result after overlapping copy '%s'\0A\00"
@.str.9 = [30 x i8] c"Fill failed d1[%d] == 0x%02x\0A\00"
@.str.10 = [31 x i8] c"Fill failed d1[101] == 0x%02x\0A\00"
@str = [7 x i8] c"Filled\00"
@str.12 = [20 x i8] c"*** Copy failed ***\00"
define i32 @doTest() {
%1 = alloca [50 x i8]
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i32 %5, 1
%7 = call i32 @movsb(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = phi i32 [ 1, %11 ], [ 0, %0 ]
%15 = call i32 @memset(i8* %3, i32 0, i32 50)
%16 = sext i32 %6 to i64
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %16
%18 = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i64 0, i64 %16
%19 = add nsw i32 %5, 2
%20 = call i32 @movsb(i8* %17, i8* %18, i32 %19, i32 1)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%22 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %13
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0))
%26 = add nuw nsw i32 %14, 1
br label %27
27: ; preds = %24, %13
%28 = phi i32 [ %26, %24 ], [ %14, %13 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @length(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1024)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%32 = call i32 @movsb(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%34 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 6
%35 = add nsw i32 %5, -5
%36 = call i32 @movsb(i8* %3, i8* %34, i32 %35, i32 0)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%38 = call i32 @memset(i8* %4, i32 -1, i32 100)
%39 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 100
store i8 99, i8* %39
%40 = call i32 @fill(i8* %4, i8 signext 1, i32 100)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %42
42: ; preds = %27, %53
%43 = phi i64 [ 0, %27 ], [ %55, %53 ]
%44 = phi i32 [ %28, %27 ], [ %54, %53 ]
%45 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %43
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, 1
br i1 %47, label %53, label %48
48: ; preds = %42
%49 = sext i8 %46 to i32
%50 = trunc i64 %43 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %50, i32 %49)
%52 = add nsw i32 %44, 1
br label %53
53: ; preds = %42, %48
%54 = phi i32 [ %52, %48 ], [ %44, %42 ]
%55 = add nuw nsw i64 %43, 1
%56 = icmp eq i64 %55, 100
br i1 %56, label %57, label %42
57: ; preds = %53
%58 = load i8, i8* %39
%59 = icmp eq i8 %58, 99
br i1 %59, label %64, label %60
60: ; preds = %57
%61 = sext i8 %58 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %61)
%63 = add nsw i32 %54, 1
br label %64
64: ; preds = %60, %57
%65 = phi i32 [ %63, %60 ], [ %54, %57 ]
ret i32 %65
}