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


x86 assembly (clang, -O0):
<readOptionDouble4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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    12f3 <readOptionDouble4+0x1c3>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    12ee <readOptionDouble4+0x1be>
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    11c6 <readOptionDouble4+0x96>
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    11df <readOptionDouble4+0xaf>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe26(%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    121a <readOptionDouble4+0xea>
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    1233 <readOptionDouble4+0x103>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xdd2(%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    126e <readOptionDouble4+0x13e>
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    1287 <readOptionDouble4+0x157>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd7e(%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    12c9 <readOptionDouble4+0x199>
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    1313 <readOptionDouble4+0x1e3>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd23(%rip),%rcx
call   1050 <clParseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    1313 <readOptionDouble4+0x1e3>
jmp    130c <readOptionDouble4+0x1dc>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd17(%rip),%rcx
call   1050 <clParseError@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%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    1185 <readOptionDouble4+0x55>
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   %eax,%eax
jne    119b <readOptionDouble4+0x6b>
mov    %rbx,(%rsp)
lea    0x1(%r14),%ebx
mov    %ebx,(%r12)
cmp    %ebp,%ebx
jge    11ac <readOptionDouble4+0x7c>
mov    0x8(%r15,%r14,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x0(%r13)
jmp    11c3 <readOptionDouble4+0x93>
lea    0xe92(%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    0xe4d(%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    11e4 <readOptionDouble4+0xb4>
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
mov    (%rsp),%rax
movsd  %xmm0,(%rax)
jmp    11fb <readOptionDouble4+0xcb>
lea    0xe15(%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    121e <readOptionDouble4+0xee>
mov    0x40(%rsp),%r14
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%r14)
jmp    1235 <readOptionDouble4+0x105>
lea    0xddb(%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    1260 <readOptionDouble4+0x130>
mov    0x48(%rsp),%rbp
movslq %ebx,%rax
mov    (%r15,%rax,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x0(%rbp)
mov    $0x1,%ecx
jmp    119b <readOptionDouble4+0x6b>
lea    0xd99(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %ebx,%edx
jmp    1194 <readOptionDouble4+0x64>

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

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 i32 @strcasecmp(i8* %14, i8* %3)
%16 = icmp eq i32 %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
}