#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ getNextLine();
int /*<<< orphan*/ markdown();
scalar_t__ setInputFile(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *input;
  input = fopen(argv[1], "r");
  if (setInputFile(input)) {
    if (getNextLine() == 0) {
      markdown();
    }
  }
  fclose(input);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <setInputFile@plt>
cmp    $0x0,%rax
je     11ae <main+0x5e>
mov    $0x0,%al
call   1050 <getNextLine@plt>
cmp    $0x0,%rax
jne    11a9 <main+0x59>
mov    $0x0,%al
call   1070 <markdown@plt>
jmp    11ae <main+0x5e>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xea4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <setInputFile@plt>
test   %rax,%rax
je     1184 <main+0x34>
xor    %eax,%eax
call   1050 <getNextLine@plt>
test   %rax,%rax
jne    1184 <main+0x34>
xor    %eax,%eax
call   1070 <markdown@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = call i64 @setInputFile(i32* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = call i64 (...) @getNextLine()
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @markdown()
br label %19
19: ; preds = %17, %14
br label %20
20: ; preds = %19, %2
%21 = load i32*, i32** %6
%22 = call i32 @fclose(i32* %21)
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 @setInputFile(i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = tail call i64 (...) @getNextLine()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @markdown()
br label %13
13: ; preds = %8, %11, %2
%14 = tail call i32 @fclose(i32* %5)
ret i32 0
}