#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 const *, int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ lou_free();
int main(int argc, char **argv) {
  int result = 0;
  const char *str1 = "gross";
  const char *str2 = "gro\\x00df";
  const char *expected = "g^";
  result |= check_translation("tests/tables/uplow_with_unicode.ctb", str1, NULL,
                              expected);
  result |= check_translation("tests/tables/uplow_with_unicode.ctb", str2, NULL,
                              expected);
  result |= check_translation("tests/tables/lowercase_with_unicode.ctb", str1,
                              NULL, expected);
  result |= check_translation("tests/tables/lowercase_with_unicode.ctb", str2,
                              NULL, expected);
  lou_free();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xea6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xe88(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xe70(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <lou_free@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xee1(%rip),%r14
lea    0xec7(%rip),%r15
lea    0xed0(%rip),%r13
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebp
lea    0xead(%rip),%r12
mov    %r14,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebx
or     %ebp,%ebx
lea    0xec3(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebp
or     %r15d,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1040 <lou_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"gross\00"
@.str.1 = [10 x i8] c"gro\\x00df\00"
@.str.2 = [3 x i8] c"g^\00"
@.str.3 = [36 x i8] c"tests/tables/uplow_with_unicode.ctb\00"
@.str.4 = [40 x i8] c"tests/tables/lowercase_with_unicode.ctb\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 i8*
%9 = 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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %7
%11 = load i8*, i8** %9
%12 = call i32 @check_translation(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32* null, i8* %11)
%13 = load i32, i32* %6
%14 = or i32 %13, %12
store i32 %14, i32* %6
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = call i32 @check_translation(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %15, i32* null, i8* %16)
%18 = load i32, i32* %6
%19 = or i32 %18, %17
store i32 %19, i32* %6
%20 = load i8*, i8** %7
%21 = load i8*, i8** %9
%22 = call i32 @check_translation(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* %20, i32* null, i8* %21)
%23 = load i32, i32* %6
%24 = or i32 %23, %22
store i32 %24, i32* %6
%25 = load i8*, i8** %8
%26 = load i8*, i8** %9
%27 = call i32 @check_translation(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* %25, i32* null, i8* %26)
%28 = load i32, i32* %6
%29 = or i32 %28, %27
store i32 %29, i32* %6
%30 = call i32 (...) @lou_free()
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
@.str = [6 x i8] c"gross\00"
@.str.1 = [10 x i8] c"gro\\x00df\00"
@.str.2 = [3 x i8] c"g^\00"
@.str.3 = [36 x i8] c"tests/tables/uplow_with_unicode.ctb\00"
@.str.4 = [40 x i8] c"tests/tables/lowercase_with_unicode.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_translation(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @check_translation(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = or i32 %4, %3
%6 = tail call i32 @check_translation(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%7 = or i32 %5, %6
%8 = tail call i32 @check_translation(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = or i32 %7, %8
%10 = tail call i32 (...) @lou_free()
ret i32 %9
}