#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 *, unsigned int, ...);
unsigned int strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  unsigned int t, days, hours, minutes, seconds, ms;
  t = strtoul(argv[1], NULL, 10);
  ms = t % 1000;
  t /= 1000;
  printf("%d s\n", t);
  days = t / 86400;
  t -= (days * 86400);
  printf("%d s\n", t);
  hours = t / 3600;
  t -= (hours * 3600);
  printf("%d s\n", t);
  minutes = t / 60;
  t -= (minutes * 60);
  printf("%d s\n", t);
  seconds = t;
  printf("%d days %d hours %d minutes %d seconds %d milliseconds\n", days,
         hours, minutes, seconds, ms);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
imul   $0x15180,-0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x1c(%rbp)
imul   $0xe10,-0x1c(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x20(%rbp)
imul   $0x3c,-0x20(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%r15d
mov    %eax,%ebx
imul   $0x10624dd3,%rbx,%rbp
shr    $0x26,%rbp
imul   $0x3e8,%ebp,%eax
sub    %eax,%r15d
lea    0xea5(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
imul   $0x31b5d43b,%rbx,%r12
shr    $0x38,%r12
imul   $0xfffeae80,%r12d,%ebx
add    %ebp,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x91a2b3c5,%r13d
imul   %rbx,%r13
shr    $0x2b,%r13
imul   $0xfffff1f0,%r13d,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x88888889,%ebx
imul   %rbp,%rbx
shr    $0x25,%rbx
imul   $0xffffffc4,%ebx,%r14d
add    %ebp,%r14d
lea    0xe3b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe30(%rip),%rdi
mov    %r12d,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d s\0A\00"
@.str.1 = [56 x i8] c"%d days %d hours %d minutes %d seconds %d milliseconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strtoul(i8* %14, i32* null, i32 10)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = urem i32 %16, 1000
store i32 %17, i32* %11
%18 = load i32, i32* %6
%19 = udiv i32 %18, 1000
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %6
%23 = udiv i32 %22, 86400
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = mul i32 %24, 86400
%26 = load i32, i32* %6
%27 = sub i32 %26, %25
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %6
%31 = udiv i32 %30, 3600
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = mul i32 %32, 3600
%34 = load i32, i32* %6
%35 = sub i32 %34, %33
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %6
%39 = udiv i32 %38, 60
store i32 %39, i32* %9
%40 = load i32, i32* %9
%41 = mul i32 %40, 60
%42 = load i32, i32* %6
%43 = sub i32 %42, %41
store i32 %43, i32* %6
%44 = load i32, i32* %6
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %6
store i32 %46, i32* %10
%47 = load i32, i32* %7
%48 = load i32, i32* %8
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = load i32, i32* %11
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %47, i32 %48, i32 %49, i32 %50, i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d s\0A\00"
@.str.1 = [56 x i8] c"%d days %d hours %d minutes %d seconds %d milliseconds\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtoul(i8* nocapture %4, i32* null, i32 10)
%6 = urem i32 %5, 1000
%7 = udiv i32 %5, 1000
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = udiv i32 %5, 86400000
%10 = mul nsw i32 %9, -86400
%11 = add nsw i32 %10, %7
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = udiv i32 %11, 3600
%14 = mul i32 %13, -3600
%15 = add i32 %14, %11
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = udiv i32 %15, 60
%18 = mul i32 %17, -60
%19 = add i32 %18, %15
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %13, i32 %17, i32 %19, i32 %6)
ret i32 0
}