#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 */
struct tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
};

/* Variables and functions */
int tmSaneValues(struct tm *tm) {
  if (tm->tm_sec < 0 || tm->tm_sec > 59)
    return 0;
  if (tm->tm_min < 0 || tm->tm_min > 59)
    return 0;
  if (tm->tm_hour < 0 || tm->tm_hour > 23)
    return 0;
  if (tm->tm_mday < 1 || tm->tm_mday > 31)
    return 0;
  if (tm->tm_mon < 0 || tm->tm_mon > 11)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<tmSaneValues>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1122 <tmSaneValues+0x22>
mov    -0x10(%rbp),%rax
cmpl   $0x3b,(%rax)
jle    112e <tmSaneValues+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    11d5 <tmSaneValues+0xd5>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jl     114a <tmSaneValues+0x4a>
mov    -0x10(%rbp),%rax
cmpl   $0x3b,0x4(%rax)
jle    1156 <tmSaneValues+0x56>
movl   $0x0,-0x4(%rbp)
jmp    11d5 <tmSaneValues+0xd5>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jl     1172 <tmSaneValues+0x72>
mov    -0x10(%rbp),%rax
cmpl   $0x17,0x8(%rax)
jle    117e <tmSaneValues+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    11d5 <tmSaneValues+0xd5>
mov    -0x10(%rbp),%rax
cmpl   $0x1,0xc(%rax)
jl     119a <tmSaneValues+0x9a>
mov    -0x10(%rbp),%rax
cmpl   $0x1f,0xc(%rax)
jle    11a6 <tmSaneValues+0xa6>
movl   $0x0,-0x4(%rbp)
jmp    11d5 <tmSaneValues+0xd5>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x10(%rax)
jl     11c2 <tmSaneValues+0xc2>
mov    -0x10(%rbp),%rax
cmpl   $0xb,0x10(%rax)
jle    11ce <tmSaneValues+0xce>
movl   $0x0,-0x4(%rbp)
jmp    11d5 <tmSaneValues+0xd5>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmSaneValues>:
xor    %eax,%eax
cmpl   $0x3b,(%rdi)
ja     1127 <tmSaneValues+0x27>
cmpl   $0x3b,0x4(%rdi)
ja     1127 <tmSaneValues+0x27>
cmpl   $0x17,0x8(%rdi)
ja     1127 <tmSaneValues+0x27>
mov    0xc(%rdi),%ecx
add    $0xffffffe0,%ecx
cmp    $0xffffffe1,%ecx
jb     1127 <tmSaneValues+0x27>
xor    %eax,%eax
cmpl   $0xc,0x10(%rdi)
setb   %al
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32 }
define i32 @tmSaneValues(%struct.tm* %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = load %struct.tm*, %struct.tm** %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load %struct.tm*, %struct.tm** %3
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 59
br i1 %12, label %13, label %14
13: ; preds = %8, %1
store i32 0, i32* %2
br label %59
14: ; preds = %8
%15 = load %struct.tm*, %struct.tm** %3
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = icmp slt i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load %struct.tm*, %struct.tm** %3
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 59
br i1 %23, label %24, label %25
24: ; preds = %19, %14
store i32 0, i32* %2
br label %59
25: ; preds = %19
%26 = load %struct.tm*, %struct.tm** %3
%27 = getelementptr inbounds %struct.tm, %struct.tm* %26, i32 0, i32 2
%28 = load i32, i32* %27
%29 = icmp slt i32 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = load %struct.tm*, %struct.tm** %3
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 2
%33 = load i32, i32* %32
%34 = icmp sgt i32 %33, 23
br i1 %34, label %35, label %36
35: ; preds = %30, %25
store i32 0, i32* %2
br label %59
36: ; preds = %30
%37 = load %struct.tm*, %struct.tm** %3
%38 = getelementptr inbounds %struct.tm, %struct.tm* %37, i32 0, i32 3
%39 = load i32, i32* %38
%40 = icmp slt i32 %39, 1
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = load %struct.tm*, %struct.tm** %3
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 3
%44 = load i32, i32* %43
%45 = icmp sgt i32 %44, 31
br i1 %45, label %46, label %47
46: ; preds = %41, %36
store i32 0, i32* %2
br label %59
47: ; preds = %41
%48 = load %struct.tm*, %struct.tm** %3
%49 = getelementptr inbounds %struct.tm, %struct.tm* %48, i32 0, i32 4
%50 = load i32, i32* %49
%51 = icmp slt i32 %50, 0
br i1 %51, label %57, label %52
52: ; preds = %47
%53 = load %struct.tm*, %struct.tm** %3
%54 = getelementptr inbounds %struct.tm, %struct.tm* %53, i32 0, i32 4
%55 = load i32, i32* %54
%56 = icmp sgt i32 %55, 11
br i1 %56, label %57, label %58
57: ; preds = %52, %47
store i32 0, i32* %2
br label %59
58: ; preds = %52
store i32 1, i32* %2
br label %59
59: ; preds = %58, %57, %46, %35, %24, %13
%60 = load i32, i32* %2
ret i32 %60
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32 }
define i32 @tmSaneValues(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 59
br i1 %4, label %23, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = icmp ugt i32 %7, 59
br i1 %8, label %23, label %9
9: ; preds = %5
%10 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%11 = load i32, i32* %10
%12 = icmp ugt i32 %11, 23
br i1 %12, label %23, label %13
13: ; preds = %9
%14 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%15 = load i32, i32* %14
%16 = add i32 %15, -32
%17 = icmp ult i32 %16, -31
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%20 = load i32, i32* %19
%21 = icmp ult i32 %20, 12
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %18, %13, %9, %5, %1
%24 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 0, %9 ], [ 0, %13 ], [ %22, %18 ]
ret i32 %24
}