#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_hour;
  int tm_min;
  int tm_sec;
  int tm_mon;
  int tm_mday;
  int tm_year;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void GetCurrentTime(char *OutHr, char *OutMin, char *OutSec, char *OutYear,
                    char *OutMonth, char *OutDay) {
  struct tm TimeStruct;
  int HMS_I[3];
  int MDY_I[3];
  char *HMS[3];
  char *MDY[3];
  short Inc = 0;
  time_t TimeT;
  HMS[0] = OutHr;
  HMS[1] = OutMin;
  HMS[2] = OutSec;
  MDY[0] = OutMonth;
  MDY[1] = OutDay;
  MDY[2] = OutYear;
  time(&TimeT);
  localtime_r(&TimeT, &TimeStruct);
  HMS_I[0] = TimeStruct.tm_hour;
  HMS_I[1] = TimeStruct.tm_min;
  HMS_I[2] = TimeStruct.tm_sec;
  MDY_I[0] = TimeStruct.tm_mon + 1;
  MDY_I[1] = TimeStruct.tm_mday;
  MDY_I[2] = TimeStruct.tm_year + 1900;
  for (; Inc < 3; ++Inc) {
    if (HMS[Inc] == NULL) {
      continue;
    }
    snprintf(HMS[Inc], 16, (HMS_I[Inc] >= 10 ? "%u" : "0%u"), HMS_I[Inc]);
  }
  for (Inc = 0; Inc < 3; ++Inc) {
    if (MDY[Inc] != NULL) {
      snprintf(MDY[Inc], 16, (MDY_I[Inc] >= 10 ? "%u" : "0%u"), MDY_I[Inc]);
    }
  }
}


