#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 */
long get_num(char *, char *);
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_linesReorder(int /*<<< orphan*/, int, long);
char *macttLinesReorder(char *arg) {
  int tbl;
  long top;
  top = get_num("ttLinesReorder", arg);
  tbl = (int)get_num("ttLinesReorder", arg);
  long2str(arg, tt_linesReorder(get_string(arg), tbl, top));
  if (*arg == '0')
    *arg = '\0';
  return arg;
}


x86 assembly (clang, -O0):
<macttLinesReorder>:
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    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <tt_linesReorder@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1060 <long2str@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    11b4 <macttLinesReorder+0x74>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttLinesReorder>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
mov    %r14d,%esi
mov    %r15,%rdx
call   1050 <tt_linesReorder@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <long2str@plt>
cmpb   $0x30,(%rbx)
jne    1192 <macttLinesReorder+0x52>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ttLinesReorder\00"
define i8* @macttLinesReorder(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @get_string(i8* %11)
%13 = load i32, i32* %3
%14 = load i64, i64* %4
%15 = call i32 @tt_linesReorder(i32 %12, i32 %13, i64 %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 = [15 x i8] c"ttLinesReorder\00"
define i8* @macttLinesReorder(i8* returned %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @get_string(i8* %0)
%6 = tail call i32 @tt_linesReorder(i32 %5, i32 %4, i64 %2)
%7 = tail call i32 @long2str(i8* %0, i32 %6)
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 48
br i1 %9, label %10, label %11
10: ; preds = %1
store i8 0, i8* %0
br label %11
11: ; preds = %10, %1
ret i8* %0
}