#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 */
double atof(char *);
int /*<<< orphan*/ exceed_standard_deviation_output(double, double, double,
                                                    char *, double, char,
                                                    char *);
int /*<<< orphan*/ exceed_standard_deviation_stdin(double *, double *, double *,
                                                   double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char delimiter = '^';
  double number_of_standard_deviations;
  double value;
  char *key_string;
  char *key_value_file;
  double minimum_value = 0.0;
  double average = 0.0;
  double maximum_value = 0.0;
  if (argc != 6) {
    fprintf(stderr,
            "Usage: %s number_of_standard_deviations key_string value "
            "delimiter key_value_file\n",
            argv[0]);
    fprintf(stderr, "Note: either [key_string value] or [key_value_file]. The "
                    "key_value_file\n"
                    "allows for multiple checks.\n");
    exit(1);
  }
  number_of_standard_deviations = atof(argv[1]);
  key_string = argv[2];
  value = atof(argv[3]);
  if (strcmp(argv[4], "delimiter") != 0)
    delimiter = *argv[4];
  key_value_file = argv[5];
  exceed_standard_deviation_stdin(&minimum_value, &maximum_value, &average,
                                  number_of_standard_deviations);
  exceed_standard_deviation_output(minimum_value, maximum_value, average,
                                   key_string, value, delimiter,
                                   key_value_file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x5e,-0x11(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     11db <main+0x7b>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1236 <main+0xd6>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1060 <exceed_standard_deviation_stdin@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mov    -0x30(%rbp),%rdi
movsd  -0x28(%rbp),%xmm3
mov    -0x11(%rbp),%al
mov    -0x38(%rbp),%rdx
movsbl %al,%esi
call   1080 <exceed_standard_deviation_output@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
cmp    $0x6,%edi
jne    1222 <main+0xc2>
mov    0x8(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x20(%rsp)
mov    0x10(%rbx),%r14
mov    0x18(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x28(%rsp)
mov    0x20(%rbx),%rdi
lea    0xefc(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11cf <main+0x6f>
mov    0x20(%rbx),%rax
mov    (%rax),%bpl
jmp    11d2 <main+0x72>
mov    $0x5e,%bpl
mov    0x28(%rbx),%rbx
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
movsd  0x20(%rsp),%xmm0
call   1060 <exceed_standard_deviation_stdin@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsbl %bpl,%esi
mov    %r14,%rdi
movsd  0x28(%rsp),%xmm3
mov    %rbx,%rdx
call   1080 <exceed_standard_deviation_output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2db7(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xdca(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe0c(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Usage: %s number_of_standard_deviations key_string value delimiter key_value_file\0A\00"
@.str.1 = [101 x i8] c"Note: either [key_string value] or [key_value_file]. The key_value_file\0Aallows for multiple checks.\0A\00"
@.str.2 = [10 x i8] c"delimiter\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 94, i8* %6
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 6
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call double @atof(i8* %28)
store double %29, double* %7
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
store i8* %32, i8** %9
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = call double @atof(i8* %35)
store double %36, double* %8
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 4
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %47
42: ; preds = %25
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 4
%45 = load i8*, i8** %44
%46 = load i8, i8* %45
store i8 %46, i8* %6
br label %47
47: ; preds = %42, %25
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 5
%50 = load i8*, i8** %49
store i8* %50, i8** %10
%51 = load double, double* %7
%52 = call i32 @exceed_standard_deviation_stdin(double* %11, double* %13, double* %12, double %51)
%53 = load double, double* %11
%54 = load double, double* %13
%55 = load double, double* %12
%56 = load i8*, i8** %9
%57 = load double, double* %8
%58 = load i8, i8* %6
%59 = load i8*, i8** %10
%60 = call i32 @exceed_standard_deviation_output(double %53, double %54, double %55, i8* %56, double %57, i8 signext %58, i8* %59)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Usage: %s number_of_standard_deviations key_string value delimiter key_value_file\0A\00"
@.str.1 = [101 x i8] c"Note: either [key_string value] or [key_value_file]. The key_value_file\0Aallows for multiple checks.\0A\00"
@.str.2 = [10 x i8] c"delimiter\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%7 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%8 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%9 = icmp eq i32 %0, 6
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call double @atof(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call double @atof(i8* %24)
%26 = getelementptr inbounds i8*, i8** %1, i64 4
%27 = load i8*, i8** %26
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %17
%31 = load i8*, i8** %26
%32 = load i8, i8* %31
br label %33
33: ; preds = %30, %17
%34 = phi i8 [ %32, %30 ], [ 94, %17 ]
%35 = getelementptr inbounds i8*, i8** %1, i64 5
%36 = load i8*, i8** %35
%37 = call i32 @exceed_standard_deviation_stdin(double* %3, double* %5, double* %4, double %20)
%38 = load double, double* %3
%39 = load double, double* %5
%40 = load double, double* %4
%41 = call i32 @exceed_standard_deviation_output(double %38, double %39, double %40, i8* %22, double %25, i8 signext %34, i8* %36)
ret i32 0
}