#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int strlen(char *);
int compare_characters(char *corresponding, char *word2) {
  int len1, len2, i, j;
  fprintf(stderr, "compare_characters: %s %s\n", corresponding, word2);
  len1 = strlen(corresponding);
  len2 = strlen(word2);
  fprintf(stderr, "compare_characters: %d %d\n", len1, len2);
  for (i = 0; i < len1; i += 3) {
    for (j = 0; j < len2; j += 3) {
      if (word2[j] == corresponding[i] &&
          word2[j + 1] == corresponding[i + 1] &&
          word2[j + 2] == corresponding[i + 2]) {
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare_characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1250 <compare_characters+0x130>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    123d <compare_characters+0x11d>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    122a <compare_characters+0x10a>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x24(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    122a <compare_characters+0x10a>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x24(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    122a <compare_characters+0x10a>
movl   $0x1,-0x4(%rbp)
jmp    1257 <compare_characters+0x137>
jmp    122f <compare_characters+0x10f>
mov    -0x28(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x28(%rbp)
jmp    119e <compare_characters+0x7e>
jmp    1242 <compare_characters+0x122>
mov    -0x24(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x24(%rbp)
jmp    118b <compare_characters+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_characters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%r14
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
xor    %r12d,%r12d
mov    %r14,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r13,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
lea    0xeac(%rip),%rsi
mov    %r15d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %r15d,%r15d
jle    11df <compare_characters+0xbf>
xor    %eax,%eax
jmp    1199 <compare_characters+0x79>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x3,%rax
cmp    %eax,%r15d
jle    11f1 <compare_characters+0xd1>
test   %ebp,%ebp
jle    1190 <compare_characters+0x70>
mov    (%r14,%rax,1),%cl
xor    %edx,%edx
jmp    11b8 <compare_characters+0x98>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x3,%rdx
cmp    %edx,%ebp
jle    1190 <compare_characters+0x70>
cmp    %cl,0x0(%r13,%rdx,1)
jne    11b0 <compare_characters+0x90>
movzbl 0x1(%r13,%rdx,1),%ebx
cmp    0x1(%r14,%rax,1),%bl
jne    11b0 <compare_characters+0x90>
movzbl 0x2(%r13,%rdx,1),%ebx
cmp    0x2(%r14,%rax,1),%bl
jne    11b0 <compare_characters+0x90>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r12d,%r12d
jmp    11df <compare_characters+0xbf>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"compare_characters: %s %s\0A\00"
@.str.1 = [27 x i8] c"compare_characters: %d %d\0A\00"
define i32 @compare_characters(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %6
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
store i32 %17, i32* %7
%18 = load i32, i32* @stderr
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %20)
store i32 0, i32* %8
br label %22
22: ; preds = %83, %2
%23 = load i32, i32* %8
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %86
26: ; preds = %22
store i32 0, i32* %9
br label %27
27: ; preds = %79, %26
%28 = load i32, i32* %9
%29 = load i32, i32* %7
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %82
31: ; preds = %27
%32 = load i8*, i8** %5
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = load i8*, i8** %4
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %37, %43
br i1 %44, label %45, label %78
45: ; preds = %31
%46 = load i8*, i8** %5
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %46, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = load i8*, i8** %4
%54 = load i32, i32* %8
%55 = add nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %53, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %52, %59
br i1 %60, label %61, label %78
61: ; preds = %45
%62 = load i8*, i8** %5
%63 = load i32, i32* %9
%64 = add nsw i32 %63, 2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %62, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = load i8*, i8** %4
%70 = load i32, i32* %8
%71 = add nsw i32 %70, 2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %69, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %68, %75
br i1 %76, label %77, label %78
77: ; preds = %61
store i32 1, i32* %3
br label %87
78: ; preds = %61, %45, %31
br label %79
79: ; preds = %78
%80 = load i32, i32* %9
%81 = add nsw i32 %80, 3
store i32 %81, i32* %9
br label %27
82: ; preds = %27
br label %83
83: ; preds = %82
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 3
store i32 %85, i32* %8
br label %22
86: ; preds = %22
store i32 0, i32* %3
br label %87
87: ; preds = %86, %77
%88 = load i32, i32* %3
ret i32 %88
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"compare_characters: %s %s\0A\00"
@.str.1 = [27 x i8] c"compare_characters: %d %d\0A\00"
define i32 @compare_characters(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @strlen(i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%9 = icmp sgt i32 %5, 0
br i1 %9, label %10, label %46
10: ; preds = %2
%11 = icmp sgt i32 %6, 0
br label %12
12: ; preds = %10, %42
%13 = phi i64 [ 0, %10 ], [ %43, %42 ]
br i1 %11, label %14, label %42
14: ; preds = %12
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = add nuw nsw i64 %13, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = add nuw nsw i64 %13, 2
%20 = getelementptr inbounds i8, i8* %0, i64 %19
br label %21
21: ; preds = %14, %38
%22 = phi i64 [ 0, %14 ], [ %39, %38 ]
%23 = getelementptr inbounds i8, i8* %1, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, %16
br i1 %25, label %26, label %38
26: ; preds = %21
%27 = add nuw nsw i64 %22, 1
%28 = getelementptr inbounds i8, i8* %1, i64 %27
%29 = load i8, i8* %28
%30 = load i8, i8* %18
%31 = icmp eq i8 %29, %30
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = add nuw nsw i64 %22, 2
%34 = getelementptr inbounds i8, i8* %1, i64 %33
%35 = load i8, i8* %34
%36 = load i8, i8* %20
%37 = icmp eq i8 %35, %36
br i1 %37, label %46, label %38
38: ; preds = %21, %26, %32
%39 = add nuw i64 %22, 3
%40 = trunc i64 %39 to i32
%41 = icmp sgt i32 %6, %40
br i1 %41, label %21, label %42
42: ; preds = %38, %12
%43 = add nuw i64 %13, 3
%44 = trunc i64 %43 to i32
%45 = icmp sgt i32 %5, %44
br i1 %45, label %12, label %46
46: ; preds = %42, %32, %2
%47 = phi i32 [ 0, %2 ], [ 1, %32 ], [ 0, %42 ]
ret i32 %47
}