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

/* Variables and functions */
int /*<<< orphan*/ ctime_r(scalar_t__ *, char *);
int /*<<< orphan*/ dbg(char *, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ get_default_deadline();
scalar_t__ get_license_deadline();
int /*<<< orphan*/ strip_n(int /*<<< orphan*/);
time_t get_latest_deadline(void) {
  time_t def_deadline = 0;
  time_t lic_deadline = 0;
  time_t deadline = 0;
  char timebuf1[64];
  char timebuf2[64];
  def_deadline = get_default_deadline();
  lic_deadline = get_license_deadline();
  dbg("def_deadline = %s lic_deadline=%s\n",
      strip_n(ctime_r(&def_deadline, timebuf1)),
      strip_n(ctime_r(&lic_deadline, timebuf2)));
  deadline =
      ((def_deadline) > (lic_deadline) ? (def_deadline) : (lic_deadline));
  return deadline;
}


x86 assembly (clang, -O0):
<get_latest_deadline>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1060 <get_default_deadline@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_license_deadline@plt>
mov    %rax,-0x10(%rbp)
lea    -0x60(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1050 <ctime_r@plt>
mov    %eax,%edi
call   1070 <strip_n@plt>
mov    %eax,-0xa4(%rbp)
lea    -0xa0(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1050 <ctime_r@plt>
mov    %eax,%edi
call   1070 <strip_n@plt>
mov    -0xa4(%rbp),%esi
mov    %eax,%edx
lea    0xe37(%rip),%rdi
call   1040 <dbg@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    11ec <get_latest_deadline+0x9c>
mov    -0x8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
jmp    11f7 <get_latest_deadline+0xa7>
mov    -0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_latest_deadline>:
push   %rbx
sub    $0x90,%rsp
xor    %eax,%eax
call   1060 <get_default_deadline@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1030 <get_license_deadline@plt>
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
lea    0x50(%rsp),%rsi
call   1050 <ctime_r@plt>
mov    %eax,%edi
call   1070 <strip_n@plt>
mov    %eax,%ebx
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
call   1050 <ctime_r@plt>
mov    %eax,%edi
call   1070 <strip_n@plt>
lea    0xe5e(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <dbg@plt>
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
cmp    %rax,%rcx
cmovg  %rcx,%rax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"def_deadline = %s lic_deadline=%s\0A\00"
define i64 @get_latest_deadline() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca [64 x i8]
%5 = alloca [64 x i8]
store i64 0, i64* %1
store i64 0, i64* %2
store i64 0, i64* %3
%6 = call i64 (...) @get_default_deadline()
store i64 %6, i64* %1
%7 = call i64 (...) @get_license_deadline()
store i64 %7, i64* %2
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = call i32 @ctime_r(i64* %1, i8* %8)
%10 = call i32 @strip_n(i32 %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%12 = call i32 @ctime_r(i64* %2, i8* %11)
%13 = call i32 @strip_n(i32 %12)
%14 = call i32 @dbg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
%15 = load i64, i64* %1
%16 = load i64, i64* %2
%17 = icmp sgt i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = load i64, i64* %1
br label %22
20: ; preds = %0
%21 = load i64, i64* %2
br label %22
22: ; preds = %20, %18
%23 = phi i64 [ %19, %18 ], [ %21, %20 ]
store i64 %23, i64* %3
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@.str = [35 x i8] c"def_deadline = %s lic_deadline=%s\0A\00"
define i64 @get_latest_deadline() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [64 x i8]
%4 = alloca [64 x i8]
%5 = bitcast i64* %1 to i8*
%6 = bitcast i64* %2 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = tail call i64 (...) @get_default_deadline()
store i64 %9, i64* %1
%10 = tail call i64 (...) @get_license_deadline()
store i64 %10, i64* %2
%11 = call i32 @ctime_r(i64* %1, i8* %7)
%12 = call i32 @strip_n(i32 %11)
%13 = call i32 @ctime_r(i64* %2, i8* %8)
%14 = call i32 @strip_n(i32 %13)
%15 = call i32 @dbg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i64, i64* %1
%17 = load i64, i64* %2
%18 = icmp sgt i64 %16, %17
%19 = select i1 %18, i64 %16, i64 %17
ret i64 %19
}