#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 */

/* Variables and functions */
scalar_t__ get_date_time(char *, char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *date, *time;
  char *ts = argv[1];
  if (argc != 2) {
    printf("Usage: %s <yyyy-mm-ddThh:mm:ss-hh:mm>\n", argv[0]);
    return -1;
  }
  if (get_date_time(ts, &date, NULL) == 0) {
    printf("date %s, time %s\n", date);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <main+0x7d>
mov    -0x28(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <get_date_time@plt>
cmp    $0x0,%rax
jne    1196 <main+0x76>
mov    -0x18(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jne    1154 <main+0x34>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1040 <get_date_time@plt>
test   %rax,%rax
jne    1168 <main+0x48>
mov    0x8(%rsp),%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
mov    (%rsi),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s <yyyy-mm-ddThh:mm:ss-hh:mm>\0A\00"
@.str.1 = [18 x i8] c"date %s, time %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %8
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 -1, i32* %3
br label %27
19: ; preds = %2
%20 = load i8*, i8** %8
%21 = call i64 @get_date_time(i8* %20, i8** %6, i32* null)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i8*, i8** %6
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %19
store i32 0, i32* %3
br label %27
27: ; preds = %26, %14
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s <yyyy-mm-ddThh:mm:ss-hh:mm>\0A\00"
@.str.1 = [18 x i8] c"date %s, time %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %17
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @get_date_time(i8* %11, i8** %3, i32* null)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %9, %14, %6
%18 = phi i32 [ -1, %6 ], [ 0, %14 ], [ 0, %9 ]
ret i32 %18
}