#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 */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_WARNING;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int sane_timer_eps(double eps) {
  if (eps >= 0.5) {
    syslog(LOG_ERR, "Timer epsilon cannot be equal-to or greater than 0.5!");
    return 1;
  } else if (eps > 0.10) {
    syslog(LOG_WARNING, "Timer epsilon very high!");
  } else if (eps <= 0) {
    syslog(LOG_ERR, "Timer epsilon cannot less than or equal to 0!");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sane_timer_eps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1155 <sane_timer_eps+0x45>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <sane_timer_eps+0xb6>
movsd  -0x10(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1186 <sane_timer_eps+0x76>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <syslog@plt>
jmp    11ba <sane_timer_eps+0xaa>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11b5 <sane_timer_eps+0xa5>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <sane_timer_eps+0xb6>
jmp    11ba <sane_timer_eps+0xaa>
jmp    11bf <sane_timer_eps+0xaf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sane_timer_eps>:
push   %rbx
mov    $0x1,%ebx
mov    0x2eb3(%rip),%rcx
ucomisd 0xedb(%rip),%xmm0
jae    1143 <sane_timer_eps+0x33>
ucomisd 0xed9(%rip),%xmm0
jbe    114c <sane_timer_eps+0x3c>
xor    %ebx,%ebx
lea    0xf0c(%rip),%rsi
mov    0x2ea7(%rip),%rcx
jmp    115f <sane_timer_eps+0x4f>
lea    0xec6(%rip),%rsi
jmp    115f <sane_timer_eps+0x4f>
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jb     1168 <sane_timer_eps+0x58>
lea    0xf00(%rip),%rsi
mov    (%rcx),%edi
call   1030 <syslog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [54 x i8] c"Timer epsilon cannot be equal-to or greater than 0.5!\00"
@LOG_WARNING = global i32 0
@.str.1 = [25 x i8] c"Timer epsilon very high!\00"
@.str.2 = [46 x i8] c"Timer epsilon cannot less than or equal to 0!\00"
define i32 @sane_timer_eps(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 5.000000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @LOG_ERR
%8 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %24
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 1.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @LOG_WARNING
%14 = call i32 @syslog(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %22
15: ; preds = %9
%16 = load double, double* %3
%17 = fcmp ole double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* @LOG_ERR
%20 = call i32 @syslog(i32 %19, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %24
21: ; preds = %15
br label %22
22: ; preds = %21, %12
br label %23
23: ; preds = %22
store i32 0, i32* %2
br label %24
24: ; preds = %23, %18, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [54 x i8] c"Timer epsilon cannot be equal-to or greater than 0.5!\00"
@LOG_WARNING = global i32 0
@.str.1 = [25 x i8] c"Timer epsilon very high!\00"
@.str.2 = [46 x i8] c"Timer epsilon cannot less than or equal to 0!\00"
define i32 @sane_timer_eps(double %0) {
%2 = fcmp ult double %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fcmp ogt double %0, 1.000000e-01
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fcmp ugt double %0, 0.000000e+00
br i1 %6, label %13, label %7
7: ; preds = %5, %3, %1
%8 = phi i32* [ @LOG_ERR, %1 ], [ @LOG_WARNING, %3 ], [ @LOG_ERR, %5 ]
%9 = phi i8* [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), %5 ]
%10 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %5 ]
%11 = load i32, i32* %8
%12 = tail call i32 @syslog(i32 %11, i8* %9)
br label %13
13: ; preds = %7, %5
%14 = phi i32 [ 0, %5 ], [ %10, %7 ]
ret i32 %14
}