#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 time_t;

/* Variables and functions */
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ date2nbsec(int, int, int, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ nbsec2date(int, int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int a, j, m;
  time_t n;
  if (2 > argc) {
    printf("USAGE: %s <timestamp>\n", argv[0]);
    exit(0);
  }
  n = atoi(argv[1]);
  nbsec2date(n, &j, &m, &a);
  printf("nbsec2date(%ld) : %d/%d/%d\n", n, j, m, a);
  date2nbsec(j, m, a, &n);
  printf("date2nbsec(%d/%d/%d) : %ld\n", j, m, a, n);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    1190 <main+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <nbsec2date@plt>
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rcx
call   1070 <date2nbsec@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jle    11df <main+0x8f>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,0xc(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
lea    0x8(%rsp),%rcx
mov    %eax,%edi
call   1030 <nbsec2date@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0xe83(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xc(%rsp),%rcx
call   1070 <date2nbsec@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    (%rsi),%rsi
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"USAGE: %s <timestamp>\0A\00"
@.str.1 = [28 x i8] c"nbsec2date(%ld) : %d/%d/%d\0A\00"
@.str.2 = [28 x i8] c"date2nbsec(%d/%d/%d) : %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sgt i32 2, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = call i32 @nbsec2date(i32 %23, i32* %7, i32* %8, i32* %6)
%25 = load i32, i32* %9
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = call i32 @date2nbsec(i32 %30, i32 %31, i32 %32, i32* %9)
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = load i32, i32* %6
%37 = load i32, i32* %9
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %35, i32 %36, i32 %37)
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@.str = [23 x i8] c"USAGE: %s <timestamp>\0A\00"
@.str.1 = [28 x i8] c"nbsec2date(%ld) : %d/%d/%d\0A\00"
@.str.2 = [28 x i8] c"date2nbsec(%d/%d/%d) : %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = icmp slt i32 %0, 2
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
store i32 %19, i32* %6
%20 = call i32 @nbsec2date(i32 %19, i32* %4, i32* %5, i32* %3)
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = load i32, i32* %3
%28 = call i32 @date2nbsec(i32 %25, i32 %26, i32 %27, i32* %6)
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = load i32, i32* %3
%32 = load i32, i32* %6
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %30, i32 %31, i32 %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}