#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 /*<<< orphan*/ myTime;

/* Variables and functions */
int checkDateFormat(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *convertTime(char *inTime) {
  static char myTime[50];
  int status;
  strncpy(myTime, inTime, sizeof(myTime));
  if (myTime[10] == '-') {
    myTime[10] = '.';
  }
  if (myTime[13] == '.') {
    myTime[13] = ':';
  }
  if (myTime[16] == '.') {
    myTime[16] = ':';
  }
  status = checkDateFormat(myTime);
  if (status) {
    printf("convertTime checkDateFormat error");
  }
  return (myTime);
}


x86 assembly (clang, -O0):
<convertTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
mov    $0x32,%edx
call   1030 <strncpy@plt>
movsbl 0x2f02(%rip),%eax
cmp    $0x2d,%eax
jne    1168 <convertTime+0x38>
movb   $0x2e,0x2ef2(%rip)
movsbl 0x2eee(%rip),%eax
cmp    $0x2e,%eax
jne    117f <convertTime+0x4f>
movb   $0x3a,0x2ede(%rip)
movsbl 0x2eda(%rip),%eax
cmp    $0x2e,%eax
jne    1196 <convertTime+0x66>
movb   $0x3a,0x2eca(%rip)
lea    0x2eb3(%rip),%rdi
call   1040 <checkDateFormat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11bb <convertTime+0x8b>
lea    0xe4a(%rip),%rdi
call   1050 <printf@plt>
lea    0x2e8e(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertTime>:
push   %rax
mov    %rdi,%rsi
lea    0x2f15(%rip),%rdi
mov    $0x32,%edx
call   1030 <strncpy@plt>
cmpb   $0x2d,0x2f0e(%rip)
je     118c <convertTime+0x5c>
cmpb   $0x2e,0x2f08(%rip)
je     119c <convertTime+0x6c>
cmpb   $0x2e,0x2f02(%rip)
jne    1167 <convertTime+0x37>
movb   $0x3a,0x2ef9(%rip)
lea    0x2ee2(%rip),%rdi
call   1040 <checkDateFormat@plt>
test   %eax,%eax
je     1183 <convertTime+0x53>
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
lea    0x2ec6(%rip),%rax
pop    %rcx
ret
movb   $0x2e,0x2ec7(%rip)
cmpb   $0x2e,0x2ec3(%rip)
jne    1157 <convertTime+0x27>
movb   $0x3a,0x2eba(%rip)
cmpb   $0x2e,0x2eb6(%rip)
je     1160 <convertTime+0x30>
jmp    1167 <convertTime+0x37>

LLVM IR (-O0):
@convertTime.myTime = internal global [50 x i8] zeroinitializer
@.str = [34 x i8] c"convertTime checkDateFormat error\00"
define i8* @convertTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strncpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0), i8* %4, i32 50)
%6 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 10)
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 45
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 46, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 10)
br label %10
10: ; preds = %9, %1
%11 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 13)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 58, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 13)
br label %15
15: ; preds = %14, %10
%16 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 16)
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
br i1 %18, label %19, label %20
19: ; preds = %15
store i8 58, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 16)
br label %20
20: ; preds = %19, %15
%21 = call i32 @checkDateFormat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0))
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0)
}

LLVM IR (-O2):
@convertTime.myTime = internal global [50 x i8] zeroinitializer
@.str = [34 x i8] c"convertTime checkDateFormat error\00"
define i8* @convertTime(i8* %0) {
%2 = tail call i32 @strncpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0), i8* %0, i32 50)
%3 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 10)
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %6
5: ; preds = %1
store i8 46, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 10)
br label %6
6: ; preds = %5, %1
%7 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 13)
%8 = icmp eq i8 %7, 46
br i1 %8, label %9, label %10
9: ; preds = %6
store i8 58, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 13)
br label %10
10: ; preds = %9, %6
%11 = load i8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 16)
%12 = icmp eq i8 %11, 46
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 58, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 16)
br label %14
14: ; preds = %13, %10
%15 = tail call i32 @checkDateFormat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @convertTime.myTime, i64 0, i64 0)
}