#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 timlib_strlen(char *);
void date_time_parse(int *hours, int *minutes, char *hhmm) {
  char buffer[3];
  char *ptr;
  *hours = 0;
  *minutes = 0;
  if (timlib_strlen(hhmm) != 4)
    return;
  ptr = buffer;
  *ptr++ = *hhmm++;
  *ptr++ = *hhmm++;
  *ptr = '\0';
  *hours = atoi(buffer);
  ptr = buffer;
  *ptr++ = *hhmm++;
  *ptr++ = *hhmm++;
  *ptr = '\0';
  *minutes = atoi(buffer);
}


x86 assembly (clang, -O0):
<date_time_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <timlib_strlen@plt>
cmp    $0x4,%eax
je     115f <date_time_parse+0x3f>
jmp    1227 <date_time_parse+0x107>
lea    -0x1b(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x1b(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x1b(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x1b(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_time_parse>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
mov    %rdx,%rdi
call   1030 <timlib_strlen@plt>
cmp    $0x4,%eax
jne    118a <date_time_parse+0x6a>
mov    (%rbx),%al
mov    %al,0x5(%rsp)
mov    0x1(%rbx),%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%r12
mov    %r12,%rdi
call   1040 <atoi@plt>
mov    %eax,(%r15)
mov    0x2(%rbx),%al
mov    %al,0x5(%rsp)
mov    0x3(%rbx),%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r12,%rdi
call   1040 <atoi@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @date_time_parse(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca [3 x i8]
%8 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%9 = load i32*, i32** %4
store i32 0, i32* %9
%10 = load i32*, i32** %5
store i32 0, i32* %10
%11 = load i8*, i8** %6
%12 = call i32 @timlib_strlen(i8* %11)
%13 = icmp ne i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %3
br label %46
15: ; preds = %3
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8* %16, i8** %8
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %6
%19 = load i8, i8* %17
%20 = load i8*, i8** %8
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %8
store i8 %19, i8* %20
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %6
%24 = load i8, i8* %22
%25 = load i8*, i8** %8
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %8
store i8 %24, i8* %25
%27 = load i8*, i8** %8
store i8 0, i8* %27
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%29 = call i32 @atoi(i8* %28)
%30 = load i32*, i32** %4
store i32 %29, i32* %30
%31 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8* %31, i8** %8
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %6
%34 = load i8, i8* %32
%35 = load i8*, i8** %8
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %8
store i8 %34, i8* %35
%37 = load i8*, i8** %6
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %6
%39 = load i8, i8* %37
%40 = load i8*, i8** %8
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %8
store i8 %39, i8* %40
%42 = load i8*, i8** %8
store i8 0, i8* %42
%43 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%44 = call i32 @atoi(i8* %43)
%45 = load i32*, i32** %5
store i32 %44, i32* %45
br label %46
46: ; preds = %15, %14
ret void
}

LLVM IR (-O2):
define void @date_time_parse(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i8* %2) {
%4 = alloca [3 x i8]
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
store i32 0, i32* %0
store i32 0, i32* %1
%6 = tail call i32 @timlib_strlen(i8* %2)
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %2, i64 1
%10 = load i8, i8* %2
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
store i8 %10, i8* %5
%12 = getelementptr inbounds i8, i8* %2, i64 2
%13 = load i8, i8* %9
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 2
store i8 %13, i8* %11
store i8 0, i8* %14
%15 = call i32 @atoi(i8* %5)
store i32 %15, i32* %0
%16 = getelementptr inbounds i8, i8* %2, i64 3
%17 = load i8, i8* %12
store i8 %17, i8* %5
%18 = load i8, i8* %16
store i8 %18, i8* %11
store i8 0, i8* %14
%19 = call i32 @atoi(i8* %5)
store i32 %19, i32* %1
br label %20
20: ; preds = %3, %8
ret void
}