#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 *);
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char toupper(char const);
int SARParseTimeOfDay(const char *string, int *h, int *m, int *s) {
  const char *sp;
  int in_len, is_12hourpm = 0;
  int lstring_len = 80;
  char *sp2, *sp3;
  char lstring[80];
  if (h != NULL)
    (*h) = 0;
  if (m != NULL)
    (*m) = 0;
  if (s != NULL)
    (*s) = 0;
  if ((string == NULL) ? 1 : ((*string) == '\0'))
    return (-1);
  sp = string;
  in_len = 0;
  while (((*sp) != '\0') && !(((*sp) == ' ') || ((*sp) == '\t'))) {
    if (toupper(*sp) == 'P')
      is_12hourpm = 1;
    sp++;
    in_len++;
  }
  if (in_len > 0)
    strncpy(lstring, string,
            (((in_len) < (lstring_len)) ? (in_len) : (lstring_len)));
  else
    (*lstring) = '\0';
  lstring[(((in_len) < (lstring_len - 1)) ? (in_len) : (lstring_len - 1))] =
      '\0';
  sp2 = lstring;
  sp3 = strchr(sp2, ':');
  if (sp3 != NULL) {
    (*sp3) = '\0';
    if (h != NULL)
      *h = ((((sp2) != NULL) ? atoi(sp2) : 0) + ((is_12hourpm) ? +12 : 0)) % 24;
    sp2 = sp3 + 1;
  } else {
    if (h != NULL)
      *h = ((((sp2) != NULL) ? atoi(sp2) : 0) + ((is_12hourpm) ? +12 : 0)) % 24;
    sp2 = NULL;
  }
  if (sp2 == NULL)
    return (0);
  sp3 = strchr(sp2, ':');
  if (sp3 != NULL) {
    *sp3 = '\0';
    if (m != NULL)
      *m = (((sp2) != NULL) ? atoi(sp2) : 0) % 60;
    sp2 = sp3 + 1;
  } else {
    if (m != NULL)
      *m = (((sp2) != NULL) ? atoi(sp2) : 0) % 60;
    sp2 = NULL;
  }
  if (sp2 == NULL)
    return (0);
  sp3 = strchr(sp2, ':');
  if (sp3 != NULL) {
    *sp3 = '\0';
    if (s != NULL)
      *s = (((sp2) != NULL) ? atoi(sp2) : 0) % 60;
  } else {
    if (s != NULL)
      *s = (((sp2) != NULL) ? atoi(sp2) : 0) % 60;
  }
  return (0);
}


