#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 */
struct tm {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
  int member_5;
  int member_8;
  int /*<<< orphan*/ member_7;
  int /*<<< orphan*/ member_6;
  int /*<<< orphan*/ member_4;
};

/* Variables and functions */
char *asctime(struct tm *);
int /*<<< orphan*/ mktime(struct tm *);
char *get_time_string(int sec, int min, int hrs, int day, int yr) {
  struct tm tstruct = {sec, min, hrs, day, 0, 100 + yr, 0, 0, -1};
  mktime(&tstruct);
  return asctime(&tstruct);
}


x86 assembly (clang, -O0):
<get_time_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
lea    -0x38(%rbp),%rdi
call   1040 <mktime@plt>
lea    -0x38(%rbp),%rdi
call   1030 <asctime@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_string>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
movl   $0x0,0x18(%rsp)
add    $0x64,%r8d
mov    %r8d,0x1c(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0xffffffff,0x28(%rsp)
ff
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <mktime@plt>
mov    %rbx,%rdi
call   1030 <asctime@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define i8* @get_time_string(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.tm
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
%13 = load i32, i32* %6
store i32 %13, i32* %12
%14 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%15 = load i32, i32* %7
store i32 %15, i32* %14
%16 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 2
%17 = load i32, i32* %8
store i32 %17, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 3
%19 = load i32, i32* %9
store i32 %19, i32* %18
%20 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 4
store i32 0, i32* %20
%21 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 5
%22 = load i32, i32* %10
%23 = add nsw i32 100, %22
store i32 %23, i32* %21
%24 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 6
store i32 0, i32* %24
%25 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 7
store i32 0, i32* %25
%26 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 8
store i32 -1, i32* %26
%27 = call i32 @mktime(%struct.tm* %11)
%28 = call i8* @asctime(%struct.tm* %11)
ret i8* %28
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define i8* @get_time_string(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.tm
%7 = bitcast %struct.tm* %6 to i8*
%8 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
store i32 %1, i32* %9
%10 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
store i32 %2, i32* %10
%11 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 3
store i32 %3, i32* %11
%12 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 4
store i32 0, i32* %12
%13 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 5
%14 = add nsw i32 %4, 100
store i32 %14, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 6
store i32 0, i32* %15
%16 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 7
store i32 0, i32* %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 8
store i32 -1, i32* %17
%18 = call i32 @mktime(%struct.tm* %6)
%19 = call i8* @asctime(%struct.tm* %6)
ret i8* %19
}