#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 */
scalar_t__ priceClose(int);
double priceHigh(int);
scalar_t__ priceLow(int);
double priceOpen(int);
int candle_marubozu_white(int idx) {
  double threshold = 0.1 * (priceHigh(idx) - priceLow(idx));
  if ((priceOpen(idx) < priceClose(idx)) &&
      (priceOpen(idx) > (priceHigh(idx) - threshold) &&
       priceClose(idx) < (priceLow(idx) + threshold)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<candle_marubozu_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <priceHigh@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <priceLow@plt>
movsd  -0x20(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <priceOpen@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <priceClose@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    1213 <candle_marubozu_white+0xd3>
mov    -0x8(%rbp),%edi
call   1060 <priceOpen@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <priceHigh@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1213 <candle_marubozu_white+0xd3>
mov    -0x8(%rbp),%edi
call   1030 <priceClose@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <priceLow@plt>
movsd  -0x30(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1213 <candle_marubozu_white+0xd3>
movl   $0x1,-0x4(%rbp)
jmp    121a <candle_marubozu_white+0xda>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<candle_marubozu_white>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
call   1040 <priceHigh@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
call   1050 <priceLow@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1060 <priceOpen@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <priceClose@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    1207 <candle_marubozu_white+0xc7>
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe60(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %ebx,%edi
call   1060 <priceOpen@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1040 <priceHigh@plt>
subsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1207 <candle_marubozu_white+0xc7>
mov    %ebx,%edi
call   1030 <priceClose@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1050 <priceLow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    $0x1,%eax
ucomisd 0x8(%rsp),%xmm1
ja     1209 <candle_marubozu_white+0xc9>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @candle_marubozu_white(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call double @priceHigh(i32 %5)
%7 = load i32, i32* %3
%8 = call i64 @priceLow(i32 %7)
%9 = sitofp i64 %8 to double
%10 = fsub double %6, %9
%11 = fmul double 1.000000e-01, %10
store double %11, double* %4
%12 = load i32, i32* %3
%13 = call double @priceOpen(i32 %12)
%14 = load i32, i32* %3
%15 = call i64 @priceClose(i32 %14)
%16 = sitofp i64 %15 to double
%17 = fcmp olt double %13, %16
br i1 %17, label %18, label %37
18: ; preds = %1
%19 = load i32, i32* %3
%20 = call double @priceOpen(i32 %19)
%21 = load i32, i32* %3
%22 = call double @priceHigh(i32 %21)
%23 = load double, double* %4
%24 = fsub double %22, %23
%25 = fcmp ogt double %20, %24
br i1 %25, label %26, label %37
26: ; preds = %18
%27 = load i32, i32* %3
%28 = call i64 @priceClose(i32 %27)
%29 = sitofp i64 %28 to double
%30 = load i32, i32* %3
%31 = call i64 @priceLow(i32 %30)
%32 = sitofp i64 %31 to double
%33 = load double, double* %4
%34 = fadd double %32, %33
%35 = fcmp olt double %29, %34
br i1 %35, label %36, label %37
36: ; preds = %26
store i32 1, i32* %2
br label %38
37: ; preds = %26, %18, %1
store i32 0, i32* %2
br label %38
38: ; preds = %37, %36
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @candle_marubozu_white(i32 %0) {
%2 = tail call double @priceHigh(i32 %0)
%3 = tail call i64 @priceLow(i32 %0)
%4 = sitofp i64 %3 to double
%5 = fsub double %2, %4
%6 = fmul double %5, 1.000000e-01
%7 = tail call double @priceOpen(i32 %0)
%8 = tail call i64 @priceClose(i32 %0)
%9 = sitofp i64 %8 to double
%10 = fcmp olt double %7, %9
br i1 %10, label %11, label %23
11: ; preds = %1
%12 = tail call double @priceOpen(i32 %0)
%13 = tail call double @priceHigh(i32 %0)
%14 = fsub double %13, %6
%15 = fcmp ogt double %12, %14
br i1 %15, label %16, label %23
16: ; preds = %11
%17 = tail call i64 @priceClose(i32 %0)
%18 = sitofp i64 %17 to double
%19 = tail call i64 @priceLow(i32 %0)
%20 = sitofp i64 %19 to double
%21 = fadd double %6, %20
%22 = fcmp ogt double %21, %18
br i1 %22, label %24, label %23
23: ; preds = %16, %11, %1
br label %24
24: ; preds = %16, %23
%25 = phi i32 [ 0, %23 ], [ 1, %16 ]
ret i32 %25
}