#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*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_current_time(char *date) {
  time_t epoch_time = time(NULL);
  struct tm *local_time = localtime(&epoch_time);
  char tmp_buffer[20] = {'\0'};
  sprintf(date, "%4d-", local_time->tm_year + 1900);
  if ((local_time->tm_mon + 1) > 9) {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "%2d-", local_time->tm_mon + 1);
    strcat(date, tmp_buffer);
  } else {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "0%d-", local_time->tm_mon + 1);
    strcat(date, tmp_buffer);
  }
  if (local_time->tm_mday > 9) {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "%2d ", local_time->tm_mday);
    strcat(date, tmp_buffer);
  } else {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "0%d ", local_time->tm_mday);
    strcat(date, tmp_buffer);
  }
  if (local_time->tm_hour > 9) {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "%2d:", local_time->tm_hour);
    strcat(date, tmp_buffer);
  } else {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "0%d:", local_time->tm_hour);
    strcat(date, tmp_buffer);
  }
  if (local_time->tm_min > 9) {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "%2d:", local_time->tm_min);
    strcat(date, tmp_buffer);
  } else {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "0%d:", local_time->tm_min);
    strcat(date, tmp_buffer);
  }
  if (local_time->tm_sec > 9) {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "%2d", local_time->tm_sec);
    strcat(date, tmp_buffer);
  } else {
    memset(tmp_buffer, 0, 20);
    sprintf(tmp_buffer, "0%d", local_time->tm_sec);
    strcat(date, tmp_buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
add    $0x76c,%edx
lea    0xe64(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x1,%eax
cmp    $0x9,%eax
jle    11f0 <get_current_time+0xa0>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
lea    0xe2c(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
jmp    1227 <get_current_time+0xd7>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
lea    0xdf5(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x9,0x8(%rax)
jle    126e <get_current_time+0x11e>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xdb8(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
jmp    12a2 <get_current_time+0x152>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xd84(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x9,0xc(%rax)
jle    12e9 <get_current_time+0x199>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edx
lea    0xd47(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
jmp    131d <get_current_time+0x1cd>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edx
lea    0xd13(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x9,0x10(%rax)
jle    1364 <get_current_time+0x214>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edx
lea    0xccc(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
jmp    1398 <get_current_time+0x248>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edx
lea    0xc98(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x9,0x14(%rax)
jle    13df <get_current_time+0x28f>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xc5b(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
jmp    1413 <get_current_time+0x2c3>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xc26(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%r12
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
mov    $0x76c,%edx
add    (%rax),%edx
lea    0xe69(%rip),%rsi
mov    %r14,%rdi
call   1070 <sprintf@plt>
mov    0x4(%r12),%ebx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0x4(%r12),%edx
add    $0x1,%edx
cmp    $0x9,%ebx
lea    0xe3b(%rip),%rax
lea    0xe39(%rip),%rsi
cmovge %rax,%rsi
mov    %r15,%rdi
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
cmpl   $0xa,0x8(%r12)
lea    0xe1a(%rip),%rax
lea    0xe18(%rip),%rbx
cmovge %rax,%rbx
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0x8(%r12),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
cmpl   $0xa,0xc(%r12)
lea    0xde2(%rip),%rbp
lea    0xde0(%rip),%r13
mov    %r13,%rbx
cmovge %rbp,%rbx
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0xc(%r12),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
cmpl   $0xa,0x10(%r12)
cmovge %rbp,%r13
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0x10(%r12),%edx
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
cmpl   $0xa,0x14(%r12)
lea    0xd73(%rip),%rax
lea    0xd70(%rip),%rbx
cmovge %rax,%rbx
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0x14(%r12),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [5 x i8] c"%4d-\00"
@.str.1 = [5 x i8] c"%2d-\00"
@.str.2 = [5 x i8] c"0%d-\00"
@.str.3 = [5 x i8] c"%2d \00"
@.str.4 = [5 x i8] c"0%d \00"
@.str.5 = [5 x i8] c"%2d:\00"
@.str.6 = [5 x i8] c"0%d:\00"
@.str.7 = [4 x i8] c"%2d\00"
@.str.8 = [4 x i8] c"0%d\00"
define i32 @get_current_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
%5 = alloca [20 x i8]
store i8* %0, i8** %2
%6 = call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %7, %struct.tm** %4
%8 = bitcast [20 x i8]* %5 to i8*
%9 = load i8*, i8** %2
%10 = load %struct.tm*, %struct.tm** %4
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1900
%14 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load %struct.tm*, %struct.tm** %4
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
%19 = icmp sgt i32 %18, 9
br i1 %19, label %20, label %32
20: ; preds = %1
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i32 20)
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%24 = load %struct.tm*, %struct.tm** %4
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 1
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
%28 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i8*, i8** %2
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%31 = call i32 @strcat(i8* %29, i8* %30)
br label %44
32: ; preds = %1
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%34 = call i32 @memset(i8* %33, i32 0, i32 20)
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%36 = load %struct.tm*, %struct.tm** %4
%37 = getelementptr inbounds %struct.tm, %struct.tm* %36, i32 0, i32 1
%38 = load i32, i32* %37
%39 = add nsw i32 %38, 1
%40 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = load i8*, i8** %2
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%43 = call i32 @strcat(i8* %41, i8* %42)
br label %44
44: ; preds = %32, %20
%45 = load %struct.tm*, %struct.tm** %4
%46 = getelementptr inbounds %struct.tm, %struct.tm* %45, i32 0, i32 2
%47 = load i32, i32* %46
%48 = icmp sgt i32 %47, 9
br i1 %48, label %49, label %60
49: ; preds = %44
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%51 = call i32 @memset(i8* %50, i32 0, i32 20)
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%53 = load %struct.tm*, %struct.tm** %4
%54 = getelementptr inbounds %struct.tm, %struct.tm* %53, i32 0, i32 2
%55 = load i32, i32* %54
%56 = call i32 @sprintf(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = load i8*, i8** %2
%58 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%59 = call i32 @strcat(i8* %57, i8* %58)
br label %71
60: ; preds = %44
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%62 = call i32 @memset(i8* %61, i32 0, i32 20)
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%64 = load %struct.tm*, %struct.tm** %4
%65 = getelementptr inbounds %struct.tm, %struct.tm* %64, i32 0, i32 2
%66 = load i32, i32* %65
%67 = call i32 @sprintf(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i8*, i8** %2
%69 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%70 = call i32 @strcat(i8* %68, i8* %69)
br label %71
71: ; preds = %60, %49
%72 = load %struct.tm*, %struct.tm** %4
%73 = getelementptr inbounds %struct.tm, %struct.tm* %72, i32 0, i32 3
%74 = load i32, i32* %73
%75 = icmp sgt i32 %74, 9
br i1 %75, label %76, label %87
76: ; preds = %71
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%78 = call i32 @memset(i8* %77, i32 0, i32 20)
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%80 = load %struct.tm*, %struct.tm** %4
%81 = getelementptr inbounds %struct.tm, %struct.tm* %80, i32 0, i32 3
%82 = load i32, i32* %81
%83 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %82)
%84 = load i8*, i8** %2
%85 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%86 = call i32 @strcat(i8* %84, i8* %85)
br label %98
87: ; preds = %71
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%89 = call i32 @memset(i8* %88, i32 0, i32 20)
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%91 = load %struct.tm*, %struct.tm** %4
%92 = getelementptr inbounds %struct.tm, %struct.tm* %91, i32 0, i32 3
%93 = load i32, i32* %92
%94 = call i32 @sprintf(i8* %90, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %93)
%95 = load i8*, i8** %2
%96 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%97 = call i32 @strcat(i8* %95, i8* %96)
br label %98
98: ; preds = %87, %76
%99 = load %struct.tm*, %struct.tm** %4
%100 = getelementptr inbounds %struct.tm, %struct.tm* %99, i32 0, i32 4
%101 = load i32, i32* %100
%102 = icmp sgt i32 %101, 9
br i1 %102, label %103, label %114
103: ; preds = %98
%104 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%105 = call i32 @memset(i8* %104, i32 0, i32 20)
%106 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%107 = load %struct.tm*, %struct.tm** %4
%108 = getelementptr inbounds %struct.tm, %struct.tm* %107, i32 0, i32 4
%109 = load i32, i32* %108
%110 = call i32 @sprintf(i8* %106, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %109)
%111 = load i8*, i8** %2
%112 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%113 = call i32 @strcat(i8* %111, i8* %112)
br label %125
114: ; preds = %98
%115 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%116 = call i32 @memset(i8* %115, i32 0, i32 20)
%117 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%118 = load %struct.tm*, %struct.tm** %4
%119 = getelementptr inbounds %struct.tm, %struct.tm* %118, i32 0, i32 4
%120 = load i32, i32* %119
%121 = call i32 @sprintf(i8* %117, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %120)
%122 = load i8*, i8** %2
%123 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%124 = call i32 @strcat(i8* %122, i8* %123)
br label %125
125: ; preds = %114, %103
%126 = load %struct.tm*, %struct.tm** %4
%127 = getelementptr inbounds %struct.tm, %struct.tm* %126, i32 0, i32 5
%128 = load i32, i32* %127
%129 = icmp sgt i32 %128, 9
br i1 %129, label %130, label %141
130: ; preds = %125
%131 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%132 = call i32 @memset(i8* %131, i32 0, i32 20)
%133 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%134 = load %struct.tm*, %struct.tm** %4
%135 = getelementptr inbounds %struct.tm, %struct.tm* %134, i32 0, i32 5
%136 = load i32, i32* %135
%137 = call i32 @sprintf(i8* %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %136)
%138 = load i8*, i8** %2
%139 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%140 = call i32 @strcat(i8* %138, i8* %139)
br label %152
141: ; preds = %125
%142 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%143 = call i32 @memset(i8* %142, i32 0, i32 20)
%144 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%145 = load %struct.tm*, %struct.tm** %4
%146 = getelementptr inbounds %struct.tm, %struct.tm* %145, i32 0, i32 5
%147 = load i32, i32* %146
%148 = call i32 @sprintf(i8* %144, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %147)
%149 = load i8*, i8** %2
%150 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%151 = call i32 @strcat(i8* %149, i8* %150)
br label %152
152: ; preds = %141, %130
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [5 x i8] c"%4d-\00"
@.str.1 = [5 x i8] c"%2d-\00"
@.str.2 = [5 x i8] c"0%d-\00"
@.str.3 = [5 x i8] c"%2d \00"
@.str.4 = [5 x i8] c"0%d \00"
@.str.5 = [5 x i8] c"%2d:\00"
@.str.6 = [5 x i8] c"0%d:\00"
@.str.7 = [4 x i8] c"%2d\00"
@.str.8 = [4 x i8] c"0%d\00"
define i32 @get_current_time(i8* %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1900
%11 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, 8
%15 = call i32 @memset(i8* %7, i32 0, i32 20)
%16 = load i32, i32* %12
%17 = add nsw i32 %16, 1
%18 = select i1 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) %18, i32 %17)
%20 = call i32 @strcat(i8* %0, i8* %7)
%21 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 9
%24 = select i1 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0)
%25 = call i32 @memset(i8* %7, i32 0, i32 20)
%26 = load i32, i32* %21
%27 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) %24, i32 %26)
%28 = call i32 @strcat(i8* %0, i8* %7)
%29 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 3
%30 = load i32, i32* %29
%31 = icmp sgt i32 %30, 9
%32 = select i1 %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%33 = call i32 @memset(i8* %7, i32 0, i32 20)
%34 = load i32, i32* %29
%35 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) %32, i32 %34)
%36 = call i32 @strcat(i8* %0, i8* %7)
%37 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 4
%38 = load i32, i32* %37
%39 = icmp sgt i32 %38, 9
%40 = select i1 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%41 = call i32 @memset(i8* %7, i32 0, i32 20)
%42 = load i32, i32* %37
%43 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) %40, i32 %42)
%44 = call i32 @strcat(i8* %0, i8* %7)
%45 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 5
%46 = load i32, i32* %45
%47 = icmp sgt i32 %46, 9
%48 = select i1 %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0)
%49 = call i32 @memset(i8* %7, i32 0, i32 20)
%50 = load i32, i32* %45
%51 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) %48, i32 %50)
%52 = call i32 @strcat(i8* %0, i8* %7)
ret i32 0
}