#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*/ Time_hmsl(long, int *, int *, int *, int *);
int Valid_time(long tm) {
  int h, m, s, l;
  Time_hmsl(tm, &h, &m, &s, &l);
  if (h < 0 || h >= 24)
    return 0;
  if (m < 0 || m >= 60)
    return 0;
  if (s < 0 || s >= 60)
    return 0;
  if (l < 0 || l >= 1000)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<Valid_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <Time_hmsl@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1149 <Valid_time+0x39>
cmpl   $0x18,-0x14(%rbp)
jl     1155 <Valid_time+0x45>
movl   $0x0,-0x4(%rbp)
jmp    11bf <Valid_time+0xaf>
cmpl   $0x0,-0x18(%rbp)
jl     1169 <Valid_time+0x59>
cmpl   $0x3c,-0x18(%rbp)
jl     1175 <Valid_time+0x65>
movl   $0x0,-0x4(%rbp)
jmp    11bf <Valid_time+0xaf>
cmpl   $0x0,-0x1c(%rbp)
jl     1189 <Valid_time+0x79>
cmpl   $0x3c,-0x1c(%rbp)
jl     1195 <Valid_time+0x85>
movl   $0x0,-0x4(%rbp)
jmp    11bf <Valid_time+0xaf>
cmpl   $0x0,-0x20(%rbp)
jl     11ac <Valid_time+0x9c>
cmpl   $0x3e8,-0x20(%rbp)
jl     11b8 <Valid_time+0xa8>
movl   $0x0,-0x4(%rbp)
jmp    11bf <Valid_time+0xaf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Valid_time>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <Time_hmsl@plt>
cmpl   $0x18,0x14(%rsp)
setb   %al
cmpl   $0x3c,0x10(%rsp)
setb   %cl
and    %al,%cl
cmpl   $0x3c,0xc(%rsp)
setb   %al
cmpl   $0x3e8,0x8(%rsp)
setb   %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Valid_time(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %3
%8 = load i64, i64* %3
%9 = call i32 @Time_hmsl(i64 %8, i32* %4, i32* %5, i32* %6, i32* %7)
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 24
br i1 %14, label %15, label %16
15: ; preds = %12, %1
store i32 0, i32* %2
br label %38
16: ; preds = %12
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 60
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 0, i32* %2
br label %38
23: ; preds = %19
%24 = load i32, i32* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %6
%28 = icmp sge i32 %27, 60
br i1 %28, label %29, label %30
29: ; preds = %26, %23
store i32 0, i32* %2
br label %38
30: ; preds = %26
%31 = load i32, i32* %7
%32 = icmp slt i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = load i32, i32* %7
%35 = icmp sge i32 %34, 1000
br i1 %35, label %36, label %37
36: ; preds = %33, %30
store i32 0, i32* %2
br label %38
37: ; preds = %33
store i32 1, i32* %2
br label %38
38: ; preds = %37, %36, %29, %22, %15
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @Valid_time(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @Time_hmsl(i64 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
%12 = icmp ult i32 %11, 24
%13 = load i32, i32* %3
%14 = icmp ult i32 %13, 60
%15 = select i1 %12, i1 %14, i1 false
%16 = load i32, i32* %4
%17 = icmp ult i32 %16, 60
%18 = select i1 %15, i1 %17, i1 false
%19 = load i32, i32* %5
%20 = icmp ult i32 %19, 1000
%21 = select i1 %18, i1 %20, i1 false
%22 = zext i1 %21 to i32
ret i32 %22
}