#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*/ Initialize();
int RTF_Parse(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  Initialize();
  if (argc > 1) {
    if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-H") == 0) {
      printf("Use: %s [rtf_filename]\n", argv[0]);
      return 0;
    } else if (strcmp(argv[1], "--version") == 0 ||
               strcmp(argv[1], "-V") == 0) {
      printf("rtf2html version 1.1 beta\n");
      return 0;
    }
  }
  if (argc > 1)
    return (RTF_Parse(argv[1]));
  else
    return (RTF_Parse(NULL));
}


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)
mov    $0x0,%al
call   1060 <Initialize@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1224 <main+0xe4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11a3 <main+0x63>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe73(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c4 <main+0x84>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    124f <main+0x10f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1200 <main+0xc0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    121a <main+0xda>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    124f <main+0x10f>
jmp    121f <main+0xdf>
jmp    1224 <main+0xe4>
cmpl   $0x1,-0x8(%rbp)
jle    1243 <main+0x103>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <RTF_Parse@plt>
mov    %eax,-0x4(%rbp)
jmp    124f <main+0x10f>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <RTF_Parse@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <Initialize@plt>
cmp    $0x2,%ebp
jl     11be <main+0x6e>
mov    0x8(%rbx),%rdi
lea    0xe91(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11cb <main+0x7b>
mov    0x8(%rbx),%rdi
lea    0xe83(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11cb <main+0x7b>
mov    0x8(%rbx),%rdi
lea    0xe89(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11de <main+0x8e>
mov    0x8(%rbx),%rdi
lea    0xe7e(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11de <main+0x8e>
mov    0x8(%rbx),%rdi
jmp    11c0 <main+0x70>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <RTF_Parse@plt>
mov    (%rbx),%rsi
lea    0xe35(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ea <main+0x9a>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-H\00"
@.str.2 = [24 x i8] c"Use: %s [rtf_filename]\0A\00"
@.str.3 = [10 x i8] c"--version\00"
@.str.4 = [3 x i8] c"-V\00"
@.str.5 = [27 x i8] c"rtf2html version 1.1 beta\0A\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 = call i32 (...) @Initialize()
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %42
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %15, %9
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %24)
store i32 0, i32* %3
br label %52
26: ; preds = %15
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %32, %26
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %3
br label %52
40: ; preds = %32
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41, %2
%43 = load i32, i32* %4
%44 = icmp sgt i32 %43, 1
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @RTF_Parse(i8* %48)
store i32 %49, i32* %3
br label %52
50: ; preds = %42
%51 = call i32 @RTF_Parse(i8* null)
store i32 %51, i32* %3
br label %52
52: ; preds = %50, %45, %38, %21
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-H\00"
@.str.2 = [24 x i8] c"Use: %s [rtf_filename]\0A\00"
@.str.3 = [10 x i8] c"--version\00"
@.str.4 = [3 x i8] c"-V\00"
@str = [26 x i8] c"rtf2html version 1.1 beta\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @Initialize()
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %30
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = load i8*, i8** %6
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10, %5
%15 = load i8*, i8** %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %32
17: ; preds = %10
%18 = load i8*, i8** %6
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21, %17
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %32
27: ; preds = %21
%28 = load i8*, i8** %6
%29 = tail call i32 @RTF_Parse(i8* %28)
br label %32
30: ; preds = %2
%31 = tail call i32 @RTF_Parse(i8* null)
br label %32
32: ; preds = %30, %27, %25, %14
%33 = phi i32 [ 0, %14 ], [ 0, %25 ], [ %29, %27 ], [ %31, %30 ]
ret i32 %33
}