x86 assembly (clang, -O0):
<SARParseTimeOfDay>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x50,-0x3c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117e <SARParseTimeOfDay+0x3e>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1193 <SARParseTimeOfDay+0x53>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     11a8 <SARParseTimeOfDay+0x68>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    11c2 <SARParseTimeOfDay+0x82>
mov    $0x1,%al
test   $0x1,%al
jne    11d2 <SARParseTimeOfDay+0x92>
jmp    11de <SARParseTimeOfDay+0x9e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11de <SARParseTimeOfDay+0x9e>
movl   $0xffffffff,-0x4(%rbp)
jmp    15fe <SARParseTimeOfDay+0x4be>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa1(%rbp)
je     123e <SARParseTimeOfDay+0xfe>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa2(%rbp)
je     1230 <SARParseTimeOfDay+0xf0>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
xor    $0xff,%al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    1251 <SARParseTimeOfDay+0x111>
jmp    128a <SARParseTimeOfDay+0x14a>
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x50,%eax
jne    1270 <SARParseTimeOfDay+0x130>
movl   $0x1,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ed <SARParseTimeOfDay+0xad>
cmpl   $0x0,-0x34(%rbp)
jle    12ee <SARParseTimeOfDay+0x1ae>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    12c7 <SARParseTimeOfDay+0x187>
mov    -0x34(%rbp),%eax
mov    %eax,-0xbc(%rbp)
jmp    12d0 <SARParseTimeOfDay+0x190>
mov    -0x3c(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xb0(%rbp),%rsi
mov    -0xb8(%rbp),%rdi
mov    -0xbc(%rbp),%edx
call   1030 <strncpy@plt>
jmp    12f5 <SARParseTimeOfDay+0x1b5>
movb   $0x0,-0xa0(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1314 <SARParseTimeOfDay+0x1d4>
mov    -0x34(%rbp),%eax
mov    %eax,-0xc0(%rbp)
jmp    1320 <SARParseTimeOfDay+0x1e0>
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
cltq
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     13cd <SARParseTimeOfDay+0x28d>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     13bc <SARParseTimeOfDay+0x27c>
cmpq   $0x0,-0x48(%rbp)
je     1389 <SARParseTimeOfDay+0x249>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc4(%rbp)
jmp    1396 <SARParseTimeOfDay+0x256>
xor    %eax,%eax
mov    %eax,-0xc4(%rbp)
jmp    1396 <SARParseTimeOfDay+0x256>
mov    -0xc4(%rbp),%eax
mov    -0x38(%rbp),%esi
xor    %ecx,%ecx
mov    $0xc,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1432 <SARParseTimeOfDay+0x2f2>
cmpq   $0x0,-0x18(%rbp)
je     142a <SARParseTimeOfDay+0x2ea>
cmpq   $0x0,-0x48(%rbp)
je     13f7 <SARParseTimeOfDay+0x2b7>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc8(%rbp)
jmp    1404 <SARParseTimeOfDay+0x2c4>
xor    %eax,%eax
mov    %eax,-0xc8(%rbp)
jmp    1404 <SARParseTimeOfDay+0x2c4>
mov    -0xc8(%rbp),%eax
mov    -0x38(%rbp),%esi
xor    %ecx,%ecx
mov    $0xc,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1449 <SARParseTimeOfDay+0x309>
movl   $0x0,-0x4(%rbp)
jmp    15fe <SARParseTimeOfDay+0x4be>
mov    -0x48(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     14c9 <SARParseTimeOfDay+0x389>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     14b8 <SARParseTimeOfDay+0x378>
cmpq   $0x0,-0x48(%rbp)
je     1497 <SARParseTimeOfDay+0x357>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xcc(%rbp)
jmp    14a4 <SARParseTimeOfDay+0x364>
xor    %eax,%eax
mov    %eax,-0xcc(%rbp)
jmp    14a4 <SARParseTimeOfDay+0x364>
mov    -0xcc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    151c <SARParseTimeOfDay+0x3dc>
cmpq   $0x0,-0x20(%rbp)
je     1514 <SARParseTimeOfDay+0x3d4>
cmpq   $0x0,-0x48(%rbp)
je     14f3 <SARParseTimeOfDay+0x3b3>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xd0(%rbp)
jmp    1500 <SARParseTimeOfDay+0x3c0>
xor    %eax,%eax
mov    %eax,-0xd0(%rbp)
jmp    1500 <SARParseTimeOfDay+0x3c0>
mov    -0xd0(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1533 <SARParseTimeOfDay+0x3f3>
movl   $0x0,-0x4(%rbp)
jmp    15fe <SARParseTimeOfDay+0x4be>
mov    -0x48(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     15a7 <SARParseTimeOfDay+0x467>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     15a2 <SARParseTimeOfDay+0x462>
cmpq   $0x0,-0x48(%rbp)
je     1581 <SARParseTimeOfDay+0x441>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xd4(%rbp)
jmp    158e <SARParseTimeOfDay+0x44e>
xor    %eax,%eax
mov    %eax,-0xd4(%rbp)
jmp    158e <SARParseTimeOfDay+0x44e>
mov    -0xd4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
mov    %edx,(%rax)
jmp    15f7 <SARParseTimeOfDay+0x4b7>
cmpq   $0x0,-0x28(%rbp)
je     15f2 <SARParseTimeOfDay+0x4b2>
cmpq   $0x0,-0x48(%rbp)
je     15d1 <SARParseTimeOfDay+0x491>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xd8(%rbp)
jmp    15de <SARParseTimeOfDay+0x49e>
xor    %eax,%eax
mov    %eax,-0xd8(%rbp)
jmp    15de <SARParseTimeOfDay+0x49e>
mov    -0xd8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
mov    %edx,(%rax)
jmp    15f7 <SARParseTimeOfDay+0x4b7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SARParseTimeOfDay>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r13
mov    %rdi,%r14
test   %rsi,%rsi
je     1161 <SARParseTimeOfDay+0x21>
movl   $0x0,0x0(%r13)
test   %rdx,%rdx
je     116c <SARParseTimeOfDay+0x2c>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     1177 <SARParseTimeOfDay+0x37>
movl   $0x0,(%rcx)
mov    $0xffffffff,%r12d
test   %r14,%r14
je     137f <SARParseTimeOfDay+0x23f>
mov    (%r14),%al
test   %al,%al
je     137f <SARParseTimeOfDay+0x23f>
mov    %rdx,0x8(%rsp)
mov    %rcx,(%rsp)
xor    %ebp,%ebp
mov    $0x1,%r12d
movabs $0x100000201,%r15
xor    %ebx,%ebx
jmp    11c8 <SARParseTimeOfDay+0x88>
movsbl %al,%edi
call   1040 <toupper@plt>
cmp    $0x50,%al
cmove  %r12d,%ebx
movzbl 0x1(%r14,%rbp,1),%eax
add    $0x1,%rbp
cmp    $0x20,%al
ja     11b0 <SARParseTimeOfDay+0x70>
movzbl %al,%ecx
bt     %rcx,%r15
jae    11b0 <SARParseTimeOfDay+0x70>
test   %ebp,%ebp
je     11f3 <SARParseTimeOfDay+0xb3>
cmp    $0x50,%ebp
mov    $0x50,%edx
cmovb  %ebp,%edx
lea    0x10(%rsp),%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
jmp    11f8 <SARParseTimeOfDay+0xb8>
movb   $0x0,0x10(%rsp)
mov    0x8(%rsp),%r14
cmp    $0x4f,%ebp
mov    $0x4f,%eax
cmovb  %ebp,%eax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0x10(%rsp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     130b <SARParseTimeOfDay+0x1cb>
mov    %rax,%rbp
movb   $0x0,(%rax)
test   %r13,%r13
je     1269 <SARParseTimeOfDay+0x129>
lea    0x10(%rsp),%rdi
call   1060 <atoi@plt>
test   %ebx,%ebx
mov    $0xc,%ecx
cmove  %ebx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,0x0(%r13)
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     134e <SARParseTimeOfDay+0x20e>
mov    %rax,%rbx
movb   $0x0,(%rax)
test   %r14,%r14
je     12b7 <SARParseTimeOfDay+0x177>
mov    %rbp,%rdi
call   1060 <atoi@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14)
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
xor    %r12d,%r12d
test   %rax,%rax
je     12d3 <SARParseTimeOfDay+0x193>
movb   $0x0,(%rax)
mov    (%rsp),%rbp
test   %rbp,%rbp
je     137f <SARParseTimeOfDay+0x23f>
mov    %rbx,%rdi
call   1060 <atoi@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x0(%rbp)
jmp    137f <SARParseTimeOfDay+0x23f>
xor    %r12d,%r12d
test   %r13,%r13
je     137f <SARParseTimeOfDay+0x23f>
lea    0x10(%rsp),%rdi
call   1060 <atoi@plt>
test   %ebx,%ebx
mov    $0xc,%ecx
cmove  %ebx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,0x0(%r13)
jmp    137f <SARParseTimeOfDay+0x23f>
xor    %r12d,%r12d
test   %r14,%r14
je     137f <SARParseTimeOfDay+0x23f>
mov    %rbp,%rdi
call   1060 <atoi@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14)
mov    %r12d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SARParseTimeOfDay(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca [80 x i8]
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32 0, i32* %12
store i32 80, i32* %13
%17 = load i32*, i32** %7
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32*, i32** %7
store i32 0, i32* %20
br label %21
21: ; preds = %19, %4
%22 = load i32*, i32** %8
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32*, i32** %8
store i32 0, i32* %25
br label %26
26: ; preds = %24, %21
%27 = load i32*, i32** %9
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = load i32*, i32** %9
store i32 0, i32* %30
br label %31
31: ; preds = %29, %26
%32 = load i8*, i8** %6
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %35
34: ; preds = %31
br i1 true, label %40, label %41
35: ; preds = %31
%36 = load i8*, i8** %6
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %35, %34
store i32 -1, i32* %5
br label %238
41: ; preds = %35, %34
%42 = load i8*, i8** %6
store i8* %42, i8** %10
store i32 0, i32* %11
br label %43
43: ; preds = %70, %41
%44 = load i8*, i8** %10
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %61
48: ; preds = %43
%49 = load i8*, i8** %10
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 32
br i1 %52, label %58, label %53
53: ; preds = %48
%54 = load i8*, i8** %10
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 9
br label %58
58: ; preds = %53, %48
%59 = phi i1 [ true, %48 ], [ %57, %53 ]
%60 = xor i1 %59, true
br label %61
61: ; preds = %58, %43
%62 = phi i1 [ false, %43 ], [ %60, %58 ]
br i1 %62, label %63, label %75
63: ; preds = %61
%64 = load i8*, i8** %10
%65 = load i8, i8* %64
%66 = call signext i8 @toupper(i8 signext %65)
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 80
br i1 %68, label %69, label %70
69: ; preds = %63
store i32 1, i32* %12
br label %70
70: ; preds = %69, %63
%71 = load i8*, i8** %10
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %10
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
store i32 %74, i32* %11
br label %43
75: ; preds = %61
%76 = load i32, i32* %11
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %91
78: ; preds = %75
%79 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%80 = load i8*, i8** %6
%81 = load i32, i32* %11
%82 = load i32, i32* %13
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %86
84: ; preds = %78
%85 = load i32, i32* %11
br label %88
86: ; preds = %78
%87 = load i32, i32* %13
br label %88
88: ; preds = %86, %84
%89 = phi i32 [ %85, %84 ], [ %87, %86 ]
%90 = call i32 @strncpy(i8* %79, i8* %80, i32 %89)
br label %93
91: ; preds = %75
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
store i8 0, i8* %92
br label %93
93: ; preds = %91, %88
%94 = load i32, i32* %11
%95 = load i32, i32* %13
%96 = sub nsw i32 %95, 1
%97 = icmp slt i32 %94, %96
br i1 %97, label %98, label %100
98: ; preds = %93
%99 = load i32, i32* %11
br label %103
100: ; preds = %93
%101 = load i32, i32* %13
%102 = sub nsw i32 %101, 1
br label %103
103: ; preds = %100, %98
%104 = phi i32 [ %99, %98 ], [ %102, %100 ]
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 %105
store i8 0, i8* %106
%107 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
store i8* %107, i8** %14
%108 = load i8*, i8** %14
%109 = call i8* @strchr(i8* %108, i8 signext 58)
store i8* %109, i8** %15
%110 = load i8*, i8** %15
%111 = icmp ne i8* %110, null
br i1 %111, label %112, label %135
112: ; preds = %103
%113 = load i8*, i8** %15
store i8 0, i8* %113
%114 = load i32*, i32** %7
%115 = icmp ne i32* %114, null
br i1 %115, label %116, label %132
116: ; preds = %112
%117 = load i8*, i8** %14
%118 = icmp ne i8* %117, null
br i1 %118, label %119, label %122
119: ; preds = %116
%120 = load i8*, i8** %14
%121 = call i32 @atoi(i8* %120)
br label %123
122: ; preds = %116
br label %123
123: ; preds = %122, %119
%124 = phi i32 [ %121, %119 ], [ 0, %122 ]
%125 = load i32, i32* %12
%126 = icmp ne i32 %125, 0
%127 = zext i1 %126 to i64
%128 = select i1 %126, i32 12, i32 0
%129 = add nsw i32 %124, %128
%130 = srem i32 %129, 24
%131 = load i32*, i32** %7
store i32 %130, i32* %131
br label %132
132: ; preds = %123, %112
%133 = load i8*, i8** %15
%134 = getelementptr inbounds i8, i8* %133, i64 1
store i8* %134, i8** %14
br label %155
135: ; preds = %103
%136 = load i32*, i32** %7
%137 = icmp ne i32* %136, null
br i1 %137, label %138, label %154
138: ; preds = %135
%139 = load i8*, i8** %14
%140 = icmp ne i8* %139, null
br i1 %140, label %141, label %144
141: ; preds = %138
%142 = load i8*, i8** %14
%143 = call i32 @atoi(i8* %142)
br label %145
144: ; preds = %138
br label %145
145: ; preds = %144, %141
%146 = phi i32 [ %143, %141 ], [ 0, %144 ]
%147 = load i32, i32* %12
%148 = icmp ne i32 %147, 0
%149 = zext i1 %148 to i64
%150 = select i1 %148, i32 12, i32 0
%151 = add nsw i32 %146, %150
%152 = srem i32 %151, 24
%153 = load i32*, i32** %7
store i32 %152, i32* %153
br label %154
154: ; preds = %145, %135
store i8* null, i8** %14
br label %155
155: ; preds = %154, %132
%156 = load i8*, i8** %14
%157 = icmp eq i8* %156, null
br i1 %157, label %158, label %159
158: ; preds = %155
store i32 0, i32* %5
br label %238
159: ; preds = %155
%160 = load i8*, i8** %14
%161 = call i8* @strchr(i8* %160, i8 signext 58)
store i8* %161, i8** %15
%162 = load i8*, i8** %15
%163 = icmp ne i8* %162, null
br i1 %163, label %164, label %182
164: ; preds = %159
%165 = load i8*, i8** %15
store i8 0, i8* %165
%166 = load i32*, i32** %8
%167 = icmp ne i32* %166, null
br i1 %167, label %168, label %179
168: ; preds = %164
%169 = load i8*, i8** %14
%170 = icmp ne i8* %169, null
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load i8*, i8** %14
%173 = call i32 @atoi(i8* %172)
br label %175
174: ; preds = %168
br label %175
175: ; preds = %174, %171
%176 = phi i32 [ %173, %171 ], [ 0, %174 ]
%177 = srem i32 %176, 60
%178 = load i32*, i32** %8
store i32 %177, i32* %178
br label %179
179: ; preds = %175, %164
%180 = load i8*, i8** %15
%181 = getelementptr inbounds i8, i8* %180, i64 1
store i8* %181, i8** %14
br label %197
182: ; preds = %159
%183 = load i32*, i32** %8
%184 = icmp ne i32* %183, null
br i1 %184, label %185, label %196
185: ; preds = %182
%186 = load i8*, i8** %14
%187 = icmp ne i8* %186, null
br i1 %187, label %188, label %191
188: ; preds = %185
%189 = load i8*, i8** %14
%190 = call i32 @atoi(i8* %189)
br label %192
191: ; preds = %185
br label %192
192: ; preds = %191, %188
%193 = phi i32 [ %190, %188 ], [ 0, %191 ]
%194 = srem i32 %193, 60
%195 = load i32*, i32** %8
store i32 %194, i32* %195
br label %196
196: ; preds = %192, %182
store i8* null, i8** %14
br label %197
197: ; preds = %196, %179
%198 = load i8*, i8** %14
%199 = icmp eq i8* %198, null
br i1 %199, label %200, label %201
200: ; preds = %197
store i32 0, i32* %5
br label %238
201: ; preds = %197
%202 = load i8*, i8** %14
%203 = call i8* @strchr(i8* %202, i8 signext 58)
store i8* %203, i8** %15
%204 = load i8*, i8** %15
%205 = icmp ne i8* %204, null
br i1 %205, label %206, label %222
206: ; preds = %201
%207 = load i8*, i8** %15
store i8 0, i8* %207
%208 = load i32*, i32** %9
%209 = icmp ne i32* %208, null
br i1 %209, label %210, label %221
210: ; preds = %206
%211 = load i8*, i8** %14
%212 = icmp ne i8* %211, null
br i1 %212, label %213, label %216
213: ; preds = %210
%214 = load i8*, i8** %14
%215 = call i32 @atoi(i8* %214)
br label %217
216: ; preds = %210
br label %217
217: ; preds = %216, %213
%218 = phi i32 [ %215, %213 ], [ 0, %216 ]
%219 = srem i32 %218, 60
%220 = load i32*, i32** %9
store i32 %219, i32* %220
br label %221
221: ; preds = %217, %206
br label %237
222: ; preds = %201
%223 = load i32*, i32** %9
%224 = icmp ne i32* %223, null
br i1 %224, label %225, label %236
225: ; preds = %222
%226 = load i8*, i8** %14
%227 = icmp ne i8* %226, null
br i1 %227, label %228, label %231
228: ; preds = %225
%229 = load i8*, i8** %14
%230 = call i32 @atoi(i8* %229)
br label %232
231: ; preds = %225
br label %232
232: ; preds = %231, %228
%233 = phi i32 [ %230, %228 ], [ 0, %231 ]
%234 = srem i32 %233, 60
%235 = load i32*, i32** %9
store i32 %234, i32* %235
br label %236
236: ; preds = %232, %222
br label %237
237: ; preds = %236, %221
store i32 0, i32* %5
br label %238
238: ; preds = %237, %200, %158, %40
%239 = load i32, i32* %5
ret i32 %239
}

LLVM IR (-O2):
define i32 @SARParseTimeOfDay(i8* %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %4
store i32 0, i32* %1
br label %9
9: ; preds = %8, %4
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = icmp eq i32* %3, null
br i1 %13, label %15, label %14
14: ; preds = %12
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = icmp eq i8* %0, null
br i1 %16, label %84, label %17
17: ; preds = %15
%18 = load i8, i8* %0
%19 = icmp eq i8 %18, 0
br i1 %19, label %84, label %20
20: ; preds = %17, %25
%21 = phi i8 [ %31, %25 ], [ %18, %17 ]
%22 = phi i8* [ %29, %25 ], [ %0, %17 ]
%23 = phi i32 [ %30, %25 ], [ 0, %17 ]
%24 = phi i32 [ %28, %25 ], [ 0, %17 ]
switch i8 %21, label %25 [
i8 0, label %32
i8 32, label %32
i8 9, label %32
]
25: ; preds = %20
%26 = tail call signext i8 @toupper(i8 signext %21)
%27 = icmp eq i8 %26, 80
%28 = select i1 %27, i32 1, i32 %24
%29 = getelementptr inbounds i8, i8* %22, i64 1
%30 = add nuw nsw i32 %23, 1
%31 = load i8, i8* %29
br label %20
32: ; preds = %20, %20, %20
%33 = icmp eq i32 %23, 0
br i1 %33, label %38, label %34
34: ; preds = %32
%35 = icmp ult i32 %23, 80
%36 = select i1 %35, i32 %23, i32 80
%37 = call i32 @strncpy(i8* %6, i8* %0, i32 %36)
br label %39
38: ; preds = %32
store i8 0, i8* %6
br label %39
39: ; preds = %38, %34
%40 = icmp ult i32 %23, 79
%41 = select i1 %40, i32 %23, i32 79
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %42
store i8 0, i8* %43
%44 = call i8* @strchr(i8* %6, i8 signext 58)
%45 = icmp eq i8* %44, null
br i1 %45, label %53, label %46
46: ; preds = %39
store i8 0, i8* %44
br i1 %7, label %60, label %47
47: ; preds = %46
%48 = call i32 @atoi(i8* %6)
%49 = icmp eq i32 %24, 0
%50 = select i1 %49, i32 0, i32 12
%51 = add nsw i32 %48, %50
%52 = srem i32 %51, 24
store i32 %52, i32* %1
br label %60
53: ; preds = %39
br i1 %7, label %84, label %54
54: ; preds = %53
%55 = call i32 @atoi(i8* %6)
%56 = icmp eq i32 %24, 0
%57 = select i1 %56, i32 0, i32 12
%58 = add nsw i32 %55, %57
%59 = srem i32 %58, 24
store i32 %59, i32* %1
br label %84
60: ; preds = %47, %46
%61 = getelementptr inbounds i8, i8* %44, i64 1
%62 = call i8* @strchr(i8* %61, i8 signext 58)
%63 = icmp eq i8* %62, null
br i1 %63, label %68, label %64
64: ; preds = %60
store i8 0, i8* %62
br i1 %10, label %72, label %65
65: ; preds = %64
%66 = call i32 @atoi(i8* %61)
%67 = srem i32 %66, 60
store i32 %67, i32* %2
br label %72
68: ; preds = %60
br i1 %10, label %84, label %69
69: ; preds = %68
%70 = call i32 @atoi(i8* %61)
%71 = srem i32 %70, 60
store i32 %71, i32* %2
br label %84
72: ; preds = %65, %64
%73 = getelementptr inbounds i8, i8* %62, i64 1
%74 = call i8* @strchr(i8* %73, i8 signext 58)
%75 = icmp eq i8* %74, null
br i1 %75, label %80, label %76
76: ; preds = %72
store i8 0, i8* %74
br i1 %13, label %84, label %77
77: ; preds = %76
%78 = call i32 @atoi(i8* %73)
%79 = srem i32 %78, 60
store i32 %79, i32* %3
br label %84
80: ; preds = %72
br i1 %13, label %84, label %81
81: ; preds = %80
%82 = call i32 @atoi(i8* %73)
%83 = srem i32 %82, 60
store i32 %83, i32* %3
br label %84
84: ; preds = %68, %69, %53, %54, %77, %76, %81, %80, %17, %15
%85 = phi i32 [ -1, %15 ], [ -1, %17 ], [ 0, %80 ], [ 0, %81 ], [ 0, %76 ], [ 0, %77 ], [ 0, %54 ], [ 0, %53 ], [ 0, %69 ], [ 0, %68 ]
ret i32 %85
}