x86 assembly (clang, -O0):
<GetCurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movw   $0x0,-0xa2(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    -0xa8(%rbp),%rdi
call   1050 <time@plt>
lea    -0xa8(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x48(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x58(%rbp)
movswl -0xa2(%rbp),%eax
cmp    $0x3,%eax
jge    1261 <GetCurrentTime+0x131>
movswq -0xa2(%rbp),%rax
ff
cmpq   $0x0,-0x80(%rbp,%rax,8)
jne    1206 <GetCurrentTime+0xd6>
jmp    124a <GetCurrentTime+0x11a>
movswq -0xa2(%rbp),%rax
ff
mov    -0x80(%rbp,%rax,8),%rdi
movswq -0xa2(%rbp),%rax
ff
mov    -0x54(%rbp,%rax,4),%ecx
lea    0xdda(%rip),%rdx
lea    0xdd4(%rip),%rax
cmp    $0xa,%ecx
cmovge %rax,%rdx
movswq -0xa2(%rbp),%rax
ff
mov    -0x54(%rbp,%rax,4),%ecx
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
jmp    11dd <GetCurrentTime+0xad>
movw   $0x0,-0xa2(%rbp)
movswl -0xa2(%rbp),%eax
cmp    $0x3,%eax
jge    12f4 <GetCurrentTime+0x1c4>
movswq -0xa2(%rbp),%rax
ff
cmpq   $0x0,-0xa0(%rbp,%rax,8)
je     12d8 <GetCurrentTime+0x1a8>
movswq -0xa2(%rbp),%rax
ff
mov    -0xa0(%rbp,%rax,8),%rdi
ff
movswq -0xa2(%rbp),%rax
ff
mov    -0x60(%rbp,%rax,4),%ecx
lea    0xd4c(%rip),%rdx
lea    0xd46(%rip),%rax
cmp    $0xa,%ecx
cmovge %rax,%rdx
movswq -0xa2(%rbp),%rax
ff
mov    -0x60(%rbp,%rax,4),%ecx
mov    $0x10,%esi
call   1040 <snprintf@plt>
jmp    12dd <GetCurrentTime+0x1ad>
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
jmp    126a <GetCurrentTime+0x13a>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCurrentTime>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x30(%rsp)
mov    %r8,0x28(%rsp)
mov    %rcx,0x38(%rsp)
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %rdi,%r12
lea    0x44(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <localtime_r@plt>
mov    0xc(%rsp),%r15d
mov    0x10(%rsp),%ebx
mov    0x14(%rsp),%r13d
mov    0x18(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x1c(%rsp),%eax
mov    %rax,0x20(%rsp)
test   %r12,%r12
je     11ba <GetCurrentTime+0x8a>
mov    0x8(%rsp),%ecx
cmp    $0xa,%ecx
lea    0xe5f(%rip),%rax
lea    0xe57(%rip),%rdx
cmovge %rax,%rdx
mov    %r12,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
test   %r14,%r14
je     11e5 <GetCurrentTime+0xb5>
cmp    $0xa,%r15d
lea    0xe37(%rip),%rax
lea    0xe2f(%rip),%rdx
cmovge %rax,%rdx
mov    %r14,%rdi
mov    $0x10,%esi
mov    %r15d,%ecx
call   1040 <snprintf@plt>
test   %rbp,%rbp
je     120e <GetCurrentTime+0xde>
cmp    $0xa,%ebx
lea    0xe0d(%rip),%rax
lea    0xe05(%rip),%rdx
cmovge %rax,%rdx
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %ebx,%ecx
call   1040 <snprintf@plt>
mov    0x28(%rsp),%rdi
test   %rdi,%rdi
je     123c <GetCurrentTime+0x10c>
lea    0x1(%r13),%ecx
cmp    $0x9,%r13d
lea    0xdda(%rip),%rax
lea    0xdd2(%rip),%rdx
cmovge %rax,%rdx
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    0x30(%rsp),%rdi
test   %rdi,%rdi
je     1269 <GetCurrentTime+0x139>
mov    0x4(%rsp),%ecx
cmp    $0xa,%ecx
lea    0xdad(%rip),%rax
lea    0xda5(%rip),%rdx
cmovge %rax,%rdx
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    0x38(%rsp),%rdi
test   %rdi,%rdi
je     129f <GetCurrentTime+0x16f>
mov    0x20(%rsp),%rax
lea    0x76c(%rax),%ecx
cmp    $0xfffff89e,%eax
lea    0xd77(%rip),%rax
lea    0xd6f(%rip),%rdx
cmovge %rax,%rdx
mov    $0x10,%esi
call   1040 <snprintf@plt>
add    $0x48,%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 = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"0%u\00"
define void @GetCurrentTime(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca %struct.tm
%14 = alloca [3 x i32]
%15 = alloca [3 x i32]
%16 = alloca [3 x i8*]
%17 = alloca [3 x i8*]
%18 = alloca i16
%19 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
store i16 0, i16* %18
%20 = load i8*, i8** %7
%21 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 0
store i8* %20, i8** %21
%22 = load i8*, i8** %8
%23 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 1
store i8* %22, i8** %23
%24 = load i8*, i8** %9
%25 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 2
store i8* %24, i8** %25
%26 = load i8*, i8** %11
%27 = getelementptr inbounds [3 x i8*], [3 x i8*]* %17, i64 0, i64 0
store i8* %26, i8** %27
%28 = load i8*, i8** %12
%29 = getelementptr inbounds [3 x i8*], [3 x i8*]* %17, i64 0, i64 1
store i8* %28, i8** %29
%30 = load i8*, i8** %10
%31 = getelementptr inbounds [3 x i8*], [3 x i8*]* %17, i64 0, i64 2
store i8* %30, i8** %31
%32 = call i32 @time(i32* %19)
%33 = call i32 @localtime_r(i32* %19, %struct.tm* %13)
%34 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 0
%35 = load i32, i32* %34
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 0
store i32 %35, i32* %36
%37 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
%38 = load i32, i32* %37
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 1
store i32 %38, i32* %39
%40 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 2
%41 = load i32, i32* %40
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 2
store i32 %41, i32* %42
%43 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 3
%44 = load i32, i32* %43
%45 = add nsw i32 %44, 1
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 0
store i32 %45, i32* %46
%47 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 4
%48 = load i32, i32* %47
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 1
store i32 %48, i32* %49
%50 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 5
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 1900
%53 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 2
store i32 %52, i32* %53
br label %54
54: ; preds = %82, %6
%55 = load i16, i16* %18
%56 = sext i16 %55 to i32
%57 = icmp slt i32 %56, 3
br i1 %57, label %58, label %85
58: ; preds = %54
%59 = load i16, i16* %18
%60 = sext i16 %59 to i64
%61 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 %60
%62 = load i8*, i8** %61
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %65
64: ; preds = %58
br label %82
65: ; preds = %58
%66 = load i16, i16* %18
%67 = sext i16 %66 to i64
%68 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 %67
%69 = load i8*, i8** %68
%70 = load i16, i16* %18
%71 = sext i16 %70 to i64
%72 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = icmp sge i32 %73, 10
%75 = zext i1 %74 to i64
%76 = select i1 %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%77 = load i16, i16* %18
%78 = sext i16 %77 to i64
%79 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 @snprintf(i8* %69, i32 16, i8* %76, i32 %80)
br label %82
82: ; preds = %65, %64
%83 = load i16, i16* %18
%84 = add i16 %83, 1
store i16 %84, i16* %18
br label %54
85: ; preds = %54
store i16 0, i16* %18
br label %86
86: ; preds = %114, %85
%87 = load i16, i16* %18
%88 = sext i16 %87 to i32
%89 = icmp slt i32 %88, 3
br i1 %89, label %90, label %117
90: ; preds = %86
%91 = load i16, i16* %18
%92 = sext i16 %91 to i64
%93 = getelementptr inbounds [3 x i8*], [3 x i8*]* %17, i64 0, i64 %92
%94 = load i8*, i8** %93
%95 = icmp ne i8* %94, null
br i1 %95, label %96, label %113
96: ; preds = %90
%97 = load i16, i16* %18
%98 = sext i16 %97 to i64
%99 = getelementptr inbounds [3 x i8*], [3 x i8*]* %17, i64 0, i64 %98
%100 = load i8*, i8** %99
%101 = load i16, i16* %18
%102 = sext i16 %101 to i64
%103 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 %102
%104 = load i32, i32* %103
%105 = icmp sge i32 %104, 10
%106 = zext i1 %105 to i64
%107 = select i1 %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%108 = load i16, i16* %18
%109 = sext i16 %108 to i64
%110 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = call i32 @snprintf(i8* %100, i32 16, i8* %107, i32 %111)
br label %113
113: ; preds = %96, %90
br label %114
114: ; preds = %113
%115 = load i16, i16* %18
%116 = add i16 %115, 1
store i16 %116, i16* %18
br label %86
117: ; preds = %86
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"0%u\00"
define void @GetCurrentTime(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca %struct.tm
%8 = alloca i32
%9 = bitcast %struct.tm* %7 to i8*
%10 = bitcast i32* %8 to i8*
%11 = call i32 @time(i32* %8)
%12 = call i32 @localtime_r(i32* %8, %struct.tm* %7)
%13 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 2
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 3
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
%22 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 4
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 5
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1900
%27 = icmp eq i8* %0, null
br i1 %27, label %32, label %28
28: ; preds = %6
%29 = icmp sgt i32 %14, 9
%30 = select i1 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%31 = call i32 @snprintf(i8* %0, i32 16, i8* %30, i32 %14)
br label %32
32: ; preds = %6, %28
%33 = icmp eq i8* %1, null
br i1 %33, label %38, label %34
34: ; preds = %32
%35 = icmp sgt i32 %16, 9
%36 = select i1 %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%37 = call i32 @snprintf(i8* %1, i32 16, i8* %36, i32 %16)
br label %38
38: ; preds = %34, %32
%39 = icmp eq i8* %2, null
br i1 %39, label %44, label %40
40: ; preds = %38
%41 = icmp sgt i32 %18, 9
%42 = select i1 %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%43 = call i32 @snprintf(i8* %2, i32 16, i8* %42, i32 %18)
br label %44
44: ; preds = %40, %38
%45 = icmp eq i8* %4, null
br i1 %45, label %50, label %46
46: ; preds = %44
%47 = icmp sgt i32 %20, 8
%48 = select i1 %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%49 = call i32 @snprintf(i8* %4, i32 16, i8* %48, i32 %21)
br label %50
50: ; preds = %44, %46
%51 = icmp eq i8* %5, null
br i1 %51, label %56, label %52
52: ; preds = %50
%53 = icmp sgt i32 %23, 9
%54 = select i1 %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%55 = call i32 @snprintf(i8* %5, i32 16, i8* %54, i32 %23)
br label %56
56: ; preds = %52, %50
%57 = icmp eq i8* %3, null
br i1 %57, label %62, label %58
58: ; preds = %56
%59 = icmp sgt i32 %25, -1891
%60 = select i1 %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%61 = call i32 @snprintf(i8* %3, i32 16, i8* %60, i32 %26)
br label %62
62: ; preds = %58, %56
ret void
}