psecs(l) long l;
{
  register int i;
  i = l / 3600;
  if (i) {
    shprintf("%d:", i);
    i = l % 3600;
    p2dig(i / 60);
    goto minsec;
  }
  i = l;
  shprintf("%d", i / 60);
minsec:
  i %= 60;
  shprintf(":");
  p2dig(i);
}


x86 assembly (clang, -O0):
<psecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1184 <psecs+0x64>
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <shprintf@plt>
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    $0x0,%al
call   1040 <p2dig@plt>
jmp    11a6 <psecs+0x86>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <shprintf@plt>
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <shprintf@plt>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1040 <p2dig@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psecs>:
push   %rbx
mov    %rdi,%rbx
movabs $0x48d159e26af37c05,%rcx
59 d1 48
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xa,%rdx
add    %rax,%rdx
test   %edx,%edx
je     1188 <psecs+0x68>
imul   $0xe10,%rdx,%rax
sub    %rax,%rbx
lea    0xea9(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <shprintf@plt>
movswl %bx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %ebx,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movswl %cx,%edi
xor    %eax,%eax
call   1040 <p2dig@plt>
jmp    11b0 <psecs+0x90>
movslq %ebx,%rsi
imul   $0xffffffff88888889,%rsi,%rax
shr    $0x20,%rax
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x5,%esi
add    %eax,%esi
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1030 <shprintf@plt>
movslq %ebx,%rbx
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%ebx
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1030 <shprintf@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <p2dig@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c":\00"
define i32 @psecs(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = sdiv i64 %5, 3600
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %1
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i64, i64* %3
%14 = srem i64 %13, 3600
%15 = trunc i64 %14 to i32
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 60
%18 = call i32 (i32, ...) bitcast (i32 (...)* @p2dig to i32 (i32, ...)*)(i32 %17)
br label %25
19: ; preds = %1
%20 = load i64, i64* %3
%21 = trunc i64 %20 to i32
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = sdiv i32 %22, 60
%24 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %19, %10
%26 = load i32, i32* %4
%27 = srem i32 %26, 60
store i32 %27, i32* %4
%28 = call i32 (i8*, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %4
%30 = call i32 (i32, ...) bitcast (i32 (...)* @p2dig to i32 (i32, ...)*)(i32 %29)
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c":\00"
define i32 @psecs(i64 %0) {
%2 = sdiv i64 %0, 3600
%3 = srem i64 %0, 3600
%4 = trunc i64 %2 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = trunc i64 %3 to i32
%9 = trunc i64 %3 to i16
%10 = sdiv i16 %9, 60
%11 = sext i16 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @p2dig to i32 (i32, ...)*)(i32 %11)
br label %17
13: ; preds = %1
%14 = trunc i64 %0 to i32
%15 = sdiv i32 %14, 60
%16 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %6
%18 = phi i32 [ %8, %6 ], [ %14, %13 ]
%19 = srem i32 %18, 60
%20 = tail call i32 (i8*, ...) bitcast (i32 (...)* @shprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @p2dig to i32 (i32, ...)*)(i32 %19)
ret i32 undef
}