#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 int64_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void printptss(int64_t pts) {
  if (pts < 0) {
    fprintf(stdout, "-");
    pts = -pts;
  }
  pts = pts / 300;
  pts &= ((0x0000000200000000ULL) - 1);
  fprintf(stdout, "%2d:%02d:%02d.%03d ", (unsigned int)(pts / 90000.) / 3600,
          ((unsigned int)(pts / 90000.) % 3600) / 60,
          ((unsigned int)(pts / 90000.) % 3600) % 60,
          (((unsigned int)(pts / 90.) % 3600000) % 60000) % 1000);
}


x86 assembly (clang, -O0):
<printptss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1144 <printptss+0x34>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x1b4e81b5,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe8b(%rip),%xmm2
movaps %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
mov    %eax,%r8d
mov    %r8d,%eax
mov    $0x91a2b3c5,%ecx
imul   %rcx,%rax
shr    $0x2b,%rax
mov    %eax,-0x8(%rbp)
imul   $0xe10,%eax,%eax
sub    %eax,%r8d
mov    %r8d,%eax
mov    $0x88888889,%ecx
imul   %rcx,%rax
shr    $0x25,%rax
mov    %eax,%ecx
imul   $0x3c,%ecx,%eax
sub    %eax,%r8d
movsd  0xe48(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    $0x36ee80,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%eax
mov    $0xea60,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%eax
mov    $0x3e8,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%r9d
mov    -0x8(%rbp),%edx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printptss>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1130 <printptss+0x20>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
neg    %ebx
mov    %ebx,%eax
imul   $0x1b4e81b5,%rax,%rax
shr    $0x25,%rax
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%edi
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
divsd  0xeaa(%rip),%xmm1
cvttsd2si %xmm1,%rsi
mov    %esi,%eax
mov    $0x91a2b3c5,%edx
imul   %rax,%rdx
shr    $0x2b,%rdx
imul   $0xe10,%edx,%eax
sub    %eax,%esi
imul   $0x8889,%esi,%ecx
shr    $0x15,%ecx
imul   $0x3c,%ecx,%eax
sub    %eax,%esi
divsd  0xe80(%rip),%xmm0
cvttsd2si %xmm0,%rax
movzwl %si,%r8d
mov    %eax,%esi
mov    $0x95217cb1,%ebx
imul   %rsi,%rbx
shr    $0x35,%rbx
imul   $0x36ee80,%ebx,%esi
sub    %esi,%eax
imul   $0x45e7b273,%rax,%rsi
shr    $0x2e,%rsi
imul   $0xea60,%esi,%esi
sub    %esi,%eax
movzwl %ax,%esi
shr    $0x3,%esi
imul   $0x20c5,%esi,%esi
shr    $0x14,%esi
imul   $0x3e8,%esi,%esi
sub    %esi,%eax
movzwl %ax,%r9d
lea    0xe35(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [20 x i8] c"%2d:%02d:%02d.%03d \00"
define void @printptss(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %5, %1
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 300
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = and i64 %14, 8589934591
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
%17 = load i32, i32* @stdout
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = fdiv double %19, 9.000000e+04
%21 = fptoui double %20 to i32
%22 = udiv i32 %21, 3600
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, 9.000000e+04
%26 = fptoui double %25 to i32
%27 = urem i32 %26, 3600
%28 = udiv i32 %27, 60
%29 = load i32, i32* %2
%30 = sitofp i32 %29 to double
%31 = fdiv double %30, 9.000000e+04
%32 = fptoui double %31 to i32
%33 = urem i32 %32, 3600
%34 = urem i32 %33, 60
%35 = load i32, i32* %2
%36 = sitofp i32 %35 to double
%37 = fdiv double %36, 9.000000e+01
%38 = fptoui double %37 to i32
%39 = urem i32 %38, 3600000
%40 = urem i32 %39, 60000
%41 = urem i32 %40, 1000
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %28, i32 %34, i32 %41)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [20 x i8] c"%2d:%02d:%02d.%03d \00"
define void @printptss(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
%9 = udiv i32 %8, 300
%10 = load i32, i32* @stdout
%11 = sitofp i32 %9 to double
%12 = fdiv double %11, 9.000000e+04
%13 = fptoui double %12 to i32
%14 = udiv i32 %13, 3600
%15 = urem i32 %13, 3600
%16 = trunc i32 %15 to i16
%17 = udiv i16 %16, 60
%18 = zext i16 %17 to i32
%19 = urem i16 %16, 60
%20 = zext i16 %19 to i32
%21 = fdiv double %11, 9.000000e+01
%22 = fptoui double %21 to i32
%23 = urem i32 %22, 3600000
%24 = urem i32 %23, 60000
%25 = trunc i32 %24 to i16
%26 = urem i16 %25, 1000
%27 = zext i16 %26 to i32
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %18, i32 %20, i32 %27)
ret void
}