#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 log(int);
int /*<<< orphan*/ printf(char *);
double iacum_exp(double F, double lambda) {
  if (F >= 0 && F <= 1.0)
    return -log(1 - F) / lambda;
  else {
    printf("what!\n");
    return -1.0;
  }
}


x86 assembly (clang, -O0):
<iacum_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1193 <iacum_exp+0x73>
movsd  0xeb4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1193 <iacum_exp+0x73>
movsd  0xea1(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ac <iacum_exp+0x8c>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iacum_exp>:
push   %rax
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     115a <iacum_exp+0x3a>
movsd  0xecd(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     115a <iacum_exp+0x3a>
subsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
xorpd  0xebd(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe9a(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"what!\0A\00"
define double @iacum_exp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp ole double %9, 1.000000e+00
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load double, double* %4
%13 = fsub double 1.000000e+00, %12
%14 = fptosi double %13 to i32
%15 = call double @log(i32 %14)
%16 = fneg double %15
%17 = load double, double* %5
%18 = fdiv double %16, %17
store double %18, double* %3
br label %21
19: ; preds = %8, %2
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store double -1.000000e+00, double* %3
br label %21
21: ; preds = %19, %11
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
@str = [6 x i8] c"what!\00"
define double @iacum_exp(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fcmp ole double %0, 1.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = fsub double 1.000000e+00, %0
%8 = fptosi double %7 to i32
%9 = tail call double @log(i32 %8)
%10 = fneg double %9
%11 = fdiv double %10, %1
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
%15 = phi double [ %11, %6 ], [ -1.000000e+00, %12 ]
ret double %15
}