#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*/ exit(int);
scalar_t__ getpid();
int /*<<< orphan*/ print_domain();
int /*<<< orphan*/ print_problem();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_command_line(int, char **);
int /*<<< orphan*/ srand(unsigned int);
int main(int argc, char *argv[]) {
  srand((unsigned int)getpid());
  if (!process_command_line(argc, argv)) {
    printf("example: drive -x 2 -y 2 \n");
    exit(1);
  }
  print_domain();
  print_problem();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <process_command_line@plt>
cmp    $0x0,%eax
jne    11b8 <main+0x48>
lea    0xe57(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x0,%al
call   1030 <print_domain@plt>
mov    $0x0,%al
call   1070 <print_problem@plt>
xor    %eax,%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   1050 <getpid@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1080 <process_command_line@plt>
test   %eax,%eax
je     11ab <main+0x3b>
xor    %eax,%eax
call   1030 <print_domain@plt>
xor    %eax,%eax
call   1070 <print_problem@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe4e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"example: drive -x 2 -y 2 \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i64 (...) @getpid()
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
%8 = load i32, i32* %3
%9 = load i8**, i8*** %4
%10 = call i32 @process_command_line(i32 %8, i8** %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = call i32 (...) @print_domain()
%17 = call i32 (...) @print_problem()
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"example: drive -x 2 -y 2 \00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 @process_command_line(i32 %0, i8** %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = tail call i32 (...) @print_domain()
%13 = tail call i32 (...) @print_problem()
ret i32 0
}