#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 main(int argc, char **argv) {
  int result = 0;
  const char *str1 = "gross";
  const char *str2 = "gro\\x00df";
  const char *expected = "g^";
  result |= check_translation("uplow_with_unicode.ctb", str1, NULL, expected);
  result |= check_translation("uplow_with_unicode.ctb", str2, NULL, expected);
  result |=
      check_translation("lowercase_with_unicode.ctb", str1, NULL, expected);
  result |=
      check_translation("lowercase_with_unicode.ctb", str2, NULL, expected);
  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    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xeb6(%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    0xe98(%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    0xe91(%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    0xe73(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
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    0xef1(%rip),%r14
lea    0xed7(%rip),%r15
lea    0xee0(%rip),%r13
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebp
lea    0xebd(%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    0xec6(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1030 <check_translation@plt>
or     %ebp,%eax
or     %ebx,%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 = [23 x i8] c"uplow_with_unicode.ctb\00"
@.str.4 = [27 x i8] c"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 ([23 x i8], [23 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 ([23 x i8], [23 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 ([27 x i8], [27 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 ([27 x i8], [27 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 = load i32, i32* %6
ret i32 %30
}

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 = [23 x i8] c"uplow_with_unicode.ctb\00"
@.str.4 = [27 x i8] c"lowercase_with_unicode.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_translation(i8* getelementptr inbounds ([23 x i8], [23 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 ([23 x i8], [23 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 ([27 x i8], [27 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 ([27 x i8], [27 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
ret i32 %9
}