#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 /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main() {
  int ind = 0, j = 0, fla;
  char my[] = "catojh";
  char stro[] = "catlo";
  char cx[] = "catalonia";
  for (int i = 0; i < strlen(my); i++) {
    if (my[i] == stro[i]) {
      if (my[i] == cx[i]) {
        ind += 1;
      }
    } else
      break;
  }
  while (j < ind) {
    printf("%c", my[j]);
    j += 1;
  }
  if (ind == 0)
    printf("No match.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x11(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x1d(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0x19(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x27(%rbp)
mov    0xe95(%rip),%ax
mov    %ax,-0x1f(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x17(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    1201 <main+0xe1>
movslq -0x2c(%rbp),%rax
movsbl -0x17(%rbp,%rax,1),%eax
movslq -0x2c(%rbp),%rcx
movsbl -0x1d(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11e9 <main+0xc9>
movslq -0x2c(%rbp),%rax
movsbl -0x17(%rbp,%rax,1),%eax
movslq -0x2c(%rbp),%rcx
movsbl -0x27(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11e4 <main+0xc4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ee <main+0xce>
jmp    1201 <main+0xe1>
jmp    11f3 <main+0xd3>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118b <main+0x6b>
jmp    1206 <main+0xe6>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1237 <main+0x117>
movslq -0xc(%rbp),%rax
movsbl -0x17(%rbp,%rax,1),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1206 <main+0xe6>
cmpl   $0x0,-0x8(%rbp)
jne    124f <main+0x12f>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x686a6f,0xb(%rsp)
movl   $0x6f746163,0x8(%rsp)
6f
lea    0x8(%rsp),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11d7 <main+0xa7>
xor    %ebx,%ebx
lea    0xea4(%rip),%r15
lea    0xea3(%rip),%r12
lea    0x8(%rsp),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x8(%rsp,%rbx,1),%eax
cmp    (%rbx,%r15,1),%al
jne    11a9 <main+0x79>
xor    %ecx,%ecx
cmp    (%rbx,%r12,1),%al
sete   %cl
add    %ecx,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1180 <main+0x50>
test   %ebp,%ebp
je     11d7 <main+0xa7>
mov    %ebp,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x8(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11c0 <main+0x90>
test   %ebp,%ebp
jne    11e5 <main+0xb5>
lea    0xe39(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.my = [7 x i8] c"catojh\00"
@__const.main.stro = [6 x i8] c"catlo\00"
@__const.main.cx = [10 x i8] c"catalonia\00"
@.str = [3 x i8] c"%c\00"
@.str.1 = [10 x i8] c"No match.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [7 x i8]
%6 = alloca [6 x i8]
%7 = alloca [10 x i8]
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%9 = bitcast [7 x i8]* %5 to i8*
%10 = bitcast [6 x i8]* %6 to i8*
%11 = bitcast [10 x i8]* %7 to i8*
store i32 0, i32* %8
br label %12
12: ; preds = %47, %0
%13 = load i32, i32* %8
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %50
17: ; preds = %12
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %22, %27
br i1 %28, label %29, label %45
29: ; preds = %17
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %34, %39
br i1 %40, label %41, label %44
41: ; preds = %29
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %44
44: ; preds = %41, %29
br label %46
45: ; preds = %17
br label %50
46: ; preds = %44
br label %47
47: ; preds = %46
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %12
50: ; preds = %45, %12
br label %51
51: ; preds = %55, %50
%52 = load i32, i32* %3
%53 = load i32, i32* %2
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %64
55: ; preds = %51
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %51
64: ; preds = %51
%65 = load i32, i32* %2
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
ret i32 0
}

LLVM IR (-O2):
@__const.main.my = [7 x i8] c"catojh\00"
@__const.main.stro = [6 x i8] c"catlo\00"
@__const.main.cx = [10 x i8] c"catalonia\00"
@.str.1 = [10 x i8] c"No match.\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %37
5: ; preds = %0, %13
%6 = phi i64 [ %19, %13 ], [ 0, %0 ]
%7 = phi i32 [ %18, %13 ], [ 0, %0 ]
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 %6
%9 = load i8, i8* %8
%10 = getelementptr inbounds [6 x i8], [6 x i8]* @__const.main.stro, i64 0, i64 %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %9, %11
br i1 %12, label %13, label %23
13: ; preds = %5
%14 = getelementptr inbounds [10 x i8], [10 x i8]* @__const.main.cx, i64 0, i64 %6
%15 = load i8, i8* %14
%16 = icmp eq i8 %9, %15
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %7, %17
%19 = add nuw nsw i64 %6, 1
%20 = call i32 @strlen(i8* %2)
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %5, label %23
23: ; preds = %13, %5
%24 = phi i32 [ %18, %13 ], [ %7, %5 ]
%25 = icmp eq i32 %24, 0
br i1 %25, label %37, label %26
26: ; preds = %23
%27 = zext i32 %24 to i64
br label %28
28: ; preds = %26, %28
%29 = phi i64 [ 0, %26 ], [ %34, %28 ]
%30 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = call i32 @putchar(i32 %32)
%34 = add nuw nsw i64 %29, 1
%35 = icmp eq i64 %34, %27
br i1 %35, label %36, label %28
36: ; preds = %28
br i1 %25, label %37, label %39
37: ; preds = %0, %23, %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %36
ret i32 0
}