#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 */
int /*<<< orphan*/ printf(char *, char *, long, long, long);
void print_uptime(char *label, long time) {
  const long minute = 60;
  const long hour = minute * 60;
  const long day = hour * 24;
  printf(" %s%02ld day(s) %02ld hour(s) %02ld minute(s)\n", label, time / day,
         (time % day) / hour, (time % hour) / minute);
  return;
}


x86 assembly (clang, -O0):
<print_uptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x3c,-0x18(%rbp)
movq   $0xe10,-0x20(%rbp)
movq   $0x15180,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    $0x15180,%ecx
cqto
idiv   %rcx
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x15180,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    $0xe10,%edi
cqto
idiv   %rdi
mov    %rdx,%rax
mov    $0x3c,%edi
cqto
idiv   %rdi
mov    -0x30(%rbp),%rdx
mov    %rax,%r8
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uptime>:
mov    %rdi,%r10
movabs $0x1845c8a0ce512957,%rcx
c8 45 18
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%r9
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xd,%r9
add    %rax,%r9
imul   $0x15180,%r9,%rax
mov    %rsi,%rcx
sub    %rax,%rcx
movslq %ecx,%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
movslq %eax,%rcx
movabs $0x48d159e26af37c05,%rdx
59 d1 48
mov    %rsi,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%rdx
add    %eax,%edx
imul   $0xe10,%edx,%eax
sub    %eax,%esi
movswl %si,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %esi,%eax
movzwl %ax,%eax
movswl %ax,%edx
shr    $0xf,%eax
sar    $0x5,%edx
add    %eax,%edx
movswq %dx,%r8
lea    0xe56(%rip),%rdi
mov    %r10,%rsi
mov    %r9,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c" %s%02ld day(s) %02ld hour(s) %02ld minute(s)\0A\00"
define void @print_uptime(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 60, i64* %5
store i64 3600, i64* %6
store i64 86400, i64* %7
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = sdiv i64 %9, 86400
%11 = load i64, i64* %4
%12 = srem i64 %11, 86400
%13 = sdiv i64 %12, 3600
%14 = load i64, i64* %4
%15 = srem i64 %14, 3600
%16 = sdiv i64 %15, 60
%17 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %8, i64 %10, i64 %13, i64 %16)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c" %s%02ld day(s) %02ld hour(s) %02ld minute(s)\0A\00"
define void @print_uptime(i8* %0, i64 %1) {
%3 = sdiv i64 %1, 86400
%4 = srem i64 %1, 86400
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %5, 3600
%7 = sext i32 %6 to i64
%8 = srem i64 %1, 3600
%9 = trunc i64 %8 to i16
%10 = sdiv i16 %9, 60
%11 = sext i16 %10 to i64
%12 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %3, i64 %7, i64 %11)
ret void
}