#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
void exit_with_usage(FILE *stream) {
  fprintf(stream, "Usage: %s [seed] [density] [bitsnumber] [filename]\n\n",
          "randbitmap");
  fprintf(stream, "Generates a repeatable random bitmap.\n"
                  "This is accomplished by using an internal pseudorandom "
                  "number generator.\n\n"
                  "Written by Andras Majdan\n"
                  "License: GNU General Public License Version 3\n"
                  "Report bugs to <majdan.andras@gmail.com>\n");
  if (stream == stderr)
    exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<exit_with_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xef7(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%rax
jne    1175 <exit_with_usage+0x55>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xef0(%rip),%rdi
mov    $0xe0,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    0x2e77(%rip),%rax
cmp    %rbx,(%rax)
jne    1178 <exit_with_usage+0x48>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: %s [seed] [density] [bitsnumber] [filename]\0A\0A\00"
@.str.1 = [11 x i8] c"randbitmap\00"
@.str.2 = [225 x i8] c"Generates a repeatable random bitmap.\0AThis is accomplished by using an internal pseudorandom number generator.\0A\0AWritten by Andras Majdan\0ALicense: GNU General Public License Version 3\0AReport bugs to <majdan.andras@gmail.com>\0A\00"
@stderr = global i32* null
define void @exit_with_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = load i32*, i32** @stderr
%9 = icmp eq i32* %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"Usage: %s [seed] [density] [bitsnumber] [filename]\0A\0A\00"
@.str.1 = [11 x i8] c"randbitmap\00"
@.str.2 = [225 x i8] c"Generates a repeatable random bitmap.\0AThis is accomplished by using an internal pseudorandom number generator.\0A\0AWritten by Andras Majdan\0ALicense: GNU General Public License Version 3\0AReport bugs to <majdan.andras@gmail.com>\0A\00"
@stderr = global i32* null
define void @exit_with_usage(i32* nocapture %0) {
%2 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str.2, i64 0, i64 0), i64 224, i64 1, i32* %0)
%4 = load i32*, i32** @stderr
%5 = icmp eq i32* %4, %0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @exit(i32 0)
unreachable
}