#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*/ dataOpen(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ templateOpen(char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  char *openData = argv[1];
  char *openTemplate = argv[2];
  char *outputFile = argv[3];
  char value[255];
  char key[255];
  if (argc != 4) {
    printf(" incorrect number of arguments given\n");
    return 1;
  }
  dataOpen(openData, key, value);
  templateOpen(openTemplate, outputFile, key, value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     118f <main+0x5f>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c8 <main+0x98>
mov    -0x18(%rbp),%rdi
lea    -0x230(%rbp),%rsi
lea    -0x130(%rbp),%rdx
call   1050 <dataOpen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x230(%rbp),%rdx
lea    -0x130(%rbp),%rcx
call   1040 <templateOpen@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
cmp    $0x4,%edi
jne    117a <main+0x4a>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rbx
mov    0x18(%rsi),%r14
mov    %rsp,%r15
lea    0x100(%rsp),%r12
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <dataOpen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <templateOpen@plt>
xor    %eax,%eax
jmp    118b <main+0x5b>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [38 x i8] c" incorrect number of arguments given\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [255 x i8]
%10 = alloca [255 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
store i8* %16, i8** %7
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
store i8* %19, i8** %8
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 4
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %34
24: ; preds = %2
%25 = load i8*, i8** %6
%26 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%27 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%28 = call i32 @dataOpen(i8* %25, i8* %26, i8* %27)
%29 = load i8*, i8** %7
%30 = load i8*, i8** %8
%31 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%32 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%33 = call i32 @templateOpen(i8* %29, i8* %30, i8* %31, i8* %32)
store i32 0, i32* %3
br label %34
34: ; preds = %24, %22
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@str = [37 x i8] c" incorrect number of arguments given\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = alloca [255 x i8]
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%13 = icmp eq i32 %0, 4
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %19
16: ; preds = %2
%17 = call i32 @dataOpen(i8* %6, i8* %12, i8* %11)
%18 = call i32 @templateOpen(i8* %8, i8* %10, i8* %12, i8* %11)
br label %19
19: ; preds = %16, %14
%20 = phi i32 [ 1, %14 ], [ 0, %16 ]
ret i32 %20
}