void writetime(slot, t) struct slot *slot;
long t;
{
  writetwodig(slot, t / 3600);
  writech(slot, ':');
  writetwodig(slot, t / 60 % 60);
  writech(slot, ':');
  writetwodig(slot, t % 60);
}


x86 assembly (clang, -O0):
<writetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
mov    $0x0,%al
call   1040 <writetwodig@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
mov    $0x0,%al
call   1030 <writech@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rdx,%rsi
mov    $0x0,%al
call   1040 <writetwodig@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
mov    $0x0,%al
call   1030 <writech@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rdx,%rsi
mov    $0x0,%al
call   1040 <writetwodig@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writetime>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
movabs $0x48d159e26af37c05,%rcx
59 d1 48
mov    %rsi,%rax
imul   %rcx
mov    %rdi,%r14
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0xa,%rdx
add    %rdx,%rsi
xor    %eax,%eax
call   1040 <writetwodig@plt>
mov    %r14,%rdi
mov    $0x3a,%esi
xor    %eax,%eax
call   1030 <writech@plt>
movabs $0x8888888888888889,%rcx
88 88 88
mov    %r15,%rax
imul   %rcx
mov    %rdx,%rbx
add    %r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x5,%rbx
add    %rax,%rbx
mov    %rbx,%rax
imul   %rcx
add    %rbx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x3c,%rdx,%rax
mov    %rbx,%rsi
sub    %rax,%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <writetwodig@plt>
mov    %r14,%rdi
mov    $0x3a,%esi
xor    %eax,%eax
call   1030 <writech@plt>
imul   $0x3c,%rbx,%rax
sub    %rax,%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <writetwodig@plt>

LLVM IR (-O0):
%struct.slot = type opaque
define void @writetime(%struct.slot* %0, i64 %1) {
%3 = alloca %struct.slot*
%4 = alloca i64
store %struct.slot* %0, %struct.slot** %3
store i64 %1, i64* %4
%5 = load %struct.slot*, %struct.slot** %3
%6 = load i64, i64* %4
%7 = sdiv i64 %6, 3600
%8 = call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %5, i64 %7)
%9 = load %struct.slot*, %struct.slot** %3
%10 = call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %9, i32 58)
%11 = load %struct.slot*, %struct.slot** %3
%12 = load i64, i64* %4
%13 = sdiv i64 %12, 60
%14 = srem i64 %13, 60
%15 = call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %11, i64 %14)
%16 = load %struct.slot*, %struct.slot** %3
%17 = call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %16, i32 58)
%18 = load %struct.slot*, %struct.slot** %3
%19 = load i64, i64* %4
%20 = srem i64 %19, 60
%21 = call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %18, i64 %20)
ret void
}

LLVM IR (-O2):
%struct.slot = type opaque
define void @writetime(%struct.slot* %0, i64 %1) {
%3 = sdiv i64 %1, 3600
%4 = tail call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %0, i64 %3)
%5 = tail call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %0, i32 58)
%6 = sdiv i64 %1, 60
%7 = srem i64 %6, 60
%8 = tail call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %0, i64 %7)
%9 = tail call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %0, i32 58)
%10 = srem i64 %1, 60
%11 = tail call i32 (%struct.slot*, i64, ...) bitcast (i32 (...)* @writetwodig to i32 (%struct.slot*, i64, ...)*)(%struct.slot* %0, i64 %10)
ret void
}