#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(int years, int rebuild, int samples) {
  fprintf(stderr, "usage: ./raidfailures -k k -m m [options]\n");
  fprintf(stderr, "\ndescription:\n");
  fprintf(stderr, "   Monte-Carlo simulation of array failure given drive "
                  "survival/failure\n");
  fprintf(stderr, "   probabilities\n");
  fprintf(stderr, "\noptions:\n");
  fprintf(stderr, "   -t drives\n");
  fprintf(stderr, "   -y years(%d)\n", years);
  fprintf(stderr, "   -r rebuilddays(%d)\n", rebuild);
  fprintf(stderr, "   -s samples(%d)\n", samples);
  fprintf(stderr,
          "   -i hdd-surviverates.dat        # input day/survival file\n");
  fprintf(stderr, "   -o outprobs.txt\n");
  fprintf(
      stderr,
      "   -p probability                 # flat survivial prob over life\n");
  fprintf(stderr, "   -v (verbose)\n");
  fprintf(stderr, "   -a print array - use with small values of s only!\n");
  fprintf(stderr, "\ngraphics:\n");
  fprintf(
      stderr,
      "   pnmtopng image.ppm >image.png  # generates a day vs disk image\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xf0d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xf08(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xef0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
lea    0xf06(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xf03(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
lea    0xf2f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
lea    0xf29(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d56(%rip),%rax
mov    (%rax),%edi
lea    0xf3d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    0x2eba(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf20(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf21(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf1b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf18(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf16(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf19(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf18(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf44(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf47(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf79(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf79(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf9e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf99(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"usage: ./raidfailures -k k -m m [options]\0A\00"
@.str.1 = [15 x i8] c"\0Adescription:\0A\00"
@.str.2 = [73 x i8] c" Monte-Carlo simulation of array failure given drive survival/failure\0A\00"
@.str.3 = [18 x i8] c" probabilities\0A\00"
@.str.4 = [11 x i8] c"\0Aoptions:\0A\00"
@.str.5 = [14 x i8] c" -t drives\0A\00"
@.str.6 = [17 x i8] c" -y years(%d)\0A\00"
@.str.7 = [23 x i8] c" -r rebuilddays(%d)\0A\00"
@.str.8 = [19 x i8] c" -s samples(%d)\0A\00"
@.str.9 = [61 x i8] c" -i hdd-surviverates.dat # input day/survival file\0A\00"
@.str.10 = [20 x i8] c" -o outprobs.txt\0A\00"
@.str.11 = [67 x i8] c" -p probability # flat survivial prob over life\0A\00"
@.str.12 = [17 x i8] c" -v (verbose)\0A\00"
@.str.13 = [54 x i8] c" -a print array - use with small values of s only!\0A\00"
@.str.14 = [12 x i8] c"\0Agraphics:\0A\00"
@.str.15 = [67 x i8] c" pnmtopng image.ppm >image.png # generates a day vs disk image\0A\00"
define void @usage(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = load i32, i32* %4
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @stderr
%23 = load i32, i32* %5
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @stderr
%26 = load i32, i32* %6
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"usage: ./raidfailures -k k -m m [options]\0A\00"
@.str.1 = [15 x i8] c"\0Adescription:\0A\00"
@.str.2 = [73 x i8] c" Monte-Carlo simulation of array failure given drive survival/failure\0A\00"
@.str.3 = [18 x i8] c" probabilities\0A\00"
@.str.4 = [11 x i8] c"\0Aoptions:\0A\00"
@.str.5 = [14 x i8] c" -t drives\0A\00"
@.str.6 = [17 x i8] c" -y years(%d)\0A\00"
@.str.7 = [23 x i8] c" -r rebuilddays(%d)\0A\00"
@.str.8 = [19 x i8] c" -s samples(%d)\0A\00"
@.str.9 = [61 x i8] c" -i hdd-surviverates.dat # input day/survival file\0A\00"
@.str.10 = [20 x i8] c" -o outprobs.txt\0A\00"
@.str.11 = [67 x i8] c" -p probability # flat survivial prob over life\0A\00"
@.str.12 = [17 x i8] c" -v (verbose)\0A\00"
@.str.13 = [54 x i8] c" -a print array - use with small values of s only!\0A\00"
@.str.14 = [12 x i8] c"\0Agraphics:\0A\00"
@.str.15 = [67 x i8] c" pnmtopng image.ppm >image.png # generates a day vs disk image\0A\00"
define void @usage(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %0)
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %1)
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %2)
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.15, i64 0, i64 0))
ret void
}