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

/* Variables and functions */
int index(char *, char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s1[50], s2[50], c1;
  scanf("%s\n", s1);
  scanf("%c\n", &c1);
  scanf("%s", s2);
  char s3[100];
  int i, j;
  if ((index(s1, c1)) == 0) {
    for (i = 0; i < (strlen(s1) + strlen(s2)); i++) {
      if (i < strlen(s2))
        s3[i] = s2[i];
      else
        s3[i] = s1[(i - strlen(s2))];
    }
    printf("%s", s3);
  } else if (index(s1, c1) > 0) {
    for (j = 0; j < index(s1, c1); j++) {
      s3[j] = s1[j];
    }
    int k = 0;
    for (j = index(s1, c1); j < (index(s1, c1) + strlen(s2)); j++) {
      s3[j] = s2[k];
      k++;
    }
    int l = index(s1, c1);
    for (j = (index(s1, c1) + strlen(s2)); j < (strlen(s1) + strlen(s2)); j++) {
      s3[j] = s1[l];
      l++;
    }
    printf("%s", s3);
  } else {
    printf("%s", s1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x81(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
cmp    $0x0,%eax
jne    128b <main+0x14b>
movl   $0x0,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
mov    %eax,-0x104(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x108(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x108(%rbp),%ecx
mov    %eax,%edx
mov    -0x104(%rbp),%eax
add    %edx,%ecx
cmp    %ecx,%eax
jge    1273 <main+0x133>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x10c(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10c(%rbp),%eax
cmp    %ecx,%eax
jge    1227 <main+0xe7>
movslq -0xf4(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xf4(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
jmp    125a <main+0x11a>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x110(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x110(%rbp),%eax
sub    %ecx,%eax
cltq
mov    -0x40(%rbp,%rax,1),%cl
movslq -0xf4(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
jmp    125f <main+0x11f>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    11a8 <main+0x68>
lea    -0xf0(%rbp),%rsi
lea    0xd87(%rip),%rdi
call   1040 <printf@plt>
jmp    1490 <main+0x350>
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
cmp    $0x0,%eax
jle    147b <main+0x33b>
movl   $0x0,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
mov    %eax,-0x114(%rbp)
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
mov    %eax,%ecx
mov    -0x114(%rbp),%eax
cmp    %ecx,%eax
jge    1307 <main+0x1c7>
movslq -0xf8(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%cl
movslq -0xf8(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    12ae <main+0x16e>
movl   $0x0,-0xfc(%rbp)
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
mov    %eax,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
mov    %eax,-0x118(%rbp)
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
mov    %eax,-0x11c(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x11c(%rbp),%ecx
mov    %eax,%edx
mov    -0x118(%rbp),%eax
add    %edx,%ecx
cmp    %ecx,%eax
jge    13a6 <main+0x266>
movslq -0xfc(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xf8(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    1327 <main+0x1e7>
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
mov    %eax,-0x100(%rbp)
lea    -0x40(%rbp),%rdi
movsbl -0x81(%rbp),%esi
call   1050 <index@plt>
mov    %eax,-0x120(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x120(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
mov    %eax,-0x124(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x128(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x128(%rbp),%ecx
mov    %eax,%edx
mov    -0x124(%rbp),%eax
add    %edx,%ecx
cmp    %ecx,%eax
jge    1463 <main+0x323>
movslq -0x100(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%cl
movslq -0xf8(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    13eb <main+0x2ab>
lea    -0xf0(%rbp),%rsi
lea    0xb97(%rip),%rdi
call   1040 <printf@plt>
jmp    148b <main+0x34b>
lea    -0x40(%rbp),%rsi
lea    0xb82(%rip),%rdi
call   1040 <printf@plt>
jmp    1490 <main+0x350>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
lea    0xea8(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xe98(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xe8b(%rip),%rdi
lea    0x50(%rsp),%rsi
call   1060 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %r14,%rdi
call   1050 <index@plt>
test   %eax,%eax
je     1325 <main+0x1e5>
movsbl 0xf(%rsp),%esi
mov    %r14,%rdi
call   1050 <index@plt>
test   %eax,%eax
jle    13ba <main+0x27a>
movsbl 0xf(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1050 <index@plt>
test   %eax,%eax
jle    11f4 <main+0xb4>
xor    %ebp,%ebp
lea    0x10(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%rbp,1),%eax
mov    %al,0x90(%rsp,%rbp,1)
add    $0x1,%rbp
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1050 <index@plt>
cltq
cmp    %rax,%rbp
jl     11d0 <main+0x90>
movsbl 0xf(%rsp),%esi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <index@plt>
mov    %eax,%ebx
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
call   1050 <index@plt>
mov    %eax,%ebp
lea    0x50(%rsp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebp,%eax
cmp    %eax,%ebx
jge    1275 <main+0x135>
movslq %ebx,%rbx
lea    0x10(%rsp),%r15
mov    %r14,%rbp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x0(%rbp),%eax
mov    %al,0x90(%rsp,%rbx,1)
add    $0x1,%rbx
movsbl 0xf(%rsp),%esi
mov    %r15,%rdi
call   1050 <index@plt>
mov    %eax,%r12d
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r12d,%eax
cltq
add    $0x1,%rbp
cmp    %rax,%rbx
jl     1240 <main+0x100>
lea    0x90(%rsp),%r14
movsbl 0xf(%rsp),%esi
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1050 <index@plt>
mov    %eax,%r15d
movsbl 0xf(%rsp),%esi
mov    %r12,%rdi
call   1050 <index@plt>
mov    %eax,%ebx
lea    0x50(%rsp),%r13
mov    %r13,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r12,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1030 <strlen@plt>
add    %ebx,%eax
cmp    %eax,%ebp
jge    13ba <main+0x27a>
movslq %r15d,%rax
movslq %ebp,%rbx
lea    (%rsp,%rax,1),%rbp
add    $0x10,%rbp
lea    0x10(%rsp),%r15
lea    0x50(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
movzbl 0x0(%rbp),%eax
mov    %al,0x90(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%r13d
mov    %r12,%rdi
call   1030 <strlen@plt>
add    %r13d,%eax
cltq
add    $0x1,%rbp
cmp    %rax,%rbx
jl     12f0 <main+0x1b0>
jmp    13ba <main+0x27a>
lea    0x90(%rsp),%r14
lea    0x10(%rsp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
lea    0x50(%rsp),%rdi
call   1030 <strlen@plt>
add    %ebx,%eax
jle    13ba <main+0x27a>
xor    %ebx,%ebx
lea    0x50(%rsp),%r12
lea    0x10(%rsp),%r15
jmp    13a1 <main+0x261>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
mov    %rbx,%rcx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rax
add    $0x10,%rax
movzbl (%rax),%eax
mov    %al,0x90(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1030 <strlen@plt>
add    %ebp,%eax
cltq
cmp    %rax,%rbx
jge    13ba <main+0x27a>
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1360 <main+0x220>
lea    (%rsp,%rbx,1),%rax
add    $0x50,%rax
jmp    1378 <main+0x238>
lea    0xc47(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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