#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 dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void record_time(char *log_date_and_time) {
  int iii = 0;
  for (iii = 0; iii < 50; ++iii) {
    log_date_and_time[iii] = 0;
  }
  time_t rawtime;
  struct tm *stm;
  time(&rawtime);
  stm = localtime(&rawtime);
  strftime(log_date_and_time, 50, "%d-%m-%Y %H:%M", stm);
}


x86 assembly (clang, -O0):
<record_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    116e <record_time+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <record_time+0x1a>
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x32,%esi
lea    0xe68(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<record_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movw   $0x0,0x30(%rdi)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xe99(%rip),%rdx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%d-%m-%Y %H:%M\00"
define void @record_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.tm*
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = call i32 @time(i32* %4)
%19 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %19, %struct.tm** %5
%20 = load i8*, i8** %2
%21 = load %struct.tm*, %struct.tm** %5
%22 = call i32 @strftime(i8* %20, i32 50, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %21)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%d-%m-%Y %H:%M\00"
define void @record_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 50, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}