#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 abs(int);
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
scalar_t__ time(int /*<<< orphan*/ *);
char *ytht_Difftime(time_t compared_time) {
  static char ret[64];
  time_t now = time(NULL);
  int now_i = (int)now;
  int tgt_i = (int)compared_time;
  int diff_i = abs(now_i - tgt_i);
  if (diff_i < 60) {
    sprintf(ret, "%d\xC3\xEB\xD6\xD3%s", diff_i,
            (now_i > tgt_i) ? "\xC7\xB0" : "\xBA\xF3");
  } else if (diff_i < 3600) {
    sprintf(ret, "%d\xB7\xD6\xD6\xD3%s", diff_i / 60,
            (now_i > tgt_i) ? "\xC7\xB0" : "\xBA\xF3");
  } else if (diff_i < 86400) {
    sprintf(ret, "%d\xD0\xA1\xCA\xB1%s", diff_i / 3600,
            (now_i > tgt_i) ? "\xC7\xB0" : "\xBA\xF3");
  } else {
    sprintf(ret, "%d\xCC\xEC%s", diff_i / 86400,
            (now_i > tgt_i) ? "\xC7\xB0" : "\xBA\xF3");
  }
  return ret;
}


x86 assembly (clang, -O0):
<ytht_Difftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
sub    -0x18(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x3c,-0x1c(%rbp)
jge    11a4 <ytht_Difftime+0x74>
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
lea    0xe8d(%rip),%rcx
lea    0xe83(%rip),%rax
cmp    %edi,%esi
cmovg  %rax,%rcx
lea    0x2ebd(%rip),%rdi
lea    0xe66(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1280 <ytht_Difftime+0x150>
cmpl   $0xe10,-0x1c(%rbp)
jge    11f0 <ytht_Difftime+0xc0>
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
lea    0xe41(%rip),%rcx
lea    0xe37(%rip),%rax
cmp    %edi,%esi
cmovg  %rax,%rcx
lea    0x2e71(%rip),%rdi
lea    0xe29(%rip),%rsi
call   1050 <sprintf@plt>
jmp    127b <ytht_Difftime+0x14b>
cmpl   $0x15180,-0x1c(%rbp)
jge    123c <ytht_Difftime+0x10c>
mov    -0x1c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
lea    0xdf5(%rip),%rcx
lea    0xdeb(%rip),%rax
cmp    %edi,%esi
cmovg  %rax,%rcx
lea    0x2e25(%rip),%rdi
lea    0xde6(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1276 <ytht_Difftime+0x146>
mov    -0x1c(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
lea    0xdb6(%rip),%rcx
lea    0xdac(%rip),%rax
cmp    %edi,%esi
cmovg  %rax,%rcx
lea    0x2de6(%rip),%rdi
lea    0xdb0(%rip),%rsi
call   1050 <sprintf@plt>
jmp    127b <ytht_Difftime+0x14b>
jmp    1280 <ytht_Difftime+0x150>
lea    0x2dc9(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ytht_Difftime>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
mov    %ecx,%edx
neg    %edx
cmovs  %ecx,%edx
cmp    $0x3b,%edx
ja     1162 <ytht_Difftime+0x42>
cmp    %ebx,%eax
lea    0xec5(%rip),%rax
lea    0xec1(%rip),%rcx
cmovg  %rax,%rcx
lea    0x2eea(%rip),%rdi
lea    0xea3(%rip),%rsi
jmp    1204 <ytht_Difftime+0xe4>
cmp    $0xe0f,%edx
ja     119a <ytht_Difftime+0x7a>
movzwl %dx,%ecx
imul   $0x8889,%ecx,%edx
shr    $0x15,%edx
cmp    %ebx,%eax
lea    0xe8a(%rip),%rax
lea    0xe86(%rip),%rcx
cmovg  %rax,%rcx
lea    0x2eaf(%rip),%rdi
lea    0xe77(%rip),%rsi
jmp    1204 <ytht_Difftime+0xe4>
mov    %edx,%ecx
cmp    $0x1517f,%edx
ja     11d5 <ytht_Difftime+0xb5>
mov    $0x91a2b3c5,%edx
imul   %rcx,%rdx
shr    $0x2b,%rdx
cmp    %ebx,%eax
lea    0xe4f(%rip),%rax
lea    0xe4b(%rip),%rcx
cmovg  %rax,%rcx
lea    0x2e74(%rip),%rdi
lea    0xe45(%rip),%rsi
jmp    1204 <ytht_Difftime+0xe4>
mov    $0xc22e4507,%edx
imul   %rcx,%rdx
shr    $0x30,%rdx
cmp    %ebx,%eax
lea    0xe1e(%rip),%rax
lea    0xe1a(%rip),%rcx
cmovg  %rax,%rcx
lea    0x2e43(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2e30(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@ytht_Difftime.ret = internal global [64 x i8] zeroinitializer
@.str = [9 x i8] c"%d\C3\EB\D6\D3%s\00"
@.str.1 = [3 x i8] c"\C7\B0\00"
@.str.2 = [3 x i8] c"\BA\F3\00"
@.str.3 = [9 x i8] c"%d\B7\D6\D6\D3%s\00"
@.str.4 = [9 x i8] c"%d\D0\A1\CA\B1%s\00"
@.str.5 = [7 x i8] c"%d\CC\EC%s\00"
define i8* @ytht_Difftime(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %2
%7 = call i64 @time(i32* null)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = call i32 @abs(i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 60
br i1 %17, label %18, label %26
18: ; preds = %1
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = icmp sgt i32 %20, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%25 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %19, i8* %24)
br label %61
26: ; preds = %1
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 3600
br i1 %28, label %29, label %38
29: ; preds = %26
%30 = load i32, i32* %6
%31 = sdiv i32 %30, 60
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = icmp sgt i32 %32, %33
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%37 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %31, i8* %36)
br label %60
38: ; preds = %26
%39 = load i32, i32* %6
%40 = icmp slt i32 %39, 86400
br i1 %40, label %41, label %50
41: ; preds = %38
%42 = load i32, i32* %6
%43 = sdiv i32 %42, 3600
%44 = load i32, i32* %4
%45 = load i32, i32* %5
%46 = icmp sgt i32 %44, %45
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%49 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %43, i8* %48)
br label %59
50: ; preds = %38
%51 = load i32, i32* %6
%52 = sdiv i32 %51, 86400
%53 = load i32, i32* %4
%54 = load i32, i32* %5
%55 = icmp sgt i32 %53, %54
%56 = zext i1 %55 to i64
%57 = select i1 %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%58 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %52, i8* %57)
br label %59
59: ; preds = %50, %41
br label %60
60: ; preds = %59, %29
br label %61
61: ; preds = %60, %18
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@ytht_Difftime.ret = internal global [64 x i8] zeroinitializer
@.str = [9 x i8] c"%d\C3\EB\D6\D3%s\00"
@.str.1 = [3 x i8] c"\C7\B0\00"
@.str.2 = [3 x i8] c"\BA\F3\00"
@.str.3 = [9 x i8] c"%d\B7\D6\D6\D3%s\00"
@.str.4 = [9 x i8] c"%d\D0\A1\CA\B1%s\00"
@.str.5 = [7 x i8] c"%d\CC\EC%s\00"
define i8* @ytht_Difftime(i64 %0) {
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = trunc i64 %0 to i32
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%7 = icmp ult i32 %6, 60
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = icmp sgt i32 %3, %4
%10 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%11 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %10)
br label %33
12: ; preds = %1
%13 = icmp ult i32 %6, 3600
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = trunc i32 %6 to i16
%16 = udiv i16 %15, 60
%17 = zext i16 %16 to i32
%18 = icmp sgt i32 %3, %4
%19 = select i1 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%20 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %17, i8* %19)
br label %33
21: ; preds = %12
%22 = icmp ult i32 %6, 86400
br i1 %22, label %23, label %28
23: ; preds = %21
%24 = udiv i32 %6, 3600
%25 = icmp sgt i32 %3, %4
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%27 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %24, i8* %26)
br label %33
28: ; preds = %21
%29 = udiv i32 %6, 86400
%30 = icmp sgt i32 %3, %4
%31 = select i1 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%32 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %29, i8* %31)
br label %33
33: ; preds = %14, %28, %23, %8
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ytht_Difftime.ret, i64 0, i64 0)
}