#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*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ parseOverview(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *out;
  if (argc != 3) {
    fprintf(stderr,
            "usage: make_driver_db_foomatic <dbdirectory> <dbfilename>\n");
    exit(-1);
  }
  out = fopen(argv[2], "w");
  if (out == NULL) {
    fprintf(stderr, "Unable to open DB file: %s\n", argv[2]);
    exit(-1);
  }
  if (!parseOverview(argv[1], out))
    fprintf(stderr, "Unable to parse printer DB\n");
  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)
cmpl   $0x3,-0x8(%rbp)
je     1181 <main+0x41>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11cd <main+0x8d>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <parseOverview@plt>
cmp    $0x0,%eax
jne    11fe <main+0xbe>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jne    1189 <main+0x49>
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
lea    0xee7(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     11aa <main+0x6a>
mov    0x8(%rbx),%rdi
mov    %rax,%rsi
call   1040 <parseOverview@plt>
test   %eax,%eax
jne    1185 <main+0x45>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbx),%rdx
lea    0xe7f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"usage: make_driver_db_foomatic <dbdirectory> <dbfilename>\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [28 x i8] c"Unable to open DB file: %s\0A\00"
@.str.3 = [28 x i8] c"Unable to parse printer DB\0A\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 i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %27
20: ; preds = %13
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = call i32 @exit(i32 -1)
unreachable
27: ; preds = %13
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = load i32*, i32** %6
%32 = call i32 @parseOverview(i8* %30, i32* %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %27
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %34, %27
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"usage: make_driver_db_foomatic <dbdirectory> <dbfilename>\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [28 x i8] c"Unable to open DB file: %s\0A\00"
@.str.3 = [28 x i8] c"Unable to parse printer DB\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %9
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 -1)
unreachable
18: ; preds = %8
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32 @parseOverview(i8* %20, i32* %11)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %23, %18
ret i32 0
}