#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*/ clParseError(int, char **, int, char *);
scalar_t__ strcasecmp(char *, char const *);
int readOptionDouble4(int argc, char **argv, int *i, const char *opt,
                      double *arg1, double *arg2, double *arg3, double *arg4) {
  if ((*i) < argc) {
    if (strcasecmp(argv[(*i)], opt) == 0) {
      (*i) += 1;
      if ((*i) < argc) {
        (*arg1) = atof(argv[(*i)]);
      } else {
        clParseError(argc, argv, (*i), "Option expects four arguments");
      }
      (*i) += 1;
      if ((*i) < argc) {
        (*arg2) = atof(argv[(*i)]);
      } else {
        clParseError(argc, argv, (*i), "Option expects four arguments");
      }
      (*i) += 1;
      if ((*i) < argc) {
        (*arg3) = atof(argv[(*i)]);
      } else {
        clParseError(argc, argv, (*i), "Option expects four arguments");
      }
      (*i) += 1;
      if ((*i) < argc) {
        (*arg4) = atof(argv[(*i)]);
        return 1;
      } else {
        clParseError(argc, argv, (*i), "Option expects four arguments");
      }
      return 0;
    }
  } else {
    clParseError(argc, argv, (*i), "Error parsing command line.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<readOptionDouble4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    12f0 <readOptionDouble4+0x1c0>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12eb <readOptionDouble4+0x1bb>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    11c3 <readOptionDouble4+0x93>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atof@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11dc <readOptionDouble4+0xac>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe29(%rip),%rcx
call   1050 <clParseError@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1217 <readOptionDouble4+0xe7>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atof@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1230 <readOptionDouble4+0x100>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xdd5(%rip),%rcx
call   1050 <clParseError@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    126b <readOptionDouble4+0x13b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atof@plt>
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1284 <readOptionDouble4+0x154>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd81(%rip),%rcx
call   1050 <clParseError@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    12c6 <readOptionDouble4+0x196>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atof@plt>
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1310 <readOptionDouble4+0x1e0>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd26(%rip),%rcx
call   1050 <clParseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    1310 <readOptionDouble4+0x1e0>
jmp    1309 <readOptionDouble4+0x1d9>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd1a(%rip),%rcx
call   1050 <clParseError@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readOptionDouble4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
movslq (%rdx),%r14
cmp    %edi,%r14d
jge    1186 <readOptionDouble4+0x56>
mov    %r9,%rbx
mov    %r8,%r13
mov    %rdx,%r12
mov    (%r15,%r14,8),%rdi
mov    %rcx,%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
jne    119c <readOptionDouble4+0x6c>
mov    %rbx,(%rsp)
lea    0x1(%r14),%ebx
mov    %ebx,(%r12)
cmp    %ebp,%ebx
jge    11ad <readOptionDouble4+0x7d>
mov    0x8(%r15,%r14,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x0(%r13)
jmp    11c4 <readOptionDouble4+0x94>
lea    0xe91(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <clParseError@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe4c(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   1050 <clParseError@plt>
mov    (%r12),%ebx
add    $0x1,%ebx
mov    %ebx,(%r12)
cmp    %ebp,%ebx
jge    11e5 <readOptionDouble4+0xb5>
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
mov    (%rsp),%rax
movsd  %xmm0,(%rax)
jmp    11fc <readOptionDouble4+0xcc>
lea    0xe14(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   1050 <clParseError@plt>
mov    (%r12),%ebx
add    $0x1,%ebx
mov    %ebx,(%r12)
cmp    %ebp,%ebx
jge    121f <readOptionDouble4+0xef>
mov    0x40(%rsp),%r14
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%r14)
jmp    1236 <readOptionDouble4+0x106>
lea    0xdda(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   1050 <clParseError@plt>
mov    (%r12),%ebx
add    $0x1,%ebx
mov    %ebx,(%r12)
cmp    %ebp,%ebx
jge    1261 <readOptionDouble4+0x131>
mov    0x48(%rsp),%rbp
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x0(%rbp)
mov    $0x1,%ecx
jmp    119c <readOptionDouble4+0x6c>
lea    0xd98(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %ebx,%edx
jmp    1195 <readOptionDouble4+0x65>

LLVM IR (-O0):
@.str = [30 x i8] c"Option expects four arguments\00"
@.str.1 = [28 x i8] c"Error parsing command line.\00"
define i32 @readOptionDouble4(i32 %0, i8** %1, i32* %2, i8* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
store i32 %0, i32* %10
store i8** %1, i8*** %11
store i32* %2, i32** %12
store i8* %3, i8** %13
store double* %4, double** %14
store double* %5, double** %15
store double* %6, double** %16
store double* %7, double** %17
%18 = load i32*, i32** %12
%19 = load i32, i32* %18
%20 = load i32, i32* %10
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %126
22: ; preds = %8
%23 = load i8**, i8*** %11
%24 = load i32*, i32** %12
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
%28 = load i8*, i8** %27
%29 = load i8*, i8** %13
%30 = call i64 @strcasecmp(i8* %28, i8* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %125
32: ; preds = %22
%33 = load i32*, i32** %12
%34 = load i32, i32* %33
%35 = add nsw i32 %34, 1
store i32 %35, i32* %33
%36 = load i32*, i32** %12
%37 = load i32, i32* %36
%38 = load i32, i32* %10
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %49
40: ; preds = %32
%41 = load i8**, i8*** %11
%42 = load i32*, i32** %12
%43 = load i32, i32* %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %41, i64 %44
%46 = load i8*, i8** %45
%47 = call double @atof(i8* %46)
%48 = load double*, double** %14
store double %47, double* %48
br label %55
49: ; preds = %32
%50 = load i32, i32* %10
%51 = load i8**, i8*** %11
%52 = load i32*, i32** %12
%53 = load i32, i32* %52
%54 = call i32 @clParseError(i32 %50, i8** %51, i32 %53, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %55
55: ; preds = %49, %40
%56 = load i32*, i32** %12
%57 = load i32, i32* %56
%58 = add nsw i32 %57, 1
store i32 %58, i32* %56
%59 = load i32*, i32** %12
%60 = load i32, i32* %59
%61 = load i32, i32* %10
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %72
63: ; preds = %55
%64 = load i8**, i8*** %11
%65 = load i32*, i32** %12
%66 = load i32, i32* %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %64, i64 %67
%69 = load i8*, i8** %68
%70 = call double @atof(i8* %69)
%71 = load double*, double** %15
store double %70, double* %71
br label %78
72: ; preds = %55
%73 = load i32, i32* %10
%74 = load i8**, i8*** %11
%75 = load i32*, i32** %12
%76 = load i32, i32* %75
%77 = call i32 @clParseError(i32 %73, i8** %74, i32 %76, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %78
78: ; preds = %72, %63
%79 = load i32*, i32** %12
%80 = load i32, i32* %79
%81 = add nsw i32 %80, 1
store i32 %81, i32* %79
%82 = load i32*, i32** %12
%83 = load i32, i32* %82
%84 = load i32, i32* %10
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %95
86: ; preds = %78
%87 = load i8**, i8*** %11
%88 = load i32*, i32** %12
%89 = load i32, i32* %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %87, i64 %90
%92 = load i8*, i8** %91
%93 = call double @atof(i8* %92)
%94 = load double*, double** %16
store double %93, double* %94
br label %101
95: ; preds = %78
%96 = load i32, i32* %10
%97 = load i8**, i8*** %11
%98 = load i32*, i32** %12
%99 = load i32, i32* %98
%100 = call i32 @clParseError(i32 %96, i8** %97, i32 %99, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %101
101: ; preds = %95, %86
%102 = load i32*, i32** %12
%103 = load i32, i32* %102
%104 = add nsw i32 %103, 1
store i32 %104, i32* %102
%105 = load i32*, i32** %12
%106 = load i32, i32* %105
%107 = load i32, i32* %10
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %118
109: ; preds = %101
%110 = load i8**, i8*** %11
%111 = load i32*, i32** %12
%112 = load i32, i32* %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %110, i64 %113
%115 = load i8*, i8** %114
%116 = call double @atof(i8* %115)
%117 = load double*, double** %17
store double %116, double* %117
store i32 1, i32* %9
br label %133
118: ; preds = %101
%119 = load i32, i32* %10
%120 = load i8**, i8*** %11
%121 = load i32*, i32** %12
%122 = load i32, i32* %121
%123 = call i32 @clParseError(i32 %119, i8** %120, i32 %122, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %124
124: ; preds = %118
store i32 0, i32* %9
br label %133
125: ; preds = %22
br label %132
126: ; preds = %8
%127 = load i32, i32* %10
%128 = load i8**, i8*** %11
%129 = load i32*, i32** %12
%130 = load i32, i32* %129
%131 = call i32 @clParseError(i32 %127, i8** %128, i32 %130, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %132
132: ; preds = %126, %125
store i32 0, i32* %9
br label %133
133: ; preds = %132, %124, %109
%134 = load i32, i32* %9
ret i32 %134
}

LLVM IR (-O2):
@.str = [30 x i8] c"Option expects four arguments\00"
@.str.1 = [28 x i8] c"Error parsing command line.\00"
define i32 @readOptionDouble4(i32 %0, i8** %1, i32* nocapture %2, i8* nocapture %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double* nocapture writeonly %7) {
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %11, label %63
11: ; preds = %8
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i64 @strcasecmp(i8* %14, i8* %3)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %65
17: ; preds = %11
%18 = add nsw i32 %9, 1
store i32 %18, i32* %2
%19 = icmp slt i32 %18, %0
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = sext i32 %18 to i64
%22 = getelementptr inbounds i8*, i8** %1, i64 %21
%23 = load i8*, i8** %22
%24 = tail call double @atof(i8* %23)
store double %24, double* %4
br label %28
25: ; preds = %17
%26 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* %2
br label %28
28: ; preds = %25, %20
%29 = phi i32 [ %27, %25 ], [ %18, %20 ]
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
%31 = icmp slt i32 %30, %0
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = sext i32 %30 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
%36 = tail call double @atof(i8* %35)
store double %36, double* %5
br label %40
37: ; preds = %28
%38 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%39 = load i32, i32* %2
br label %40
40: ; preds = %37, %32
%41 = phi i32 [ %39, %37 ], [ %30, %32 ]
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
%43 = icmp slt i32 %42, %0
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = sext i32 %42 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = tail call double @atof(i8* %47)
store double %48, double* %6
br label %52
49: ; preds = %40
%50 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %42, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%51 = load i32, i32* %2
br label %52
52: ; preds = %49, %44
%53 = phi i32 [ %51, %49 ], [ %42, %44 ]
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
%55 = icmp slt i32 %54, %0
br i1 %55, label %56, label %61
56: ; preds = %52
%57 = sext i32 %54 to i64
%58 = getelementptr inbounds i8*, i8** %1, i64 %57
%59 = load i8*, i8** %58
%60 = tail call double @atof(i8* %59)
store double %60, double* %7
br label %65
61: ; preds = %52
%62 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %54, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %65
63: ; preds = %8
%64 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %65
65: ; preds = %63, %11, %61, %56
%66 = phi i32 [ 1, %56 ], [ 0, %61 ], [ 0, %11 ], [ 0, %63 ]
ret i32 %66
}