#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int sekunder, minutter, timer, dage, uger, tid, rest;
  printf("Input venligst hele sekunder: ");
  scanf("%d", &tid);
  sekunder = tid % 60;
  rest = tid / 60;
  minutter = rest % 60;
  rest = rest / 60;
  timer = rest % 24;
  rest = rest / 24;
  dage = rest % 7;
  uger = rest / 7;
  printf("%d uger, %d dage, %d timer, %d minutter og %d sekunder svarer til %d "
         "sekunder.\n",
         uger, dage, timer, minutter, sekunder, tid);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xe4a(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x14(%rsp),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%edx
mov    %eax,%r9d
sub    %edx,%r9d
movslq %ecx,%r8
imul   $0xffffffff88888889,%r8,%rcx
shr    $0x20,%rcx
add    %r8d,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%r8d
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rdx
add    %esi,%edx
shl    $0x3,%edx
lea    (%rdx,%rdx,2),%edx
sub    %edx,%ecx
imul   $0xffffffffc22e4507,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x10,%edx
add    %esi,%edx
movswl %dx,%esi
imul   $0x4925,%esi,%esi
mov    %esi,%edi
shr    $0x1f,%edi
sar    $0x11,%esi
add    %edi,%esi
lea    0x0(,%rsi,8),%edi
sub    %edi,%esi
add    %edx,%esi
movswl %si,%edx
imul   $0x6ef5de4d,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x32,%rsi
add    %edi,%esi
mov    %eax,(%rsp)
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Input venligst hele sekunder: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [80 x i8] c"%d uger, %d dage, %d timer, %d minutter og %d sekunder svarer til %d sekunder.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%11 = load i32, i32* %7
%12 = srem i32 %11, 60
store i32 %12, i32* %2
%13 = load i32, i32* %7
%14 = sdiv i32 %13, 60
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = srem i32 %15, 60
store i32 %16, i32* %3
%17 = load i32, i32* %8
%18 = sdiv i32 %17, 60
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = srem i32 %19, 24
store i32 %20, i32* %4
%21 = load i32, i32* %8
%22 = sdiv i32 %21, 24
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = srem i32 %23, 7
store i32 %24, i32* %5
%25 = load i32, i32* %8
%26 = sdiv i32 %25, 7
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = load i32, i32* %5
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = load i32, i32* %7
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

LLVM IR (-O2):
@.str = [31 x i8] c"Input venligst hele sekunder: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [80 x i8] c"%d uger, %d dage, %d timer, %d minutter og %d sekunder svarer til %d sekunder.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 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), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 60
%7 = sdiv i32 %5, 60
%8 = srem i32 %7, 60
%9 = sdiv i32 %5, 3600
%10 = srem i32 %9, 24
%11 = sdiv i32 %5, 86400
%12 = trunc i32 %11 to i16
%13 = srem i16 %12, 7
%14 = sext i16 %13 to i32
%15 = sdiv i32 %5, 604800
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %14, i32 %10, i32 %8, i32 %6, i32 %5)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}