#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, char, char, char);
char *strDate(char *ptrDate) {
  static char stringDate[17];
  sprintf(stringDate, "20%02x-%02x-%02x %02x:%02x", ptrDate[0], ptrDate[1],
          ptrDate[2], ptrDate[3], ptrDate[4]);
  return stringDate;
}


x86 assembly (clang, -O0):
<strDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%r9b
mov    -0x8(%rbp),%rax
lea    0x2efc(%rip),%rdi
lea    0xeb5(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl 0x4(%rax),%eax
mov    %eax,(%rsp)
call   1030 <sprintf@plt>
lea    0x2ed4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDate>:
push   %rbx
sub    $0x10,%rsp
movsbl (%rdi),%edx
movsbl 0x1(%rdi),%ecx
movsbl 0x2(%rdi),%r8d
movsbl 0x3(%rdi),%r9d
movsbl 0x4(%rdi),%eax
mov    %eax,(%rsp)
lea    0x2f0c(%rip),%rbx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@strDate.stringDate = internal global [17 x i8] zeroinitializer
@.str = [27 x i8] c"20%02x-%02x-%02x %02x:%02x\00"
define i8* @strDate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 4
%17 = load i8, i8* %16
%18 = call i32 @sprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @strDate.stringDate, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %8, i8 signext %11, i8 signext %14, i8 signext %17)
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @strDate.stringDate, i64 0, i64 0)
}

LLVM IR (-O2):
@strDate.stringDate = internal global [17 x i8] zeroinitializer
@.str = [27 x i8] c"20%02x-%02x-%02x %02x:%02x\00"
define i8* @strDate(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 4
%10 = load i8, i8* %9
%11 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @strDate.stringDate, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %4, i8 signext %6, i8 signext %8, i8 signext %10)
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @strDate.stringDate, i64 0, i64 0)
}