#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 /*<<< orphan*/ combineBinaryTablesInTpplusFile(char **, char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tppInitDllNative();
void main(int argc, char *argv[]) {
  char *tpplus;
  char **binary;
  if (argc < 3) {
    printf(
        "usage: covertBinaryTpplus <tpplus matrix file> <binary file1>...\n");
    fflush(stdout);
    exit(-2);
  }
  tpplus = argv[1];
  binary = argv;
  printf("binary %s\n", *binary);
  printf("binary %s\n", *(++binary));
  printf("binary %s\n", *(++binary));
  tppInitDllNative();
  combineBinaryTablesInTpplusFile(binary, tpplus, argc - 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    118f <main+0x3f>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0xfffffffe,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
mov    0x8(%rax),%rsi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
mov    0x8(%rax),%rsi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <tppInitDllNative@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
sub    $0x2,%edx
call   1040 <combineBinaryTablesInTpplusFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jle    11ca <main+0x6a>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rsi
mov    0x8(%rbx),%r14
lea    0xe81(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rsi
add    $0x10,%rbx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <tppInitDllNative@plt>
add    $0xfffffffe,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <combineBinaryTablesInTpplusFile@plt>
lea    0xe3a(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0xfffffffe,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"usage: covertBinaryTpplus <tpplus matrix file> <binary file1>...\0A\00"
@stdout = global i32 0
@.str.1 = [11 x i8] c"binary %s\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @exit(i32 -2)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %5
%18 = load i8**, i8*** %4
store i8** %18, i8*** %6
%19 = load i8**, i8*** %6
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8**, i8*** %6
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %6
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = load i8**, i8*** %6
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %6
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = call i32 (...) @tppInitDllNative()
%31 = load i8**, i8*** %6
%32 = load i8*, i8** %5
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 2
%35 = call i32 @combineBinaryTablesInTpplusFile(i8** %31, i8* %32, i32 %34)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [11 x i8] c"binary %s\0A\00"
@str = [65 x i8] c"usage: covertBinaryTpplus <tpplus matrix file> <binary file1>...\00"
define void @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @exit(i32 -2)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %10
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = tail call i32 (...) @tppInitDllNative()
%20 = add nsw i32 %0, -2
%21 = tail call i32 @combineBinaryTablesInTpplusFile(i8** %16, i8* %11, i32 %20)
ret void
}