#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 /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int timlib_strlen(char *);
void date_remove_colon_in_time(char *time_string) {
  char hour[3];
  char minute[3];
  if (timlib_strlen(time_string) != 5)
    return;
  strncpy(hour, time_string, 2);
  *(hour + 2) = '\0';
  strncpy(minute, time_string + 3, 2);
  *(minute + 2) = '\0';
  sprintf(time_string, "%s%s", hour, minute);
}


x86 assembly (clang, -O0):
<date_remove_colon_in_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <timlib_strlen@plt>
cmp    $0x5,%eax
je     1153 <date_remove_colon_in_time+0x23>
jmp    119b <date_remove_colon_in_time+0x6b>
lea    -0xb(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rdx
lea    -0xe(%rbp),%rcx
lea    0xe6a(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_remove_colon_in_time>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <timlib_strlen@plt>
cmp    $0x5,%eax
jne    1190 <date_remove_colon_in_time+0x60>
lea    0xd(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xf(%rsp)
lea    0x3(%rbx),%rsi
lea    0xa(%rsp),%r15
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xc(%rsp)
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define void @date_remove_colon_in_time(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @timlib_strlen(i8* %5)
%7 = icmp ne i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %1
br label %25
9: ; preds = %1
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%11 = load i8*, i8** %2
%12 = call i32 @strncpy(i8* %10, i8* %11, i32 2)
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 0, i8* %14
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = call i32 @strncpy(i8* %15, i8* %17, i32 2)
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 0, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%24 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23)
br label %25
25: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define void @date_remove_colon_in_time(i8* %0) {
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @timlib_strlen(i8* %0)
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = call i32 @strncpy(i8* %4, i8* %0, i32 2)
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = call i32 @strncpy(i8* %5, i8* %11, i32 2)
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %13
%14 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
br label %15
15: ; preds = %1, %8
ret void
}