#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*/ snprintf(char *, int, char *, unsigned long, unsigned long,
                            unsigned long, unsigned long);
void repr_elapsed_time(char *buffer, unsigned long seconds) {
  unsigned long days, hours, minutes;
  days = seconds / (((60) * 60) * 24);
  seconds %= (((60) * 60) * 24);
  hours = seconds / ((60) * 60);
  seconds %= ((60) * 60);
  minutes = seconds / (60);
  seconds %= (60);
  snprintf(buffer, (128) - 1, "%lu:%02lu:%02lu:%02lu", days, hours, minutes,
           seconds);
}


x86 assembly (clang, -O0):
<repr_elapsed_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x10(%rbp),%rax
mov    $0x7f,%esi
lea    0xe54(%rip),%rdx
mov    %rax,(%rsp)
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repr_elapsed_time>:
push   %rax
movabs $0xc22e450672894ab7,%rcx
45 2e c2
mov    %rsi,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0x10,%rcx
imul   $0x15180,%rcx,%rax
sub    %rax,%rsi
mov    $0x91a2b3c5,%r8d
imul   %rsi,%r8
shr    $0x2b,%r8
imul   $0xe10,%r8d,%eax
sub    %eax,%esi
imul   $0x8889,%esi,%r9d
shr    $0x15,%r9d
imul   $0x3c,%r9d,%eax
sub    %eax,%esi
movzwl %si,%eax
mov    %rax,(%rsp)
lea    0xe98(%rip),%rdx
mov    $0x7f,%esi
call   1030 <snprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%lu:%02lu:%02lu:%02lu\00"
define void @repr_elapsed_time(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
%8 = load i64, i64* %4
%9 = udiv i64 %8, 86400
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = urem i64 %10, 86400
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = udiv i64 %12, 3600
store i64 %13, i64* %6
%14 = load i64, i64* %4
%15 = urem i64 %14, 3600
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = udiv i64 %16, 60
store i64 %17, i64* %7
%18 = load i64, i64* %4
%19 = urem i64 %18, 60
store i64 %19, i64* %4
%20 = load i8*, i8** %3
%21 = load i64, i64* %5
%22 = load i64, i64* %6
%23 = load i64, i64* %7
%24 = load i64, i64* %4
%25 = call i32 @snprintf(i8* %20, i32 127, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %21, i64 %22, i64 %23, i64 %24)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%lu:%02lu:%02lu:%02lu\00"
define void @repr_elapsed_time(i8* %0, i64 %1) {
%3 = udiv i64 %1, 86400
%4 = urem i64 %1, 86400
%5 = trunc i64 %4 to i32
%6 = udiv i32 %5, 3600
%7 = zext i32 %6 to i64
%8 = urem i32 %5, 3600
%9 = trunc i32 %8 to i16
%10 = udiv i16 %9, 60
%11 = zext i16 %10 to i64
%12 = urem i16 %9, 60
%13 = zext i16 %12 to i64
%14 = tail call i32 @snprintf(i8* %0, i32 127, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %7, i64 %11, i64 %13)
ret void
}