#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 /*<<< orphan*/ u_int32_t;
typedef scalar_t__ time_t;

/* Variables and functions */
char *ctime(scalar_t__ *);
scalar_t__ ntohl(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
char *strchr(char *, char);
void print_time(char *msg, u_int32_t secs, u_int32_t fraq) {
  char *str, *dummy;
  time_t when;
  printf("%s", msg);
  when = ntohl(secs) - (86400U * (365U * 70U + 17U));
  str = ctime(&when);
  dummy = strchr(str, '\n');
  if (dummy)
    *dummy = 0x00;
  printf("%s.%f\n", str, ((double)ntohl(fraq)) / (4295.0 * 1000000.0));
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%edi
call   1060 <ntohl@plt>
movabs $0x83aa7e80,%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11ae <print_time+0x6e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%edi
call   1060 <ntohl@plt>
mov    -0x30(%rbp),%rsi
cvtsi2sd %rax,%xmm0
movsd  0xe31(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe31(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <ntohl@plt>
movabs $0xffffffff7c558180,%rcx
ff ff ff
add    %rax,%rcx
mov    %rcx,(%rsp)
mov    %rsp,%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1190 <print_time+0x50>
movb   $0x0,(%rax)
mov    %ebp,%edi
call   1060 <ntohl@plt>
cvtsi2sd %rax,%xmm0
divsd  0xe5c(%rip),%xmm0
lea    0xe60(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s.%f\0A\00"
define void @print_time(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %5
%13 = call i64 @ntohl(i32 %12)
%14 = sub nsw i64 %13, 2208988800
store i64 %14, i64* %9
%15 = call i8* @ctime(i64* %9)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = call i8* @strchr(i8* %16, i8 signext 10)
store i8* %17, i8** %8
%18 = load i8*, i8** %8
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %3
%21 = load i8*, i8** %8
store i8 0, i8* %21
br label %22
22: ; preds = %20, %3
%23 = load i8*, i8** %7
%24 = load i32, i32* %6
%25 = call i64 @ntohl(i32 %24)
%26 = sitofp i64 %25 to double
%27 = fdiv double %26, 4.295000e+09
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %23, double %27)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s.%f\0A\00"
define void @print_time(i8* %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i64 @ntohl(i32 %1)
%8 = add nsw i64 %7, -2208988800
store i64 %8, i64* %4
%9 = call i8* @ctime(i64* %4)
%10 = call i8* @strchr(i8* dereferenceable(1) %9, i8 signext 10)
%11 = icmp eq i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i8 0, i8* %10
br label %13
13: ; preds = %12, %3
%14 = call i64 @ntohl(i32 %2)
%15 = sitofp i64 %14 to double
%16 = fdiv double %15, 4.295000e+09
%17 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9, double %16)
ret void
}