#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 */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main(void) {
  long x, t, m, s;
  int a = 3600;
  int b = 60;
  printf("Indtast antal af sekunder: \n");
  scanf("%d", &x);
  t = x / a;
  m = (x % a) / b;
  s = x % b;
  printf("%d timer,%d minutter,%d sekunder \n", t, m, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe10,-0x2c(%rbp)
movl   $0x3c,-0x30(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
movslq -0x30(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rcx
movabs $0x48d159e26af37c05,%rdx
59 d1 48
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0xa,%rdx
add    %rdx,%rsi
imul   $0xe10,%esi,%eax
mov    %ecx,%edx
sub    %eax,%edx
movswl %dx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %edx,%eax
movzwl %ax,%eax
movswl %ax,%edx
shr    $0xf,%eax
sar    $0x5,%edx
add    %eax,%edx
movswq %dx,%r8
movabs $0x8888888888888889,%rdx
88 88 88
mov    %rcx,%rax
imul   %rdx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x3c,%rdx,%rax
sub    %rax,%rcx
lea    0xe3c(%rip),%rdi
mov    %r8,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Indtast antal af sekunder: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"%d timer,%d minutter,%d sekunder \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 3600, i32* %6
store i32 60, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%10 = load i64, i64* %2
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = sdiv i64 %10, %12
store i64 %13, i64* %3
%14 = load i64, i64* %2
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = srem i64 %14, %16
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = sdiv i64 %17, %19
store i64 %20, i64* %4
%21 = load i64, i64* %2
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = srem i64 %21, %23
store i64 %24, i64* %5
%25 = load i64, i64* %3
%26 = load i64, i64* %4
%27 = load i64, i64* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 %25, i64 %26, i64 %27)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"%d timer,%d minutter,%d sekunder \0A\00"
@str = [28 x i8] c"Indtast antal af sekunder: \00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = sdiv i64 %5, 3600
%7 = srem i64 %5, 3600
%8 = trunc i64 %7 to i16
%9 = sdiv i16 %8, 60
%10 = sext i16 %9 to i64
%11 = srem i64 %5, 60
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 %6, i64 %10, i64 %11)
ret i32 0
}