#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 */
struct makefile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ automake(struct makefile *);
int /*<<< orphan*/ condition_init();
int /*<<< orphan*/ condition_set(char *);
int /*<<< orphan*/ *getenv(char *);
struct makefile *parse_makefile(char *);
int /*<<< orphan*/ print_tokenized_file(char *);
int main(int argc, char **argv) {
  condition_init();
  condition_set("someflag");
  condition_set("PFK_AM_BUILD_doxygen");
  if (argc == 2) {
    if (getenv("DEBUG") == NULL) {
      struct makefile *mf;
      mf = parse_makefile(argv[1]);
      if (mf) {
        automake(mf);
      }
    } else
      print_tokenized_file(argv[1]);
  }
  return 0;
}


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    $0x0,%al
call   1040 <condition_init@plt>
lea    0xe7c(%rip),%rdi
call   1060 <condition_set@plt>
lea    0xe79(%rip),%rdi
call   1060 <condition_set@plt>
cmpl   $0x2,-0x8(%rbp)
jne    11f1 <main+0x91>
lea    0xe78(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
jne    11df <main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <parse_makefile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11da <main+0x7a>
mov    -0x18(%rbp),%rdi
call   1080 <automake@plt>
jmp    11ec <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <print_tokenized_file@plt>
jmp    11f1 <main+0x91>
xor    %eax,%eax
add    $0x20,%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   1040 <condition_init@plt>
lea    0xe8a(%rip),%rdi
call   1060 <condition_set@plt>
lea    0xe87(%rip),%rdi
call   1060 <condition_set@plt>
cmp    $0x2,%ebp
jne    11ba <main+0x5a>
lea    0xe8b(%rip),%rdi
call   1030 <getenv@plt>
mov    0x8(%rbx),%rdi
test   %rax,%rax
je     11a8 <main+0x48>
call   1050 <print_tokenized_file@plt>
jmp    11ba <main+0x5a>
call   1070 <parse_makefile@plt>
test   %rax,%rax
je     11ba <main+0x5a>
mov    %rax,%rdi
call   1080 <automake@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.makefile = type { i32 }
@.str = [9 x i8] c"someflag\00"
@.str.1 = [21 x i8] c"PFK_AM_BUILD_doxygen\00"
@.str.2 = [6 x i8] c"DEBUG\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.makefile*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @condition_init()
%8 = call i32 @condition_set(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @condition_set(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %32
12: ; preds = %2
%13 = call i32* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call %struct.makefile* @parse_makefile(i8* %18)
store %struct.makefile* %19, %struct.makefile** %6
%20 = load %struct.makefile*, %struct.makefile** %6
%21 = icmp ne %struct.makefile* %20, null
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load %struct.makefile*, %struct.makefile** %6
%24 = call i32 @automake(%struct.makefile* %23)
br label %25
25: ; preds = %22, %15
br label %31
26: ; preds = %12
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @print_tokenized_file(i8* %29)
br label %31
31: ; preds = %26, %25
br label %32
32: ; preds = %31, %2
ret i32 0
}

LLVM IR (-O2):
%struct.makefile = type { i32 }
@.str = [9 x i8] c"someflag\00"
@.str.1 = [21 x i8] c"PFK_AM_BUILD_doxygen\00"
@.str.2 = [6 x i8] c"DEBUG\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @condition_init()
%4 = tail call i32 @condition_set(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @condition_set(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %0, 2
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = tail call i32* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32* %8, null
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
br i1 %9, label %12, label %17
12: ; preds = %7
%13 = tail call %struct.makefile* @parse_makefile(i8* %11)
%14 = icmp eq %struct.makefile* %13, null
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i32 @automake(%struct.makefile* %13)
br label %19
17: ; preds = %7
%18 = tail call i32 @print_tokenized_file(i8* %11)
br label %19
19: ; preds = %12, %15, %17, %2
ret i32 0
}