#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_flush_interval(int intv) {
  if (intv <= 0) {
    syslog(LOG_ERR, "Flush interval cannot be negative!");
    return 1;
  } else if (intv >= 600) {
    syslog(LOG_WARNING,
           "Flushing set to be very infrequent! Increased risk of data loss.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<sane_flush_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1146 <sane_flush_interval+0x36>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    1174 <sane_flush_interval+0x64>
cmpl   $0x258,-0x8(%rbp)
jl     1168 <sane_flush_interval+0x58>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <syslog@plt>
jmp    116d <sane_flush_interval+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sane_flush_interval>:
push   %rbx
test   %edi,%edi
jle    112f <sane_flush_interval+0x1f>
xor    %ebx,%ebx
cmp    $0x258,%edi
jb     1149 <sane_flush_interval+0x39>
lea    0xefd(%rip),%rsi
mov    0x2ebb(%rip),%rax
jmp    1142 <sane_flush_interval+0x32>
mov    $0x1,%ebx
lea    0xec5(%rip),%rsi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <syslog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [35 x i8] c"Flush interval cannot be negative!\00"
@LOG_WARNING = global i32 0
@.str.1 = [65 x i8] c"Flushing set to be very infrequent! Increased risk of data loss.\00"
define i32 @sane_flush_interval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 600
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 ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15
store i32 0, i32* %2
br label %17
17: ; preds = %16, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [35 x i8] c"Flush interval cannot be negative!\00"
@LOG_WARNING = global i32 0
@.str.1 = [65 x i8] c"Flushing set to be very infrequent! Increased risk of data loss.\00"
define i32 @sane_flush_interval(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 599
br i1 %4, label %5, label %11
5: ; preds = %3, %1
%6 = phi i32* [ @LOG_ERR, %1 ], [ @LOG_WARNING, %3 ]
%7 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), %3 ]
%8 = phi i32 [ 1, %1 ], [ 0, %3 ]
%9 = load i32, i32* %6
%10 = tail call i32 @syslog(i32 %9, i8* %7)
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %8, %5 ]
ret i32 %12
}