#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 atoi(char *);
int /*<<< orphan*/ isNumber(char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
int isTime(char *sTime) {
  if (!sTime || strlen(sTime) != 6)
    return 0;
  char sBuffer[5];
  int iValue;
  if (!isNumber(sTime))
    return 0;
  memcpy(sBuffer, sTime, 2);
  sBuffer[2] = 0;
  iValue = atoi(sBuffer);
  if (!(iValue >= 0 && iValue <= 23))
    return 0;
  memcpy(sBuffer, &sTime[2], 2);
  sBuffer[2] = 0;
  iValue = atoi(sBuffer);
  if (!(iValue >= 0 && iValue <= 59))
    return 0;
  memcpy(sBuffer, &sTime[4], 2);
  sBuffer[2] = 0;
  iValue = atoi(sBuffer);
  if (!(iValue >= 0 && iValue <= 59))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <isTime+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
je     1175 <isTime+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1268 <isTime+0x128>
mov    -0x10(%rbp),%rdi
call   1040 <isNumber@plt>
cmp    $0x0,%eax
jne    1193 <isTime+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1268 <isTime+0x128>
lea    -0x15(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,-0x13(%rbp)
lea    -0x15(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     11c9 <isTime+0x89>
cmpl   $0x17,-0x1c(%rbp)
jle    11d5 <isTime+0x95>
movl   $0x0,-0x4(%rbp)
jmp    1268 <isTime+0x128>
lea    -0x15(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,-0x13(%rbp)
lea    -0x15(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     120f <isTime+0xcf>
cmpl   $0x3b,-0x1c(%rbp)
jle    121b <isTime+0xdb>
movl   $0x0,-0x4(%rbp)
jmp    1268 <isTime+0x128>
lea    -0x15(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,-0x13(%rbp)
lea    -0x15(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1255 <isTime+0x115>
cmpl   $0x3b,-0x1c(%rbp)
jle    1261 <isTime+0x121>
movl   $0x0,-0x4(%rbp)
jmp    1268 <isTime+0x128>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTime>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebp,%ebp
test   %rdi,%rdi
je     11f0 <isTime+0xb0>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x6,%eax
jne    11f0 <isTime+0xb0>
mov    %rbx,%rdi
call   1040 <isNumber@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     11f0 <isTime+0xb0>
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,0xd(%rsp)
mov    %r14,%rdi
call   1060 <atoi@plt>
cmp    $0x17,%eax
ja     11f0 <isTime+0xb0>
lea    0x2(%rbx),%rsi
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,0xd(%rsp)
mov    %r14,%rdi
call   1060 <atoi@plt>
cmp    $0x3b,%eax
ja     11f0 <isTime+0xb0>
add    $0x4,%rbx
lea    0xb(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movb   $0x0,0xd(%rsp)
mov    %rbp,%rdi
call   1060 <atoi@plt>
xor    %ebp,%ebp
cmp    $0x3c,%eax
setb   %bpl
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isTime(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = icmp ne i32 %10, 6
br i1 %11, label %12, label %13
12: ; preds = %8, %1
store i32 0, i32* %2
br label %60
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @isNumber(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 0, i32* %2
br label %60
18: ; preds = %13
%19 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = call i32 @memcpy(i8* %19, i8* %20, i32 2)
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 2
store i8 0, i8* %22
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %18
%28 = load i32, i32* %5
%29 = icmp sle i32 %28, 23
br i1 %29, label %31, label %30
30: ; preds = %27, %18
store i32 0, i32* %2
br label %60
31: ; preds = %27
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = call i32 @memcpy(i8* %32, i8* %34, i32 2)
%36 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 2
store i8 0, i8* %36
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %5
%39 = load i32, i32* %5
%40 = icmp sge i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %31
%42 = load i32, i32* %5
%43 = icmp sle i32 %42, 59
br i1 %43, label %45, label %44
44: ; preds = %41, %31
store i32 0, i32* %2
br label %60
45: ; preds = %41
%46 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 4
%49 = call i32 @memcpy(i8* %46, i8* %48, i32 2)
%50 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 2
store i8 0, i8* %50
%51 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%52 = call i32 @atoi(i8* %51)
store i32 %52, i32* %5
%53 = load i32, i32* %5
%54 = icmp sge i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %45
%56 = load i32, i32* %5
%57 = icmp sle i32 %56, 59
br i1 %57, label %59, label %58
58: ; preds = %55, %45
store i32 0, i32* %2
br label %60
59: ; preds = %55
store i32 1, i32* %2
br label %60
60: ; preds = %59, %58, %44, %30, %17, %12
%61 = load i32, i32* %2
ret i32 %61
}

LLVM IR (-O2):
define i32 @isTime(i8* %0) {
%2 = alloca [5 x i8]
%3 = icmp eq i8* %0, null
br i1 %3, label %29, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %29
7: ; preds = %4
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%9 = tail call i32 @isNumber(i8* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = call i32 @memcpy(i8* %8, i8* %0, i32 2)
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
store i8 0, i8* %13
%14 = call i32 @atoi(i8* %8)
%15 = icmp ult i32 %14, 24
br i1 %15, label %16, label %27
16: ; preds = %11
%17 = getelementptr inbounds i8, i8* %0, i64 2
%18 = call i32 @memcpy(i8* %8, i8* %17, i32 2)
store i8 0, i8* %13
%19 = call i32 @atoi(i8* %8)
%20 = icmp ult i32 %19, 60
br i1 %20, label %21, label %27
21: ; preds = %16
%22 = getelementptr inbounds i8, i8* %0, i64 4
%23 = call i32 @memcpy(i8* %8, i8* %22, i32 2)
store i8 0, i8* %13
%24 = call i32 @atoi(i8* %8)
%25 = icmp ult i32 %24, 60
%26 = zext i1 %25 to i32
br label %27
27: ; preds = %21, %16, %11, %7
%28 = phi i32 [ 0, %7 ], [ 0, %11 ], [ 0, %16 ], [ %26, %21 ]
br label %29
29: ; preds = %1, %4, %27
%30 = phi i32 [ %28, %27 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %30
}