#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;
  days = startSeconds / (24 * 60 * 60);
  hours = startSeconds / (60 * 60) - days * 24;
  minutes = startSeconds / (60) - days * 24 * 60 - hours * 60;
  seconds = startSeconds % 60;
  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    $0x15180,%ecx
cqto
idiv   %rcx
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
imul   $0x18,-0x34(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
imul   $0x18,-0x34(%rbp),%ecx
imul   $0x3c,%ecx,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
imul   $0x3c,-0x38(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xe9d(%rip),%rdx
lea    0xe95(%rip),%rax
cmp    $0x1,%rcx
cmove  %rax,%rdx
mov    -0x30(%rbp),%rdi
lea    0xe85(%rip),%rcx
lea    0xe7b(%rip),%rax
cmp    $0x1,%rdi
cmove  %rax,%rcx
mov    -0x34(%rbp),%r8d
mov    -0x34(%rbp),%edi
lea    0xe66(%rip),%r9
lea    0xe5e(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r9
mov    -0x38(%rbp),%r15d
mov    -0x38(%rbp),%edi
lea    0xe4a(%rip),%r14
lea    0xe42(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r14
mov    -0x3c(%rbp),%ebx
mov    -0x3c(%rbp),%edi
lea    0xe2f(%rip),%r11
lea    0xe27(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r11
mov    -0x40(%rbp),%r10d
mov    -0x40(%rbp),%r12d
lea    0xe12(%rip),%rax
lea    0xe0a(%rip),%rdi
cmp    $0x1,%r12d
cmove  %rdi,%rax
lea    0xdac(%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
movabs $0x1845c8a0ce512957,%rcx
c8 45 18
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xd,%r8
add    %rax,%r8
movabs $0x48d159e26af37c05,%rcx
59 d1 48
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%r10
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%r10
add    %eax,%r10d
lea    0x0(,%r8,8),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r10d
movabs $0x5a000000000,%rcx
imul   %r8,%rcx
shr    $0x20,%rcx
imul   $0x3c,%r10d,%eax
add    %eax,%ecx
movabs $0x8888888888888889,%rdx
88 88 88
mov    %rsi,%rax
imul   %rdx
mov    %rdx,%r11
add    %rsi,%r11
mov    %r11,%rax
shr    $0x3f,%rax
shr    $0x5,%r11
add    %eax,%r11d
imul   $0x3c,%r11d,%eax
sub    %ecx,%r11d
mov    %esi,%r14d
sub    %eax,%r14d
cmp    $0x1,%rsi
lea    0xe79(%rip),%rax
lea    0xe73(%rip),%rbx
mov    %rbx,%rdx
cmove  %rax,%rdx
lea    0xe67(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%r8d
mov    %rbx,%r9
cmove  %rax,%r9
cmp    $0x1,%r10d
mov    %rbx,%r15
cmove  %rax,%r15
cmp    $0x1,%r11d
mov    %rbx,%r12
cmove  %rax,%r12
cmp    $0x1,%r14d
cmove  %rax,%rbx
lea    0xde1(%rip),%rdi
xor    %eax,%eax
push   %rbx
push   %r14
push   %r12
push   %r11
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 = sdiv i64 %9, 86400
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i64, i64* %2
%13 = sdiv i64 %12, 3600
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 24
%16 = sext i32 %15 to i64
%17 = sub nsw i64 %13, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %4
%19 = load i64, i64* %2
%20 = sdiv i64 %19, 60
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, 24
%23 = mul nsw i32 %22, 60
%24 = sext i32 %23 to i64
%25 = sub nsw i64 %20, %24
%26 = load i32, i32* %4
%27 = mul nsw i32 %26, 60
%28 = sext i32 %27 to i64
%29 = sub nsw i64 %25, %28
%30 = trunc i64 %29 to i32
store i32 %30, i32* %5
%31 = load i64, i64* %2
%32 = srem i64 %31, 60
%33 = trunc i64 %32 to i32
store i32 %33, i32* %6
%34 = load i64, i64* %2
%35 = load i64, i64* %2
%36 = icmp eq i64 %35, 1
%37 = zext i1 %36 to i64
%38 = select i1 %36, 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)
%39 = load i64, i64* %2
%40 = icmp eq i64 %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.5, i64 0, i64 0)
%43 = load i32, i32* %3
%44 = load i32, i32* %3
%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* %4
%49 = load i32, i32* %4
%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* %5
%54 = load i32, i32* %5
%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 = load i32, i32* %6
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 1
%61 = zext i1 %60 to i64
%62 = select i1 %60, 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)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i64 %34, i8* %38, i8* %42, i32 %43, i8* %47, i32 %48, i8* %52, i32 %53, i8* %57, i32 %58, i8* %62)
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 = sdiv i64 %5, 86400
%7 = trunc i64 %6 to i32
%8 = sdiv i64 %5, 3600
%9 = mul i32 %7, -24
%10 = trunc i64 %8 to i32
%11 = add i32 %9, %10
%12 = sdiv i64 %5, 60
%13 = mul i64 %6, 6184752906240
%14 = lshr exact i64 %13, 32
%15 = mul nsw i32 %11, 60
%16 = zext i32 %15 to i64
%17 = add nuw nsw i64 %14, %16
%18 = sub nsw i64 %12, %17
%19 = trunc i64 %18 to i32
%20 = srem i64 %5, 60
%21 = trunc i64 %20 to i32
%22 = icmp eq i64 %5, 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 = 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.5, i64 0, i64 0)
%25 = icmp eq i32 %7, 1
%26 = select i1 %25, 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)
%27 = icmp eq i32 %11, 1
%28 = select i1 %27, 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)
%29 = icmp eq i32 %19, 1
%30 = select i1 %29, 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)
%31 = icmp eq i32 %21, 1
%32 = 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)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i64 %5, i8* %23, i8* %24, i32 %7, i8* %26, i32 %11, i8* %28, i32 %19, i8* %30, i32 %21, i8* %32)
ret i32 0
}