#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_isdst;
  int /*<<< orphan*/ tm_sec;
  int /*<<< orphan*/ tm_min;
  int /*<<< orphan*/ tm_hour;
  int /*<<< orphan*/ tm_mday;
};

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ bindtextdomain(char *, char *);
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *gettext(char *);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ textdomain(char *);
int main(void) {
  struct tm tm;
  time_t then;
  setlocale(LC_ALL, "");
  bindtextdomain("echodate", ".");
  textdomain("echodate");
  printf("%s", gettext("Enter a Date/time as YYYY/MM/DD HH:MM:SS : "));
  scanf("%d/%d/%d %d:%d:%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour,
        &tm.tm_min, &tm.tm_sec);
  tm.tm_year -= 1900;
  tm.tm_mon -= 1;
  tm.tm_isdst = -1;
  then = mktime(&tm);
  printf(gettext("Got: %s"), ctime(&then));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1090 <setlocale@plt>
lea    0xe45(%rip),%rdi
lea    0xe47(%rip),%rsi
call   1050 <bindtextdomain@plt>
lea    0xe32(%rip),%rdi
call   1030 <textdomain@plt>
lea    0xe31(%rip),%rdi
call   1060 <gettext@plt>
mov    %rax,%rsi
lea    0xe65(%rip),%rdi
call   1070 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    -0x20(%rbp),%rcx
add    $0x18,%rcx
lea    -0x20(%rbp),%r8
add    $0x14,%r8
lea    -0x20(%rbp),%r9
add    $0x10,%r9
lea    -0x20(%rbp),%rax
add    $0xc,%rax
lea    0xe16(%rip),%rdi
mov    %rax,(%rsp)
call   10a0 <scanf@plt>
mov    -0x20(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1080 <mktime@plt>
mov    %eax,-0x24(%rbp)
lea    0xdf1(%rip),%rdi
call   1060 <gettext@plt>
mov    %rax,-0x30(%rbp)
lea    -0x24(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1090 <setlocale@plt>
lea    0xe4f(%rip),%rbx
lea    0xe51(%rip),%rsi
mov    %rbx,%rdi
call   1050 <bindtextdomain@plt>
mov    %rbx,%rdi
call   1030 <textdomain@plt>
lea    0xe3c(%rip),%rdi
call   1060 <gettext@plt>
lea    0xe73(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
lea    0x14(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
lea    0x1c(%rsp),%rax
mov    %rax,(%rsp)
lea    0xe30(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   10a0 <scanf@plt>
addl   $0xfffff894,0x10(%rsp)
ff
addl   $0xffffffff,0x14(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
mov    %rbx,%rdi
call   1080 <mktime@plt>
mov    %eax,0xc(%rsp)
lea    0xe0d(%rip),%rdi
call   1060 <gettext@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"echodate\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [44 x i8] c"Enter a Date/time as YYYY/MM/DD HH:MM:SS : \00"
@.str.5 = [18 x i8] c"%d/%d/%d %d:%d:%d\00"
@.str.6 = [8 x i8] c"Got: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @bindtextdomain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @textdomain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = call i8* @gettext(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%11 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
%12 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 6
%13 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
%14 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
%15 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%18 = load i32, i32* %17
%19 = sub nsw i32 %18, 1900
store i32 %19, i32* %17
%20 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
%21 = load i32, i32* %20
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %20
%23 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
store i32 -1, i32* %23
%24 = call i32 @mktime(%struct.tm* %2)
store i32 %24, i32* %3
%25 = call i8* @gettext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%26 = call i8* @ctime(i32* %3)
%27 = call i32 @printf(i8* %25, i8* %26)
%28 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"echodate\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [44 x i8] c"Enter a Date/time as YYYY/MM/DD HH:MM:SS : \00"
@.str.5 = [18 x i8] c"%d/%d/%d %d:%d:%d\00"
@.str.6 = [8 x i8] c"Got: %s\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = bitcast %struct.tm* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @bindtextdomain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @textdomain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i8* @gettext(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%12 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 1
%13 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 6
%14 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
%15 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
%16 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 3
%17 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16)
%18 = load i32, i32* %11
%19 = add nsw i32 %18, -1900
store i32 %19, i32* %11
%20 = load i32, i32* %12
%21 = add nsw i32 %20, -1
store i32 %21, i32* %12
%22 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 2
store i32 -1, i32* %22
%23 = call i32 @mktime(%struct.tm* %1)
store i32 %23, i32* %2
%24 = call i8* @gettext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%25 = call i8* @ctime(i32* %2)
%26 = call i32 @printf(i8* %24, i8* %25)
%27 = call i32 @exit(i32 0)
unreachable
}