#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*/ md_finalize();
int /*<<< orphan*/ md_initialize(char *, char *);
int /*<<< orphan*/ md_run();
int main(int argc, char **argv) {
  if (argc == 3) {
    md_initialize(argv[1], argv[2]);
  } else if (argc == 2) {
    md_initialize(argv[1], "md.input");
  } else {
    md_initialize("mdf.cls", "md.input");
  }
  md_run();
  md_finalize();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    116a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <md_initialize@plt>
jmp    11a5 <main+0x75>
cmpl   $0x2,-0x8(%rbp)
jne    118d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7d(%rip),%rsi
call   1030 <md_initialize@plt>
jmp    11a0 <main+0x70>
lea    0xe75(%rip),%rdi
lea    0xe65(%rip),%rsi
call   1030 <md_initialize@plt>
jmp    11a5 <main+0x75>
mov    $0x0,%al
call   1050 <md_run@plt>
mov    $0x0,%al
call   1040 <md_finalize@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
je     1145 <main+0x15>
cmp    $0x3,%edi
jne    114b <main+0x1b>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
jmp    1159 <main+0x29>
mov    0x8(%rsi),%rdi
jmp    1152 <main+0x22>
lea    0xeb7(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1030 <md_initialize@plt>
xor    %eax,%eax
call   1050 <md_run@plt>
xor    %eax,%eax
call   1040 <md_finalize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"md.input\00"
@.str.1 = [8 x i8] c"mdf.cls\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @md_initialize(i8* %11, i8* %14)
br label %27
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @md_initialize(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %26
24: ; preds = %16
%25 = call i32 @md_initialize(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
br label %27
27: ; preds = %26, %8
%28 = call i32 (...) @md_run()
%29 = call i32 (...) @md_finalize()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"md.input\00"
@.str.1 = [8 x i8] c"mdf.cls\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %13 [
i32 3, label %3
i32 2, label %9
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @md_initialize(i8* %5, i8* %7)
br label %15
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @md_initialize(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = tail call i32 @md_initialize(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %9, %13, %3
%16 = tail call i32 (...) @md_run()
%17 = tail call i32 (...) @md_finalize()
ret i32 0
}