#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*/ sprintf(char *, char *, unsigned int, unsigned int,
                           unsigned int, unsigned int);
int pr_time(char *outbuf, long time) {
  unsigned long t, qq;
  unsigned dd, hh, mm, ss;
  int c;
  t = time / 100;
  ss = t % 60;
  t /= 60;
  mm = t % 60;
  t /= 60;
  hh = t % 24;
  t /= 24;
  dd = t;
  sprintf(outbuf, "%u- %02u:%02u:%02u\n", dd, hh, mm, ss);
  return c;
}


x86 assembly (clang, -O0):
<pr_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x18,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x18,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
lea    0xe3f(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_time>:
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rsi,%rax
imul   %rcx
add    %rdx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x6,%rsi
add    %rax,%rsi
movabs $0x8888888888888889,%r10
88 88 88
mov    %rsi,%rax
mul    %r10
mov    %rdx,%r8
shr    $0x5,%r8
imul   $0x3c,%r8d,%eax
mov    %rsi,%rcx
mov    %esi,%r9d
sub    %eax,%r9d
mov    %r8,%rax
mul    %r10
shr    $0x5,%rdx
imul   $0x3c,%edx,%eax
sub    %eax,%r8d
shr    $0x4,%rcx
movabs $0x91a2b3c4d5e6f81,%rdx
2b 1a 09
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mov    %rcx,%rax
mul    %rdx
shr    $0x4,%rdx
shl    $0x3,%edx
lea    (%rdx,%rdx,2),%eax
sub    %eax,%ecx
movabs $0xc22e450672894ab7,%rdx
45 2e c2
mov    %rsi,%rax
mul    %rdx
shr    $0x10,%rdx
lea    0xe49(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%u- %02u:%02u:%02u\0A\00"
define i32 @pr_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%12 = load i64, i64* %4
%13 = sdiv i64 %12, 100
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = urem i64 %14, 60
%16 = trunc i64 %15 to i32
store i32 %16, i32* %10
%17 = load i64, i64* %5
%18 = udiv i64 %17, 60
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = urem i64 %19, 60
%21 = trunc i64 %20 to i32
store i32 %21, i32* %9
%22 = load i64, i64* %5
%23 = udiv i64 %22, 60
store i64 %23, i64* %5
%24 = load i64, i64* %5
%25 = urem i64 %24, 24
%26 = trunc i64 %25 to i32
store i32 %26, i32* %8
%27 = load i64, i64* %5
%28 = udiv i64 %27, 24
store i64 %28, i64* %5
%29 = load i64, i64* %5
%30 = trunc i64 %29 to i32
store i32 %30, i32* %7
%31 = load i8*, i8** %3
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = load i32, i32* %10
%36 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33, i32 %34, i32 %35)
%37 = load i32, i32* %11
ret i32 %37
}

LLVM IR (-O2):
@.str = [20 x i8] c"%u- %02u:%02u:%02u\0A\00"
define i32 @pr_time(i8* nocapture writeonly %0, i64 %1) {
%3 = sdiv i64 %1, 100
%4 = urem i64 %3, 60
%5 = trunc i64 %4 to i32
%6 = udiv i64 %3, 60
%7 = urem i64 %6, 60
%8 = trunc i64 %7 to i32
%9 = udiv i64 %3, 3600
%10 = urem i64 %9, 24
%11 = trunc i64 %10 to i32
%12 = udiv i64 %3, 86400
%13 = trunc i64 %12 to i32
%14 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %11, i32 %8, i32 %5)
ret i32 undef
}