#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void main() {
  int hour, min, sec;
  printf("teclee  la hora como h:m:s \n");
  scanf("%d:%d:%d", &hour, &min, &sec);
  if (hour <= 24 && hour >= 0 && min <= 60 && min >= 0 && sec <= 60 && sec >= 0)
    printf("hora correcta\n");
  else
    printf("hora incorrecta\n");
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x18,-0x4(%rbp)
jg     1199 <main+0x79>
cmpl   $0x0,-0x4(%rbp)
jl     1199 <main+0x79>
cmpl   $0x3c,-0x8(%rbp)
jg     1199 <main+0x79>
cmpl   $0x0,-0x8(%rbp)
jl     1199 <main+0x79>
cmpl   $0x3c,-0xc(%rbp)
jg     1199 <main+0x79>
cmpl   $0x0,-0xc(%rbp)
jl     1199 <main+0x79>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <main+0x85>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
lea    0xedd(%rip),%rdi
lea    0xec6(%rip),%rcx
cmovs  %rcx,%rdi
cmp    $0x3d,%eax
cmovge %rcx,%rdi
mov    0x10(%rsp),%eax
test   %eax,%eax
cmovs  %rcx,%rdi
cmp    $0x3d,%eax
cmovge %rcx,%rdi
cmpl   $0x19,0x14(%rsp)
cmovae %rcx,%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"teclee la hora como h:m:s \0A\00"
@.str.1 = [9 x i8] c"%d:%d:%d\00"
@.str.2 = [15 x i8] c"hora correcta\0A\00"
@.str.3 = [17 x i8] c"hora incorrecta\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = icmp sle i32 %6, 24
br i1 %7, label %8, label %25
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 60
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 60
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %27
25: ; preds = %20, %17, %14, %11, %8, %0
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d:%d:%d\00"
@str = [28 x i8] c"teclee la hora como h:m:s \00"
@str.4 = [16 x i8] c"hora incorrecta\00"
@str.5 = [14 x i8] c"hora correcta\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = icmp ult i32 %9, 25
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 61
%13 = select i1 %10, i1 %12, i1 false
%14 = icmp sgt i32 %11, -1
%15 = select i1 %13, i1 %14, i1 false
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 61
%18 = select i1 %15, i1 %17, i1 false
%19 = icmp sgt i32 %16, -1
%20 = select i1 %18, i1 %19, i1 false
%21 = select i1 %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
ret void
}