#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*/ long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_translate(int /*<<< orphan*/, char *, int);
char *macttTranslate(char *arg) {
  char translation[10240];
  int tbl = (int)get_num("ttTranslate", arg);
  get_string(translation);
  long2str(arg, tt_translate(get_string(arg), translation, tbl));
  if (*arg == '0')
    *arg = '\0';
  return arg;
}


x86 assembly (clang, -O0):
<macttTranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2820,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0x2814(%rbp)
lea    -0x2810(%rbp),%rdi
call   1040 <get_string@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x2820(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
lea    -0x2810(%rbp),%rsi
mov    -0x2814(%rbp),%edx
call   1060 <tt_translate@plt>
mov    -0x2820(%rbp),%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    11be <macttTranslate+0x7e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttTranslate>:
push   %r15
push   %r14
push   %rbx
sub    $0x2800,%rsp
mov    %rdi,%rbx
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <get_string@plt>
mov    %rbx,%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1060 <tt_translate@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
cmpb   $0x30,(%rbx)
jne    1193 <macttTranslate+0x53>
movb   $0x0,(%rbx)
mov    %rbx,%rax
add    $0x2800,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"ttTranslate\00"
define i8* @macttTranslate(i8* returned %0) {
%2 = alloca [10240 x i8]
%3 = getelementptr inbounds [10240 x i8], [10240 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = trunc i64 %4 to i32
%6 = call i32 @get_string(i8* %3)
%7 = call i32 @get_string(i8* %0)
%8 = call i32 @tt_translate(i32 %7, i8* %3, i32 %5)
%9 = call i32 @long2str(i8* %0, i32 %8)
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 48
br i1 %11, label %12, label %13
12: ; preds = %1
store i8 0, i8* %0
br label %13
13: ; preds = %12, %1
ret i8* %0
}