#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 check_translation(char *, char *, int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ lou_compileString(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char, char, char);
int main(int argc, char **argv) {
  int result = 0;
  char *table = "empty.ctb";
  char rule[18];
  lou_compileString(table, "include latinLetterDef6Dots.uti");
  for (char c1 = 'a'; c1 <= 'z'; c1++) {
    for (char c2 = 'a'; c2 <= 'z'; c2++) {
      for (char c3 = 'a'; c3 <= 'z'; c3++) {
        sprintf(rule, "always aa%c%c%c 1", c1, c2, c3);
        lou_compileString(table, rule);
      }
    }
  }
  result |= check_translation(table, "aaaaa", NULL, "a");
  result |= check_translation(table, "aaaaa", NULL, "a");
  result |= check_translation(table, "aazzz", NULL, "a");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1040 <lou_compileString@plt>
movb   $0x61,-0x41(%rbp)
movsbl -0x41(%rbp),%eax
cmp    $0x7a,%eax
jg     11fa <main+0xca>
movb   $0x61,-0x42(%rbp)
movsbl -0x42(%rbp),%eax
cmp    $0x7a,%eax
jg     11e8 <main+0xb8>
movb   $0x61,-0x43(%rbp)
movsbl -0x43(%rbp),%eax
cmp    $0x7a,%eax
jg     11d6 <main+0xa6>
lea    -0x40(%rbp),%rdi
mov    -0x41(%rbp),%cl
mov    -0x42(%rbp),%al
lea    0xe7e(%rip),%rsi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x43(%rbp),%r8d
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <lou_compileString@plt>
mov    -0x43(%rbp),%al
add    $0x1,%al
mov    %al,-0x43(%rbp)
jmp    118e <main+0x5e>
jmp    11db <main+0xab>
mov    -0x42(%rbp),%al
add    $0x1,%al
mov    %al,-0x42(%rbp)
jmp    117d <main+0x4d>
jmp    11ed <main+0xbd>
mov    -0x41(%rbp),%al
add    $0x1,%al
mov    %al,-0x41(%rbp)
jmp    116c <main+0x3c>
mov    -0x20(%rbp),%rdi
lea    0xe37(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
lea    0xe30(%rip),%rcx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe16(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
lea    0xe0f(%rip),%rcx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdfb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
lea    0xdee(%rip),%rcx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%r14
lea    0xebe(%rip),%rsi
mov    %r14,%rdi
call   1040 <lou_compileString@plt>
mov    $0x61,%r12b
lea    0xecc(%rip),%r15
mov    %rsp,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x61,%bl
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x61,%bpl
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %r12b,%edx
movsbl %bl,%ecx
movsbl %bpl,%ebp
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebp,%r8d
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <lou_compileString@plt>
add    $0x1,%bpl
cmp    $0x7b,%bpl
jne    1190 <main+0x60>
add    $0x1,%bl
cmp    $0x7b,%bl
jne    1180 <main+0x50>
add    $0x1,%r12b
cmp    $0x7b,%r12b
jne    1170 <main+0x40>
lea    0xe29(%rip),%r12
lea    0xe5e(%rip),%r14
lea    0xe5b(%rip),%r15
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebp
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebx
or     %ebp,%ebx
lea    0xe30(%rip),%rsi
mov    %r12,%rdi
xor    %edx,%edx
mov    %r15,%rcx
call   1030 <check_translation@plt>
or     %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"empty.ctb\00"
@.str.1 = [32 x i8] c"include latinLetterDef6Dots.uti\00"
@.str.2 = [18 x i8] c"always aa%c%c%c 1\00"
@.str.3 = [6 x i8] c"aaaaa\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"aazzz\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [18 x i8]
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @lou_compileString(i8* %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i8 97, i8* %9
br label %14
14: ; preds = %45, %2
%15 = load i8, i8* %9
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %18, label %48
18: ; preds = %14
store i8 97, i8* %10
br label %19
19: ; preds = %41, %18
%20 = load i8, i8* %10
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 122
br i1 %22, label %23, label %44
23: ; preds = %19
store i8 97, i8* %11
br label %24
24: ; preds = %37, %23
%25 = load i8, i8* %11
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 122
br i1 %27, label %28, label %40
28: ; preds = %24
%29 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%30 = load i8, i8* %9
%31 = load i8, i8* %10
%32 = load i8, i8* %11
%33 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8 signext %30, i8 signext %31, i8 signext %32)
%34 = load i8*, i8** %7
%35 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%36 = call i32 @lou_compileString(i8* %34, i8* %35)
br label %37
37: ; preds = %28
%38 = load i8, i8* %11
%39 = add i8 %38, 1
store i8 %39, i8* %11
br label %24
40: ; preds = %24
br label %41
41: ; preds = %40
%42 = load i8, i8* %10
%43 = add i8 %42, 1
store i8 %43, i8* %10
br label %19
44: ; preds = %19
br label %45
45: ; preds = %44
%46 = load i8, i8* %9
%47 = add i8 %46, 1
store i8 %47, i8* %9
br label %14
48: ; preds = %14
%49 = load i8*, i8** %7
%50 = call i32 @check_translation(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%51 = load i32, i32* %6
%52 = or i32 %51, %50
store i32 %52, i32* %6
%53 = load i8*, i8** %7
%54 = call i32 @check_translation(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%55 = load i32, i32* %6
%56 = or i32 %55, %54
store i32 %56, i32* %6
%57 = load i8*, i8** %7
%58 = call i32 @check_translation(i8* %57, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%59 = load i32, i32* %6
%60 = or i32 %59, %58
store i32 %60, i32* %6
%61 = load i32, i32* %6
ret i32 %61
}

LLVM IR (-O2):
@.str = [10 x i8] c"empty.ctb\00"
@.str.1 = [32 x i8] c"include latinLetterDef6Dots.uti\00"
@.str.2 = [18 x i8] c"always aa%c%c%c 1\00"
@.str.3 = [6 x i8] c"aaaaa\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"aazzz\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [18 x i8]
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @lou_compileString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %2, %16
%7 = phi i8 [ 97, %2 ], [ %17, %16 ]
br label %14
8: ; preds = %16
%9 = call i32 @check_translation(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @check_translation(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%11 = or i32 %10, %9
%12 = call i32 @check_translation(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%13 = or i32 %11, %12
ret i32 %13
14: ; preds = %6, %19
%15 = phi i8 [ 97, %6 ], [ %20, %19 ]
br label %22
16: ; preds = %19
%17 = add nuw nsw i8 %7, 1
%18 = icmp eq i8 %17, 123
br i1 %18, label %8, label %6
19: ; preds = %22
%20 = add nuw nsw i8 %15, 1
%21 = icmp eq i8 %20, 123
br i1 %21, label %16, label %14
22: ; preds = %14, %22
%23 = phi i8 [ 97, %14 ], [ %26, %22 ]
%24 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8 signext %7, i8 signext %15, i8 signext %23)
%25 = call i32 @lou_compileString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%26 = add nuw nsw i8 %23, 1
%27 = icmp eq i8 %26, 123
br i1 %27, label %19, label %22
}