int main(int argc, char *argv[]) {
  double stocks[] = {
      9.20, 8.03, 10.02, 8.08, 8.14, 8.10, 8.31, 8.28, 8.35, 8.34, 8.39, 8.45,
      8.38, 8.38, 8.32,  8.36, 8.28, 8.28, 8.38, 8.48, 8.49, 8.54, 8.73, 8.72,
      8.76, 8.74, 8.87,  8.82, 8.81, 8.82, 8.85, 8.85, 8.86, 8.63, 8.70, 8.68,
      8.72, 8.77, 8.69,  8.65, 8.70, 8.98, 8.98, 8.87, 8.71, 9.17, 9.34, 9.28,
      8.98, 9.02, 9.16,  9.15, 9.07, 9.14, 9.13, 9.10, 9.16, 9.06, 9.10, 9.15,
      9.11, 8.72, 8.86,  8.83, 8.70, 8.69, 8.73, 8.73, 8.67, 8.70, 8.69, 8.81,
      8.82, 8.83, 8.91,  8.80, 8.97, 8.86, 8.81, 8.87, 8.82, 8.78, 8.82, 8.77,
      8.54, 8.32, 8.33,  8.32, 8.51, 8.53, 8.52, 8.41, 8.55, 8.31, 8.38, 8.34,
      8.34, 8.19, 8.17,  8.16};
  int length = sizeof(stocks) / sizeof(double), i, bool;
  double buy = stocks[0], sell;
  for (i = 1; i < length; i++) {
    if (buy > stocks[i] && bool) {
      buy = stocks[i];
      sell = stocks[i += 2];
      bool = 0;
    } else if (sell < stocks[i] && !bool) {
      sell = stocks[i];
    }
  }
  printf("%.6g %.6g\n", buy, sell);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x330(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x320,%edx
call   1040 <memcpy@plt>
movl   $0x64,-0x334(%rbp)
movsd  -0x330(%rbp),%xmm0
ff
movsd  %xmm0,-0x348(%rbp)
ff
movl   $0x1,-0x338(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x334(%rbp),%eax
jge    1260 <main+0x140>
movsd  -0x348(%rbp),%xmm0
ff
movslq -0x338(%rbp),%rax
ucomisd -0x330(%rbp,%rax,8),%xmm0
ff ff
jbe    11fb <main+0xdb>
cmpl   $0x0,-0x33c(%rbp)
je     11fb <main+0xdb>
movslq -0x338(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x348(%rbp)
ff
mov    -0x338(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x338(%rbp)
cltq
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x350(%rbp)
ff
movl   $0x0,-0x33c(%rbp)
jmp    1247 <main+0x127>
movsd  -0x350(%rbp),%xmm1
ff
movslq -0x338(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
ucomisd %xmm1,%xmm0
jbe    1242 <main+0x122>
cmpl   $0x0,-0x33c(%rbp)
jne    1242 <main+0x122>
movslq -0x338(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x350(%rbp)
ff
jmp    1247 <main+0x127>
jmp    124c <main+0x12c>
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    1175 <main+0x55>
movsd  -0x348(%rbp),%xmm0
ff
movsd  -0x350(%rbp),%xmm1
ff
lea    0x10a9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%eax
lea    0xef3(%rip),%rcx
nopl   (%rax)
movsd  -0x10(%rcx,%rax,8),%xmm0
maxsd  %xmm1,%xmm0
movsd  -0x8(%rcx,%rax,8),%xmm2
maxsd  %xmm0,%xmm2
movsd  (%rcx,%rax,8),%xmm1
maxsd  %xmm2,%xmm1
add    $0x3,%rax
cmp    $0x66,%rax
jne    1120 <main+0x10>
lea    0x11e2(%rip),%rdi
movsd  0xeaa(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.stocks = [100 x double] [double 0x4022666666666666, double 8.030000e+00, double 1.002000e+01, double 8.080000e+00, double 8.140000e+00, double 8.100000e+00, double 8.310000e+00, double 8.280000e+00, double 8.350000e+00, double 0x4020AE147AE147AE, double 8.390000e+00, double 0x4020E66666666666, double 8.380000e+00, double 8.380000e+00, double 8.320000e+00, double 8.360000e+00, double 8.280000e+00, double 8.280000e+00, double 8.380000e+00, double 8.480000e+00, double 8.490000e+00, double 0x4021147AE147AE14, double 8.730000e+00, double 8.720000e+00, double 8.760000e+00, double 8.740000e+00, double 8.870000e+00, double 8.820000e+00, double 8.810000e+00, double 8.820000e+00, double 8.850000e+00, double 8.850000e+00, double 8.860000e+00, double 8.630000e+00, double 0x4021666666666666, double 0x40215C28F5C28F5C, double 8.720000e+00, double 0x40218A3D70A3D70A, double 8.690000e+00, double 8.650000e+00, double 0x4021666666666666, double 8.980000e+00, double 8.980000e+00, double 8.870000e+00, double 8.710000e+00, double 9.170000e+00, double 0x4022AE147AE147AE, double 9.280000e+00, double 8.980000e+00, double 0x40220A3D70A3D70A, double 9.160000e+00, double 9.150000e+00, double 9.070000e+00, double 9.140000e+00, double 9.130000e+00, double 9.100000e+00, double 9.160000e+00, double 9.060000e+00, double 9.100000e+00, double 9.150000e+00, double 9.110000e+00, double 8.720000e+00, double 8.860000e+00, double 8.830000e+00, double 0x4021666666666666, double 8.690000e+00, double 8.730000e+00, double 8.730000e+00, double 8.670000e+00, double 0x4021666666666666, double 8.690000e+00, double 8.810000e+00, double 8.820000e+00, double 8.830000e+00, double 8.910000e+00, double 8.800000e+00, double 8.970000e+00, double 8.860000e+00, double 8.810000e+00, double 8.870000e+00, double 8.820000e+00, double 8.780000e+00, double 8.820000e+00, double 0x40218A3D70A3D70A, double 0x4021147AE147AE14, double 8.320000e+00, double 8.330000e+00, double 8.320000e+00, double 8.510000e+00, double 8.530000e+00, double 0x40210A3D70A3D70A, double 8.410000e+00, double 8.550000e+00, double 8.310000e+00, double 8.380000e+00, double 0x4020AE147AE147AE, double 0x4020AE147AE147AE, double 8.190000e+00, double 8.170000e+00, double 8.160000e+00]
@.str = [11 x i8] c"%.6g %.6g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x double]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [100 x double]* %6 to i8*
store i32 100, i32* %7
%13 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 0
%14 = load double, double* %13
store double %14, double* %10
store i32 1, i32* %8
br label %15
15: ; preds = %56, %2
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %59
19: ; preds = %15
%20 = load double, double* %10
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %22
%24 = load double, double* %23
%25 = fcmp ogt double %20, %24
br i1 %25, label %26, label %39
26: ; preds = %19
%27 = load i32, i32* %9
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %39
29: ; preds = %26
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %31
%33 = load double, double* %32
store double %33, double* %10
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 2
store i32 %35, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %36
%38 = load double, double* %37
store double %38, double* %11
store i32 0, i32* %9
br label %55
39: ; preds = %26, %19
%40 = load double, double* %11
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %42
%44 = load double, double* %43
%45 = fcmp olt double %40, %44
br i1 %45, label %46, label %54
46: ; preds = %39
%47 = load i32, i32* %9
%48 = icmp ne i32 %47, 0
br i1 %48, label %54, label %49
49: ; preds = %46
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %51
%53 = load double, double* %52
store double %53, double* %11
br label %54
54: ; preds = %49, %46, %39
br label %55
55: ; preds = %54, %29
br label %56
56: ; preds = %55
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %15
59: ; preds = %15
%60 = load double, double* %10
%61 = load double, double* %11
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %60, double %61)
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@__const.main.stocks = [100 x double] [double 0x4022666666666666, double 8.030000e+00, double 1.002000e+01, double 8.080000e+00, double 8.140000e+00, double 8.100000e+00, double 8.310000e+00, double 8.280000e+00, double 8.350000e+00, double 0x4020AE147AE147AE, double 8.390000e+00, double 0x4020E66666666666, double 8.380000e+00, double 8.380000e+00, double 8.320000e+00, double 8.360000e+00, double 8.280000e+00, double 8.280000e+00, double 8.380000e+00, double 8.480000e+00, double 8.490000e+00, double 0x4021147AE147AE14, double 8.730000e+00, double 8.720000e+00, double 8.760000e+00, double 8.740000e+00, double 8.870000e+00, double 8.820000e+00, double 8.810000e+00, double 8.820000e+00, double 8.850000e+00, double 8.850000e+00, double 8.860000e+00, double 8.630000e+00, double 0x4021666666666666, double 0x40215C28F5C28F5C, double 8.720000e+00, double 0x40218A3D70A3D70A, double 8.690000e+00, double 8.650000e+00, double 0x4021666666666666, double 8.980000e+00, double 8.980000e+00, double 8.870000e+00, double 8.710000e+00, double 9.170000e+00, double 0x4022AE147AE147AE, double 9.280000e+00, double 8.980000e+00, double 0x40220A3D70A3D70A, double 9.160000e+00, double 9.150000e+00, double 9.070000e+00, double 9.140000e+00, double 9.130000e+00, double 9.100000e+00, double 9.160000e+00, double 9.060000e+00, double 9.100000e+00, double 9.150000e+00, double 9.110000e+00, double 8.720000e+00, double 8.860000e+00, double 8.830000e+00, double 0x4021666666666666, double 8.690000e+00, double 8.730000e+00, double 8.730000e+00, double 8.670000e+00, double 0x4021666666666666, double 8.690000e+00, double 8.810000e+00, double 8.820000e+00, double 8.830000e+00, double 8.910000e+00, double 8.800000e+00, double 8.970000e+00, double 8.860000e+00, double 8.810000e+00, double 8.870000e+00, double 8.820000e+00, double 8.780000e+00, double 8.820000e+00, double 0x40218A3D70A3D70A, double 0x4021147AE147AE14, double 8.320000e+00, double 8.330000e+00, double 8.320000e+00, double 8.510000e+00, double 8.530000e+00, double 0x40210A3D70A3D70A, double 8.410000e+00, double 8.550000e+00, double 8.310000e+00, double 8.380000e+00, double 0x4020AE147AE147AE, double 0x4020AE147AE147AE, double 8.190000e+00, double 8.170000e+00, double 8.160000e+00]
@.str = [11 x i8] c"%.6g %.6g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 1, %2 ], [ %20, %3 ]
%5 = phi double [ undef, %2 ], [ %19, %3 ]
%6 = getelementptr inbounds [100 x double], [100 x double]* @__const.main.stocks, i64 0, i64 %4
%7 = load double, double* %6
%8 = fcmp olt double %5, %7
%9 = select i1 %8, double %7, double %5
%10 = add nuw nsw i64 %4, 1
%11 = getelementptr inbounds [100 x double], [100 x double]* @__const.main.stocks, i64 0, i64 %10
%12 = load double, double* %11
%13 = fcmp olt double %9, %12
%14 = select i1 %13, double %12, double %9
%15 = add nuw nsw i64 %4, 2
%16 = getelementptr inbounds [100 x double], [100 x double]* @__const.main.stocks, i64 0, i64 %15
%17 = load double, double* %16
%18 = fcmp olt double %14, %17
%19 = select i1 %18, double %17, double %14
%20 = add nuw nsw i64 %4, 3
%21 = icmp eq i64 %20, 100
br i1 %21, label %22, label %3
22: ; preds = %3
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double 0x4022666666666666, double %19)
ret i32 0
}