#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  int horasInicio = 0, minutosInicio = 0, segundosInicio = 0;
  int horasTermino = 0, minutosTermino = 0, segundosTermino = 0;
  int segundosDuracao = 0;
  printf("Insira o horário de início da experiência biológica em segundos: ");
  scanf("%d", &segundosInicio);
  printf("Insira a duração do experimento em segundos: ");
  scanf("%d", &segundosDuracao);
  segundosTermino += segundosInicio + segundosDuracao;
  horasInicio = segundosInicio / 3600;
  segundosInicio -= horasInicio * 3600;
  minutosInicio = segundosInicio / 60;
  segundosInicio -= minutosInicio * 60;
  horasTermino = segundosTermino / 3600;
  segundosTermino -= horasTermino * 3600;
  minutosTermino = segundosTermino / 60;
  segundosTermino -= minutosTermino * 60;
  printf("Inicio: %d:%d:%d\n", horasInicio, minutosInicio, segundosInicio);
  printf("=================\n");
  printf("Término: %d:%d:%d\n", horasTermino, minutosTermino, segundosTermino);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xf4e(%rip),%rsi
call   1040 <setlocale@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
imul   $0xe10,-0x8(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
imul   $0x3c,-0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
imul   $0xe10,-0x14(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
imul   $0x3c,-0x18(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xf32(%rip),%rsi
call   1050 <setlocale@plt>
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movslq 0x8(%rsp),%rcx
mov    0xc(%rsp),%eax
add    %ecx,%eax
imul   $0xffffffff91a2b3c5,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
mov    %esi,%edx
shr    $0x1f,%edx
sar    $0xb,%esi
add    %edx,%esi
imul   $0xfffff1f0,%esi,%edx
add    %ecx,%edx
movslq %edx,%rdi
imul   $0xffffffff88888889,%rdi,%rdx
shr    $0x20,%rdx
add    %edi,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0xffffffc4,%edx,%ecx
add    %edi,%ecx
mov    %ecx,0x8(%rsp)
cltq
imul   $0xffffffff91a2b3c5,%rax,%r14
shr    $0x20,%r14
add    %eax,%r14d
mov    %r14d,%edi
shr    $0x1f,%edi
sar    $0xb,%r14d
add    %edi,%r14d
imul   $0xfffff1f0,%r14d,%edi
add    %eax,%edi
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%edi
shr    $0x1f,%edi
sar    $0x5,%ebx
add    %edi,%ebx
imul   $0xffffffc4,%ebx,%ebp
add    %eax,%ebp
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe2e(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [70 x i8] c"Insira o hor\C3\A1rio de in\C3\ADcio da experi\C3\AAncia biol\C3\B3gica em segundos: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"Insira a dura\C3\A7\C3\A3o do experimento em segundos: \00"
@.str.4 = [18 x i8] c"Inicio: %d:%d:%d\0A\00"
@.str.5 = [19 x i8] c"=================\0A\00"
@.str.6 = [20 x i8] c"T\C3\A9rmino: %d:%d:%d\0A\00"
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 = load i32, i32* @LC_ALL
%10 = call i32 @setlocale(i32 %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%15 = load i32, i32* %4
%16 = load i32, i32* %8
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %7
%19 = add nsw i32 %18, %17
store i32 %19, i32* %7
%20 = load i32, i32* %4
%21 = sdiv i32 %20, 3600
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 3600
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, %23
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = sdiv i32 %26, 60
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = mul nsw i32 %28, 60
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, %29
store i32 %31, i32* %4
%32 = load i32, i32* %7
%33 = sdiv i32 %32, 3600
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = mul nsw i32 %34, 3600
%36 = load i32, i32* %7
%37 = sub nsw i32 %36, %35
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = sdiv i32 %38, 60
store i32 %39, i32* %6
%40 = load i32, i32* %6
%41 = mul nsw i32 %40, 60
%42 = load i32, i32* %7
%43 = sub nsw i32 %42, %41
store i32 %43, i32* %7
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %44, i32 %45, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %49, i32 %50, i32 %51)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [70 x i8] c"Insira o hor\C3\A1rio de in\C3\ADcio da experi\C3\AAncia biol\C3\B3gica em segundos: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"Insira a dura\C3\A7\C3\A3o do experimento em segundos: \00"
@.str.4 = [18 x i8] c"Inicio: %d:%d:%d\0A\00"
@.str.6 = [20 x i8] c"T\C3\A9rmino: %d:%d:%d\0A\00"
@str = [18 x i8] c"=================\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
%14 = sdiv i32 %11, 3600
%15 = mul nsw i32 %14, -3600
%16 = add i32 %15, %11
%17 = sdiv i32 %16, 60
%18 = mul nsw i32 %17, -60
%19 = add i32 %18, %16
store i32 %19, i32* %1
%20 = sdiv i32 %13, 3600
%21 = mul nsw i32 %20, -3600
%22 = add i32 %21, %13
%23 = sdiv i32 %22, 60
%24 = mul nsw i32 %23, -60
%25 = add i32 %24, %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %17, i32 %19)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %20, i32 %23, i32 %25)
ret i32 0
}