#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__ cc2MapGMT(char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int narg;
  char fn_ddcc[100];
  char fn_out[100];
  fprintf(stdout, "%s Arguments: ", "DDcc2MapGMT");
  for (narg = 0; narg < argc; narg++)
    fprintf(stdout, "<%s> ", argv[narg]);
  fprintf(stdout, "\n");
  if (argc < 3) {
    fprintf(stdout, "%s\n", "ERROR wrong number of command line arguments.");
    fprintf(stdout, "%s %s %s\n", "Usage: ", "DDcc2MapGMT",
            "<ddcc_file> <output_file_root>");
    exit(-1);
  }
  strcpy(fn_ddcc, argv[1]);
  strcpy(fn_out, argv[2]);
  printf("Processing file: %s\n", fn_ddcc);
  if (cc2MapGMT(fn_ddcc, fn_out) < 0)
    exit(-1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
lea    0xe8f(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cb <main+0x7b>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe65(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <main+0x3e>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    1240 <main+0xf0>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
lea    0xe1e(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
lea    0xe38(%rip),%rdx
lea    0xde7(%rip),%rcx
lea    0xe32(%rip),%r8
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rsi
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1060 <cc2MapGMT@plt>
cmp    $0x0,%rax
jge    1299 <main+0x149>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r12
mov    %edi,%r14d
mov    0x2e72(%rip),%r15
mov    (%r15),%edi
lea    0xe88(%rip),%rsi
lea    0xe90(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %r14d,%r14d
jle    121c <main+0xcc>
mov    %r14d,%ebx
lea    0xe82(%rip),%r13
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    (%r12,%rbp,8),%rdx
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11a0 <main+0x50>
mov    (%r15),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x2,%r14d
jle    122d <main+0xdd>
mov    0x8(%r12),%rsi
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    0x10(%r12),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe86(%rip),%rdi
mov    %rbp,%rsi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <cc2MapGMT@plt>
test   %rax,%rax
jns    1275 <main+0x125>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    (%r15),%edi
lea    0xe6d(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xe5a(%rip),%rsi
lea    0xde3(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xe00(%rip),%rsi
lea    0xe03(%rip),%rdx
lea    0xdb2(%rip),%rcx
lea    0xdfd(%rip),%r8
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"%s Arguments: \00"
@.str.1 = [12 x i8] c"DDcc2MapGMT\00"
@.str.2 = [6 x i8] c"<%s> \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [46 x i8] c"ERROR wrong number of command line arguments.\00"
@.str.6 = [10 x i8] c"%s %s %s\0A\00"
@.str.7 = [8 x i8] c"Usage: \00"
@.str.8 = [31 x i8] c"<ddcc_file> <output_file_root>\00"
@.str.9 = [21 x i8] c"Processing file: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @stdout
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %23, %2
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* @stdout
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %11
26: ; preds = %11
%27 = load i32, i32* @stdout
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %37
31: ; preds = %26
%32 = load i32, i32* @stdout
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%34 = load i32, i32* @stdout
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 @exit(i32 -1)
unreachable
37: ; preds = %26
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @strcpy(i8* %38, i8* %41)
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @strcpy(i8* %43, i8* %46)
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%49 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%52 = call i64 @cc2MapGMT(i8* %50, i8* %51)
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %37
%55 = call i32 @exit(i32 -1)
unreachable
56: ; preds = %37
%57 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"%s Arguments: \00"
@.str.1 = [12 x i8] c"DDcc2MapGMT\00"
@.str.2 = [6 x i8] c"<%s> \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [46 x i8] c"ERROR wrong number of command line arguments.\00"
@.str.6 = [10 x i8] c"%s %s %s\0A\00"
@.str.7 = [8 x i8] c"Usage: \00"
@.str.8 = [31 x i8] c"<ddcc_file> <output_file_root>\00"
@.str.9 = [21 x i8] c"Processing file: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp sgt i32 %0, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %27
13: ; preds = %2
%14 = zext i32 %0 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %21, %15 ]
%17 = load i32, i32* @stdout
%18 = getelementptr inbounds i8*, i8** %1, i64 %16
%19 = load i8*, i8** %18
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = add nuw nsw i64 %16, 1
%22 = icmp eq i64 %21, %14
br i1 %22, label %23, label %15
23: ; preds = %15
%24 = load i32, i32* @stdout
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp slt i32 %0, 3
br i1 %26, label %27, label %33
27: ; preds = %10, %23
%28 = load i32, i32* @stdout
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%32 = tail call i32 @exit(i32 -1)
unreachable
33: ; preds = %23
%34 = getelementptr inbounds i8*, i8** %1, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %5, i8* %35)
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @strcpy(i8* %6, i8* %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%41 = call i64 @cc2MapGMT(i8* %5, i8* %6)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %33
%44 = call i32 @exit(i32 -1)
unreachable
45: ; preds = %33
%46 = call i32 @exit(i32 0)
unreachable
}