#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
void seconds_since_midnight_into_hms(uint32_t seconds, uint8_t *pHours,
                                     uint8_t *pMinutes, uint8_t *pSeconds) {
  uint8_t hour = 0;
  uint8_t minute = 0;
  hour = (uint8_t)(seconds / (60 * 60));
  seconds -= (hour * 60 * 60);
  minute = (uint8_t)(seconds / 60);
  seconds -= (minute * 60);
  if (pHours)
    *pHours = hour;
  if (pMinutes)
    *pMinutes = minute;
  if (pSeconds)
    *pSeconds = (uint8_t)seconds;
}


x86 assembly (clang, -O0):
<seconds_since_midnight_into_hms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
imul   $0x3c,-0x24(%rbp),%eax
imul   $0x3c,%eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
imul   $0x3c,-0x28(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <seconds_since_midnight_into_hms+0x6c>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1180 <seconds_since_midnight_into_hms+0x80>
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1194 <seconds_since_midnight_into_hms+0x94>
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_since_midnight_into_hms>:
movslq %edi,%r9
imul   $0xffffffff91a2b3c5,%r9,%rdi
shr    $0x20,%rdi
add    %r9d,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0xb,%edi
add    %eax,%edi
imul   $0xfffff1f0,%edi,%r8d
add    %r9d,%r8d
movslq %r8d,%r10
imul   $0xffffffff88888889,%r10,%rax
shr    $0x20,%rax
add    %eax,%r10d
mov    %r10d,%r9d
shr    $0x1f,%r9d
sar    $0x5,%r10d
test   %rsi,%rsi
je     1148 <seconds_since_midnight_into_hms+0x48>
mov    %edi,(%rsi)
add    %r9d,%r10d
test   %rdx,%rdx
je     1153 <seconds_since_midnight_into_hms+0x53>
mov    %r10d,(%rdx)
test   %rcx,%rcx
je     1161 <seconds_since_midnight_into_hms+0x61>
imul   $0xffffffc4,%r10d,%eax
add    %r8d,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @seconds_since_midnight_into_hms(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
store i32 0, i32* %10
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 3600
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = mul nsw i32 %13, 60
%15 = mul nsw i32 %14, 60
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = sdiv i32 %18, 60
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = mul nsw i32 %20, 60
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, %21
store i32 %23, i32* %5
%24 = load i32*, i32** %6
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %4
%27 = load i32, i32* %9
%28 = load i32*, i32** %6
store i32 %27, i32* %28
br label %29
29: ; preds = %26, %4
%30 = load i32*, i32** %7
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %10
%34 = load i32*, i32** %7
store i32 %33, i32* %34
br label %35
35: ; preds = %32, %29
%36 = load i32*, i32** %8
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %5
%40 = load i32*, i32** %8
store i32 %39, i32* %40
br label %41
41: ; preds = %38, %35
ret void
}

LLVM IR (-O2):
define void @seconds_since_midnight_into_hms(i32 %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = sdiv i32 %0, 3600
%6 = mul nsw i32 %5, -3600
%7 = add i32 %6, %0
%8 = sdiv i32 %7, 60
%9 = mul nsw i32 %8, -60
%10 = add i32 %9, %7
%11 = icmp eq i32* %1, null
br i1 %11, label %13, label %12
12: ; preds = %4
store i32 %5, i32* %1
br label %13
13: ; preds = %12, %4
%14 = icmp eq i32* %2, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 %8, i32* %2
br label %16
16: ; preds = %15, %13
%17 = icmp eq i32* %3, null
br i1 %17, label %19, label %18
18: ; preds = %16
store i32 %10, i32* %3
br label %19
19: ; preds = %18, %16
ret void
}