#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() {
  long startSeconds;
  printf("Insira um numero: ");
  scanf("%ld", &startSeconds);
  int days, hours, minutes, seconds;
  seconds = startSeconds;
  minutes = seconds / 60;
  seconds -= minutes * 60;
  hours = minutes / 60;
  minutes -= hours * 60;
  days = hours / 24;
  hours -= days * 24;
  printf("%ld segundo%s corresponde%s a %d dia%s, %d hora%s, %d minuto%s e %d "
         "segundo%s.\n",
         startSeconds, startSeconds == 1 ? "" : "s",
         startSeconds == 1 ? "" : "m", days, days == 1 ? "" : "s", hours,
         hours == 1 ? "" : "s", minutes, minutes == 1 ? "" : "s", seconds,
         seconds == 1 ? "" : "s");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
movl   $0x0,-0x24(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c(%rbp)
imul   $0x3c,-0x3c(%rbp),%ecx
mov    -0x40(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
imul   $0x3c,-0x38(%rbp),%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
imul   $0x18,-0x34(%rbp),%ecx
mov    -0x38(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xeaf(%rip),%rdx
lea    0xea7(%rip),%rax
cmp    $0x1,%rcx
cmove  %rax,%rdx
mov    -0x30(%rbp),%rdi
lea    0xe97(%rip),%rcx
lea    0xe8d(%rip),%rax
cmp    $0x1,%rdi
cmove  %rax,%rcx
mov    -0x34(%rbp),%r8d
mov    -0x34(%rbp),%edi
lea    0xe78(%rip),%r9
lea    0xe70(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r9
mov    -0x38(%rbp),%r15d
mov    -0x38(%rbp),%edi
lea    0xe5c(%rip),%r14
lea    0xe54(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r14
mov    -0x3c(%rbp),%ebx
mov    -0x3c(%rbp),%edi
lea    0xe41(%rip),%r11
lea    0xe39(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r11
mov    -0x40(%rbp),%r10d
mov    -0x40(%rbp),%r12d
lea    0xe24(%rip),%rax
lea    0xe1c(%rip),%rdi
cmp    $0x1,%r12d
cmove  %rdi,%rax
lea    0xdbe(%rip),%rdi
mov    %r15d,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %rax,0x28(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
movslq %esi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0xffffffc4,%ecx,%r11d
add    %eax,%r11d
imul   $0xffffffff91a2b3c5,%rax,%r10
shr    $0x20,%r10
add    %eax,%r10d
mov    %r10d,%edx
shr    $0x1f,%edx
sar    $0xb,%r10d
add    %edx,%r10d
imul   $0xffffffc4,%r10d,%r14d
add    %ecx,%r14d
imul   $0xffffffffc22e4507,%rax,%r8
shr    $0x20,%r8
add    %eax,%r8d
mov    %r8d,%ecx
shr    $0x1f,%ecx
sar    $0x10,%r8d
add    %ecx,%r8d
lea    0x0(,%r8,8),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%r10d
cmp    $0x1,%rsi
lea    0xea6(%rip),%rdi
lea    0xea0(%rip),%rbx
mov    %rbx,%rdx
cmove  %rdi,%rdx
lea    0xe94(%rip),%rcx
cmove  %rdi,%rcx
add    $0xfffeae80,%eax
cmp    $0x15180,%eax
mov    %rbx,%r9
cmovb  %rdi,%r9
cmp    $0x1,%r10d
mov    %rbx,%r15
cmove  %rdi,%r15
cmp    $0x1,%r14d
mov    %rbx,%r12
cmove  %rdi,%r12
cmp    $0x1,%r11d
cmove  %rdi,%rbx
lea    0xe08(%rip),%rdi
xor    %eax,%eax
push   %rbx
push   %r11
push   %r12
push   %r14
push   %r15
push   %r10
call   1030 <printf@plt>
add    $0x30,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Insira um numero: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [80 x i8] c"%ld segundo%s corresponde%s a %d dia%s, %d hora%s, %d minuto%s e %d segundo%s.\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"s\00"
@.str.5 = [2 x i8] c"m\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 60
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 60
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = sdiv i32 %17, 60
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 60
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %4
%24 = sdiv i32 %23, 24
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = mul nsw i32 %25, 24
%27 = load i32, i32* %4
%28 = sub nsw i32 %27, %26
store i32 %28, i32* %4
%29 = load i64, i64* %2
%30 = load i64, i64* %2
%31 = icmp eq i64 %30, 1
%32 = zext i1 %31 to i64
%33 = select i1 %31, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%34 = load i64, i64* %2
%35 = icmp eq i64 %34, 1
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%38 = load i32, i32* %3
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 1
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%43 = load i32, i32* %4
%44 = load i32, i32* %4
%45 = icmp eq i32 %44, 1
%46 = zext i1 %45 to i64
%47 = select i1 %45, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%48 = load i32, i32* %5
%49 = load i32, i32* %5
%50 = icmp eq i32 %49, 1
%51 = zext i1 %50 to i64
%52 = select i1 %50, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%53 = load i32, i32* %6
%54 = load i32, i32* %6
%55 = icmp eq i32 %54, 1
%56 = zext i1 %55 to i64
%57 = select i1 %55, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i64 %29, i8* %33, i8* %37, i32 %38, i8* %42, i32 %43, i8* %47, i32 %48, i8* %52, i32 %53, i8* %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Insira um numero: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [80 x i8] c"%ld segundo%s corresponde%s a %d dia%s, %d hora%s, %d minuto%s e %d segundo%s.\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"s\00"
@.str.5 = [2 x i8] c"m\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = sdiv i32 %6, 60
%8 = mul nsw i32 %7, -60
%9 = add i32 %8, %6
%10 = sdiv i32 %6, 3600
%11 = mul nsw i32 %10, -60
%12 = add nsw i32 %11, %7
%13 = sdiv i32 %6, 86400
%14 = mul nsw i32 %13, -24
%15 = add nsw i32 %14, %10
%16 = icmp eq i64 %5, 1
%17 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%18 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%19 = add i32 %6, -86400
%20 = icmp ult i32 %19, 86400
%21 = select i1 %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%22 = icmp eq i32 %15, 1
%23 = select i1 %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%24 = icmp eq i32 %12, 1
%25 = select i1 %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%26 = icmp eq i32 %9, 1
%27 = select i1 %26, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i64 %5, i8* %17, i8* %18, i32 %13, i8* %21, i32 %15, i8* %23, i32 %12, i8* %25, i32 %9, i8* %27)
ret i32 0
}