#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 */
typedef int time_t;

/* Variables and functions */
scalar_t__ _ttime_number(char **, int *);
int _ttime_second(char **p, time_t *time) {
  time_t res;
  if (**p != '.')
    return 1;
  (*p)++;
  if (_ttime_number(p, &res) != 0 || res >= 60)
    return 1;
  *time += res;
  return 0;
}


x86 assembly (clang, -O0):
<_ttime_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     113f <_ttime_second+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    118c <_ttime_second+0x7c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <_ttime_number@plt>
cmp    $0x0,%rax
jne    116e <_ttime_second+0x5e>
cmpl   $0x3c,-0x1c(%rbp)
jl     117a <_ttime_second+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    118c <_ttime_second+0x7c>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ttime_second>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    $0x1,%ebx
cmpb   $0x2e,(%rax)
jne    1148 <_ttime_second+0x38>
mov    %rsi,%r14
add    $0x1,%rax
mov    %rax,(%rdi)
lea    0x4(%rsp),%rsi
call   1030 <_ttime_number@plt>
test   %rax,%rax
jne    1148 <_ttime_second+0x38>
mov    0x4(%rsp),%eax
cmp    $0x3b,%eax
jg     1148 <_ttime_second+0x38>
add    %eax,(%r14)
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_ttime_second(i8** %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
store i8** %0, i8*** %4
store i32* %1, i32** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 46
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %29
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %14
%17 = load i8**, i8*** %4
%18 = call i64 @_ttime_number(i8** %17, i32* %6)
%19 = icmp ne i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %13
%21 = load i32, i32* %6
%22 = icmp sge i32 %21, 60
br i1 %22, label %23, label %24
23: ; preds = %20, %13
store i32 1, i32* %3
br label %29
24: ; preds = %20
%25 = load i32, i32* %6
%26 = load i32*, i32** %5
%27 = load i32, i32* %26
%28 = add nsw i32 %27, %25
store i32 %28, i32* %26
store i32 0, i32* %3
br label %29
29: ; preds = %24, %23, %12
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @_ttime_second(i8** %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %9, i8** %0
%10 = call i64 @_ttime_number(i8** %0, i32* %3)
%11 = icmp ne i64 %10, 0
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 59
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %18, label %15
15: ; preds = %8
%16 = load i32, i32* %1
%17 = add nsw i32 %16, %12
store i32 %17, i32* %1
br label %18
18: ; preds = %8, %2, %15
%19 = phi i32 [ 0, %15 ], [ 1, %2 ], [ 1, %8 ]
ret i32 %19
}