#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 */
scalar_t__ get_num(char *, char *);
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ s_letn(char *, char *, int);
char *tt_lookupTranslation(int /*<<< orphan*/, int);
char *macttLookupTranslation(char *arg) {
  int tbl = (int)get_num("ttLookupTranslation", arg);
  char *tmp;
  if ((tmp = tt_lookupTranslation(get_string(arg), tbl)) == NULL)
    *arg = '\0';
  else
    s_letn(tmp, arg, 10240);
  return arg;
}


x86 assembly (clang, -O0):
<macttLookupTranslation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_string@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <tt_lookupTranslation@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    118c <macttLookupTranslation+0x4c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    119e <macttLookupTranslation+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2800,%edx
call   1060 <s_letn@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttLookupTranslation>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <get_string@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1040 <tt_lookupTranslation@plt>
test   %rax,%rax
je     1182 <macttLookupTranslation+0x42>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x2800,%edx
call   1060 <s_letn@plt>
jmp    1185 <macttLookupTranslation+0x45>
movb   $0x0,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"ttLookupTranslation\00"
define i8* @macttLookupTranslation(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = call i32 @get_string(i8* %8)
%10 = load i32, i32* %3
%11 = call i8* @tt_lookupTranslation(i32 %9, i32 %10)
store i8* %11, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i8*, i8** %2
store i8 0, i8* %14
br label %19
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = call i32 @s_letn(i8* %16, i8* %17, i32 10240)
br label %19
19: ; preds = %15, %13
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [20 x i8] c"ttLookupTranslation\00"
define i8* @macttLookupTranslation(i8* returned %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @get_string(i8* %0)
%5 = tail call i8* @tt_lookupTranslation(i32 %4, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %0
br label %10
8: ; preds = %1
%9 = tail call i32 @s_letn(i8* %5, i8* %0, i32 10240)
br label %10
10: ; preds = %8, %7
ret i8* %0
}