#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 */
scalar_t__ iTestStrDecimal(unsigned char *, int);
scalar_t__ memcmp(unsigned char *, char *, int);
int strlen(unsigned char *);
int iTestIfValidTime(unsigned char *pszTime) {
  if (strlen(pszTime) != 6)
    return (1);
  if (iTestStrDecimal(pszTime, 6) != 0)
    return (1);
  if (memcmp(pszTime, "23", 2) > 0)
    return (1);
  if (memcmp(pszTime + 2, "59", 2) > 0)
    return (1);
  if (memcmp(pszTime + 4, "59", 2) > 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iTestIfValidTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
je     115a <iTestIfValidTime+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    120e <iTestIfValidTime+0xde>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1050 <iTestStrDecimal@plt>
cmp    $0x0,%rax
je     117e <iTestIfValidTime+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    120e <iTestIfValidTime+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
jle    11a9 <iTestIfValidTime+0x79>
movl   $0x1,-0x4(%rbp)
jmp    120e <iTestIfValidTime+0xde>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
lea    0xe4b(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
jle    11d8 <iTestIfValidTime+0xa8>
movl   $0x1,-0x4(%rbp)
jmp    120e <iTestIfValidTime+0xde>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    0xe1c(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
jle    1207 <iTestIfValidTime+0xd7>
movl   $0x1,-0x4(%rbp)
jmp    120e <iTestIfValidTime+0xde>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iTestIfValidTime>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%ebp
cmp    $0x6,%eax
jne    11ab <iTestIfValidTime+0x7b>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <iTestStrDecimal@plt>
test   %rax,%rax
jne    11ab <iTestIfValidTime+0x7b>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jg     11ab <iTestIfValidTime+0x7b>
lea    0x2(%rbx),%rdi
lea    0xe88(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jg     11ab <iTestIfValidTime+0x7b>
add    $0x4,%rbx
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
setg   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"23\00"
@.str.1 = [3 x i8] c"59\00"
define i32 @iTestIfValidTime(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp ne i32 %5, 6
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %31
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @iTestStrDecimal(i8* %9, i32 6)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %31
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @memcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%16 = icmp sgt i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %31
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = call i64 @memcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%22 = icmp sgt i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %2
br label %31
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 4
%27 = call i64 @memcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%28 = icmp sgt i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 1, i32* %2
br label %31
30: ; preds = %24
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %23, %17, %12, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"23\00"
@.str.1 = [3 x i8] c"59\00"
define i32 @iTestIfValidTime(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %19
4: ; preds = %1
%5 = tail call i64 @iTestStrDecimal(i8* %0, i32 6)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = tail call i64 @memcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %0, i64 4
%16 = tail call i64 @memcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%17 = icmp sgt i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %14, %10, %7, %4, %1
%20 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ %18, %14 ]
ret i32 %20
}