#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*/ halt(char *, int /*<<< orphan*/ *);
char *s_let(char *, char *);
int tt_translateTokens(int /*<<< orphan*/, char *, int, int);
char *macttTranslateTokens(char *arg) {
  char buf[10240];
  int tbl = (int)get_num("ttNMomenta", arg);
  switch (tt_translateTokens(get_string(buf), arg, tbl, 10240)) {
  case -5:
    return s_let(buf, arg);
  case -16:
    halt("Too long string.", NULL);
  }
  return arg;
}


x86 assembly (clang, -O0):
<macttTranslateTokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2820,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0x2814(%rbp)
lea    -0x2810(%rbp),%rdi
call   1050 <get_string@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x2814(%rbp),%edx
mov    $0x2800,%ecx
call   1070 <tt_translateTokens@plt>
mov    %eax,%ecx
mov    %ecx,-0x2818(%rbp)
sub    $0xfffffff0,%eax
je     11da <macttTranslateTokens+0x8a>
jmp    11ad <macttTranslateTokens+0x5d>
mov    -0x2818(%rbp),%eax
sub    $0xfffffffb,%eax
jne    11ea <macttTranslateTokens+0x9a>
jmp    11c1 <macttTranslateTokens+0x71>
lea    -0x2810(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <s_let@plt>
mov    %rax,-0x8(%rbp)
jmp    11f2 <macttTranslateTokens+0xa2>
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <halt@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttTranslateTokens>:
push   %r14
push   %rbx
sub    $0x2808,%rsp
mov    %rdi,%rbx
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rsp,%rdi
call   1050 <get_string@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    $0x2800,%ecx
call   1070 <tt_translateTokens@plt>
cmp    $0xfffffff0,%eax
je     11a3 <macttTranslateTokens+0x53>
cmp    $0xfffffffb,%eax
jne    11b1 <macttTranslateTokens+0x61>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <s_let@plt>
mov    %rax,%rbx
jmp    11b1 <macttTranslateTokens+0x61>
lea    0xe61(%rip),%rdi
xor    %esi,%esi
call   1060 <halt@plt>
mov    %rbx,%rax
add    $0x2808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ttNMomenta\00"
@.str.1 = [17 x i8] c"Too long string.\00"
define i8* @macttTranslateTokens(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [10240 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @get_num(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = getelementptr inbounds [10240 x i8], [10240 x i8]* %4, i64 0, i64 0
%10 = call i32 @get_string(i8* %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = call i32 @tt_translateTokens(i32 %10, i8* %11, i32 %12, i32 10240)
switch i32 %13, label %20 [
i32 -5, label %14
i32 -16, label %18
]
14: ; preds = %1
%15 = getelementptr inbounds [10240 x i8], [10240 x i8]* %4, i64 0, i64 0
%16 = load i8*, i8** %3
%17 = call i8* @s_let(i8* %15, i8* %16)
store i8* %17, i8** %2
br label %22
18: ; preds = %1
%19 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* null)
br label %20
20: ; preds = %18, %1
%21 = load i8*, i8** %3
store i8* %21, i8** %2
br label %22
22: ; preds = %20, %14
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [11 x i8] c"ttNMomenta\00"
@.str.1 = [17 x i8] c"Too long string.\00"
define i8* @macttTranslateTokens(i8* %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 ([11 x i8], [11 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 @tt_translateTokens(i32 %6, i8* %0, i32 %5, i32 10240)
switch i32 %7, label %12 [
i32 -5, label %8
i32 -16, label %10
]
8: ; preds = %1
%9 = call i8* @s_let(i8* %3, i8* %0)
br label %12
10: ; preds = %1
%11 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* null)
br label %12
12: ; preds = %1, %10, %8
%13 = phi i8* [ %9, %8 ], [ %0, %10 ], [ %0, %1 ]
ret i8* %13
}