#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*/ EXIT_FAILURE;
long INT_MAX;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ time(scalar_t__ *);
time_t then_time(long mtime) {
  time_t now;
  mtime *= 60 * 60 * 24;
  if (mtime > INT_MAX) {
    fprintf(stderr, "Whoa cowboy %ld is a lot of seconds. Baiing\n", mtime);
    exit(EXIT_FAILURE);
  }
  if (time(&now) == (time_t)(-1)) {
    fprintf(stderr, "Mad time error. Sorry\n");
    exit(EXIT_FAILURE);
  }
  return (now - (int)mtime);
}


x86 assembly (clang, -O0):
<then_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x15180,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
jle    1185 <then_time+0x55>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
cmp    $0xffffffffffffffff,%rax
jne    11bd <then_time+0x8d>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq %ecx,%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<then_time>:
push   %rbx
sub    $0x10,%rsp
imul   $0x15180,%rdi,%rdx
mov    0x2ea5(%rip),%rax
cmp    (%rax),%rdx
jg     117b <then_time+0x4b>
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1040 <time@plt>
cmp    $0xffffffffffffffff,%rax
je     1194 <then_time+0x64>
mov    0x8(%rsp),%rax
movabs $0x1518000000000,%rcx
imul   %rcx,%rbx
sar    $0x20,%rbx
sub    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11ab <then_time+0x7b>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@INT_MAX = global i64 0
@stderr = global i32 0
@.str = [45 x i8] c"Whoa cowboy %ld is a lot of seconds. Baiing\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [23 x i8] c"Mad time error. Sorry\0A\00"
define i64 @then_time(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul nsw i64 %4, 86400
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = load i64, i64* @INT_MAX
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i64, i64* %2
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
%16 = call i64 @time(i64* %3)
%17 = icmp eq i64 %16, -1
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %15
%24 = load i64, i64* %3
%25 = load i64, i64* %2
%26 = trunc i64 %25 to i32
%27 = sext i32 %26 to i64
%28 = sub nsw i64 %24, %27
ret i64 %28
}

LLVM IR (-O2):
@INT_MAX = global i64 0
@stderr = global i32 0
@.str = [45 x i8] c"Whoa cowboy %ld is a lot of seconds. Baiing\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [23 x i8] c"Mad time error. Sorry\0A\00"
define i64 @then_time(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = mul nsw i64 %0, 86400
%5 = load i64, i64* @INT_MAX
%6 = icmp sgt i64 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %4)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = call i64 @time(i64* %2)
%14 = icmp eq i64 %13, -1
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %12
%21 = load i64, i64* %2
%22 = mul i64 %0, 371085174374400
%23 = ashr exact i64 %22, 32
%24 = sub nsw i64 %21, %23
ret i64 %24
}