#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__ Match(char *, char **);
int Number(char **);
int RdTime(char c, char **p) {
  char *start = ++(*p), *sec;
  if (Number(p) == (-2000000000))
    return 0;
  sec = *p;
  if (Match(":", p) && Number(p) != (-2000000000) && *p - sec == 3) {
    sec = *p;
    if (Match(".", p) && Number(p) != (-2000000000) && *(*p)++ == c)
      return 1;
    *p = sec;
    if (*(*p)++ == c)
      return 1;
  }
  *p = start;
  return 0;
}


x86 assembly (clang, -O0):
<RdTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
add    $0x1,%rax
mov    %rax,(%rcx)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Number@plt>
cmp    $0x88ca6c00,%eax
jne    1164 <RdTime+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1268 <RdTime+0x148>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <Match@plt>
cmp    $0x0,%rax
je     1256 <RdTime+0x136>
mov    -0x10(%rbp),%rdi
call   1040 <Number@plt>
cmp    $0x88ca6c00,%eax
je     1256 <RdTime+0x136>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x3,%rax
jne    1256 <RdTime+0x136>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe37(%rip),%rdi
call   1030 <Match@plt>
cmp    $0x0,%rax
je     121a <RdTime+0xfa>
mov    -0x10(%rbp),%rdi
call   1040 <Number@plt>
cmp    $0x88ca6c00,%eax
je     121a <RdTime+0xfa>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    121a <RdTime+0xfa>
movl   $0x1,-0x4(%rbp)
jmp    1268 <RdTime+0x148>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1251 <RdTime+0x131>
movl   $0x1,-0x4(%rbp)
jmp    1268 <RdTime+0x148>
jmp    1256 <RdTime+0x136>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdTime>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    (%rsi),%rbp
add    $0x1,%rbp
mov    %rbp,(%rsi)
mov    %rsi,%rdi
call   1040 <Number@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x88ca6c00,%ecx
je     11d2 <RdTime+0xb2>
mov    (%rbx),%r12
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <Match@plt>
test   %rax,%rax
je     11cd <RdTime+0xad>
mov    %rbx,%rdi
call   1040 <Number@plt>
cmp    $0x88ca6c00,%eax
je     11cd <RdTime+0xad>
mov    (%rbx),%r15
mov    %r15,%rax
sub    %r12,%rax
cmp    $0x3,%rax
jne    11cd <RdTime+0xad>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
call   1030 <Match@plt>
test   %rax,%rax
je     11bc <RdTime+0x9c>
mov    %rbx,%rdi
call   1040 <Number@plt>
cmp    $0x88ca6c00,%eax
je     11bc <RdTime+0x9c>
mov    (%rbx),%rcx
lea    0x1(%rcx),%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
cmp    %r14b,(%rcx)
je     11d2 <RdTime+0xb2>
lea    0x1(%r15),%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
cmp    %r14b,(%r15)
je     11d2 <RdTime+0xb2>
mov    %rbp,(%rbx)
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c".\00"
define i32 @RdTime(i8 signext %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i8 %0, i8* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
store i8* %10, i8** %6
%11 = load i8**, i8*** %5
%12 = call i32 @Number(i8** %11)
%13 = icmp eq i32 %12, -2000000000
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %69
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
store i8* %17, i8** %7
%18 = load i8**, i8*** %5
%19 = call i64 @Match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %66
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = call i32 @Number(i8** %22)
%24 = icmp ne i32 %23, -2000000000
br i1 %24, label %25, label %66
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = load i8*, i8** %7
%29 = ptrtoint i8* %27 to i64
%30 = ptrtoint i8* %28 to i64
%31 = sub i64 %29, %30
%32 = icmp eq i64 %31, 3
br i1 %32, label %33, label %66
33: ; preds = %25
%34 = load i8**, i8*** %5
%35 = load i8*, i8** %34
store i8* %35, i8** %7
%36 = load i8**, i8*** %5
%37 = call i64 @Match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %53
39: ; preds = %33
%40 = load i8**, i8*** %5
%41 = call i32 @Number(i8** %40)
%42 = icmp ne i32 %41, -2000000000
br i1 %42, label %43, label %53
43: ; preds = %39
%44 = load i8**, i8*** %5
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %44
%47 = load i8, i8* %45
%48 = sext i8 %47 to i32
%49 = load i8, i8* %4
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %48, %50
br i1 %51, label %52, label %53
52: ; preds = %43
store i32 1, i32* %3
br label %69
53: ; preds = %43, %39, %33
%54 = load i8*, i8** %7
%55 = load i8**, i8*** %5
store i8* %54, i8** %55
%56 = load i8**, i8*** %5
%57 = load i8*, i8** %56
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %56
%59 = load i8, i8* %57
%60 = sext i8 %59 to i32
%61 = load i8, i8* %4
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %60, %62
br i1 %63, label %64, label %65
64: ; preds = %53
store i32 1, i32* %3
br label %69
65: ; preds = %53
br label %66
66: ; preds = %65, %25, %21, %15
%67 = load i8*, i8** %6
%68 = load i8**, i8*** %5
store i8* %67, i8** %68
store i32 0, i32* %3
br label %69
69: ; preds = %66, %64, %52, %14
%70 = load i32, i32* %3
ret i32 %70
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c".\00"
define i32 @RdTime(i8 signext %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %1
%5 = tail call i32 @Number(i8** %1)
%6 = icmp eq i32 %5, -2000000000
br i1 %6, label %36, label %7
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i64 @Match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %35, label %11
11: ; preds = %7
%12 = tail call i32 @Number(i8** %1)
%13 = icmp eq i32 %12, -2000000000
br i1 %13, label %35, label %14
14: ; preds = %11
%15 = load i8*, i8** %1
%16 = ptrtoint i8* %15 to i64
%17 = ptrtoint i8* %8 to i64
%18 = sub i64 %16, %17
%19 = icmp eq i64 %18, 3
br i1 %19, label %20, label %35
20: ; preds = %14
%21 = tail call i64 @Match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %20
%24 = tail call i32 @Number(i8** %1)
%25 = icmp eq i32 %24, -2000000000
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = load i8*, i8** %1
%28 = getelementptr inbounds i8, i8* %27, i64 1
store i8* %28, i8** %1
%29 = load i8, i8* %27
%30 = icmp eq i8 %29, %0
br i1 %30, label %36, label %31
31: ; preds = %26, %23, %20
%32 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %32, i8** %1
%33 = load i8, i8* %15
%34 = icmp eq i8 %33, %0
br i1 %34, label %36, label %35
35: ; preds = %31, %14, %11, %7
store i8* %4, i8** %1
br label %36
36: ; preds = %31, %26, %2, %35
%37 = phi i32 [ 0, %35 ], [ 0, %2 ], [ 1, %26 ], [ 1, %31 ]
ret i32 %37
}