#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *args[]) {
  double secs;
  int h, m;
  if (argc < 2) {
    printf("Usage: %s secs\n"
           "Prints the amount of hours, minutes and seconds (up until the "
           "decimal case).\n",
           args[0]);
    return 1;
  }
  secs = atof(args[1]);
  h = (int)secs / 3600;
  m = (int)secs / 60 - h * 60;
  secs -= h * 3600 + m * 60;
  printf("%d %d %.2f\n", h, m, secs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d8 <main+0xb8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
imul   $0x3c,-0x1c(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
imul   $0xe10,-0x1c(%rbp),%eax
imul   $0x3c,-0x20(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xe93(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113e <main+0x1e>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%eax
cltq
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x5,%ecx
add    %eax,%ecx
imul   $0xffffffc4,%esi,%edx
add    %ecx,%edx
imul   $0xe10,%esi,%eax
imul   $0x3c,%edx,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [93 x i8] c"Usage: %s secs\0APrints the amount of hours, minutes and seconds (up until the decimal case).\0A\00"
@.str.1 = [12 x i8] c"%d %d %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 1, i32* %3
br label %42
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call double @atof(i8* %19)
store double %20, double* %6
%21 = load double, double* %6
%22 = fptosi double %21 to i32
%23 = sdiv i32 %22, 3600
store i32 %23, i32* %7
%24 = load double, double* %6
%25 = fptosi double %24 to i32
%26 = sdiv i32 %25, 60
%27 = load i32, i32* %7
%28 = mul nsw i32 %27, 60
%29 = sub nsw i32 %26, %28
store i32 %29, i32* %8
%30 = load i32, i32* %7
%31 = mul nsw i32 %30, 3600
%32 = load i32, i32* %8
%33 = mul nsw i32 %32, 60
%34 = add nsw i32 %31, %33
%35 = sitofp i32 %34 to double
%36 = load double, double* %6
%37 = fsub double %36, %35
store double %37, double* %6
%38 = load i32, i32* %7
%39 = load i32, i32* %8
%40 = load double, double* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %39, double %40)
store i32 0, i32* %3
br label %42
42: ; preds = %16, %11
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str = [93 x i8] c"Usage: %s secs\0APrints the amount of hours, minutes and seconds (up until the decimal case).\0A\00"
@.str.1 = [12 x i8] c"%d %d %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %22
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call double @atof(i8* %9)
%11 = fptosi double %10 to i32
%12 = sdiv i32 %11, 3600
%13 = sdiv i32 %11, 60
%14 = mul nsw i32 %12, -60
%15 = add nsw i32 %14, %13
%16 = mul nsw i32 %12, 3600
%17 = mul nsw i32 %15, 60
%18 = add nsw i32 %17, %16
%19 = sitofp i32 %18 to double
%20 = fsub double %10, %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %15, double %20)
br label %22
22: ; preds = %7, %4
%23 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %23
}