#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 *, int *);
int main(void) {
  int n;
  printf("Quantas vezes o programa deve ser executado:");
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int d1;
    printf("Numero de dias 1:");
    scanf("%d", &d1);
    int d2;
    printf("Numero de dias 2:");
    scanf("%d", &d2);
    int h1;
    printf("Numero de horas 1:");
    scanf("%d", &h1);
    int h2;
    printf("Numero de horas 2:");
    scanf("%d", &h2);
    int m1;
    printf("Numero de minutos 1:");
    scanf("%d", &m1);
    int m2;
    printf("Numero de minutos 2:");
    scanf("%d", &m2);
    int dias = d1 + d2;
    int horas = h1 + h2;
    int minutos = m1 + m2;
    horas += minutos / 60;
    minutos %= 60;
    dias += horas / 24;
    horas %= 24;
    printf("%2u Dias %2u Horas %2u Minutos mais\n", d1, h1, m1);
    printf("%2u Dias %2u Horas %2u Minutos\n", d2, h2, m2);
    printf("eh igual a %2u Dias %2u Horas %2u Minutos\n\n", dias, horas,
           minutos);
  }
}


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    0xee9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12c0 <main+0x1a0>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe22(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x18(%rsp)
jle    12c6 <main+0x1a6>
lea    0xece(%rip),%rbx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x24(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x1c(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x24(%rsp),%esi
mov    0x14(%rsp),%r14d
add    %esi,%r14d
mov    0x20(%rsp),%edx
mov    0x10(%rsp),%eax
add    %edx,%eax
mov    0x1c(%rsp),%ecx
mov    0xc(%rsp),%edi
add    %ecx,%edi
movslq %edi,%r15
imul   $0xffffffff88888889,%r15,%rdi
shr    $0x20,%rdi
add    %r15d,%edi
mov    %edi,%ebp
shr    $0x1f,%ebp
sar    $0x5,%edi
add    %ebp,%edi
add    %edi,%eax
imul   $0x3c,%edi,%edi
sub    %edi,%r15d
movslq %eax,%r12
imul   $0x2aaaaaab,%r12,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
add    %eax,%r14d
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r12d
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r13d
cmp    0x18(%rsp),%r13d
jl     1170 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Quantas vezes o programa deve ser executado:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Numero de dias 1:\00"
@.str.3 = [18 x i8] c"Numero de dias 2:\00"
@.str.4 = [19 x i8] c"Numero de horas 1:\00"
@.str.5 = [19 x i8] c"Numero de horas 2:\00"
@.str.6 = [21 x i8] c"Numero de minutos 1:\00"
@.str.7 = [21 x i8] c"Numero de minutos 2:\00"
@.str.8 = [37 x i8] c"%2u Dias %2u Horas %2u Minutos mais\0A\00"
@.str.9 = [32 x i8] c"%2u Dias %2u Horas %2u Minutos\0A\00"
@.str.10 = [44 x i8] c"eh igual a %2u Dias %2u Horas %2u Minutos\0A\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
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %15
15: ; preds = %65, %0
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %68
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = add nsw i32 %32, %33
store i32 %34, i32* %10
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = add nsw i32 %35, %36
store i32 %37, i32* %11
%38 = load i32, i32* %8
%39 = load i32, i32* %9
%40 = add nsw i32 %38, %39
store i32 %40, i32* %12
%41 = load i32, i32* %12
%42 = sdiv i32 %41, 60
%43 = load i32, i32* %11
%44 = add nsw i32 %43, %42
store i32 %44, i32* %11
%45 = load i32, i32* %12
%46 = srem i32 %45, 60
store i32 %46, i32* %12
%47 = load i32, i32* %11
%48 = sdiv i32 %47, 24
%49 = load i32, i32* %10
%50 = add nsw i32 %49, %48
store i32 %50, i32* %10
%51 = load i32, i32* %11
%52 = srem i32 %51, 24
store i32 %52, i32* %11
%53 = load i32, i32* %4
%54 = load i32, i32* %6
%55 = load i32, i32* %8
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %53, i32 %54, i32 %55)
%57 = load i32, i32* %5
%58 = load i32, i32* %7
%59 = load i32, i32* %9
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* %10
%62 = load i32, i32* %11
%63 = load i32, i32* %12
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0), i32 %61, i32 %62, i32 %63)
br label %65
65: ; preds = %19
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %15
68: ; preds = %15
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@.str = [45 x i8] c"Quantas vezes o programa deve ser executado:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Numero de dias 1:\00"
@.str.3 = [18 x i8] c"Numero de dias 2:\00"
@.str.4 = [19 x i8] c"Numero de horas 1:\00"
@.str.5 = [19 x i8] c"Numero de horas 2:\00"
@.str.6 = [21 x i8] c"Numero de minutos 1:\00"
@.str.7 = [21 x i8] c"Numero de minutos 2:\00"
@.str.8 = [37 x i8] c"%2u Dias %2u Horas %2u Minutos mais\0A\00"
@.str.9 = [32 x i8] c"%2u Dias %2u Horas %2u Minutos\0A\00"
@.str.10 = [44 x i8] c"eh igual a %2u Dias %2u Horas %2u Minutos\0A\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 = bitcast i32* %1 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 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* %1)
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 1
br i1 %12, label %20, label %13
13: ; preds = %0
%14 = bitcast i32* %2 to i8*
%15 = bitcast i32* %3 to i8*
%16 = bitcast i32* %4 to i8*
%17 = bitcast i32* %5 to i8*
%18 = bitcast i32* %6 to i8*
%19 = bitcast i32* %7 to i8*
br label %21
20: ; preds = %21, %0
ret i32 0
21: ; preds = %13, %21
%22 = phi i32 [ 1, %13 ], [ %56, %21 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = add nsw i32 %36, %35
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = add nsw i32 %39, %38
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = add nsw i32 %42, %41
%44 = sdiv i32 %43, 60
%45 = add nsw i32 %40, %44
%46 = srem i32 %43, 60
%47 = sdiv i32 %45, 24
%48 = add nsw i32 %37, %47
%49 = srem i32 %45, 24
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %35, i32 %38, i32 %41)
%51 = load i32, i32* %3
%52 = load i32, i32* %5
%53 = load i32, i32* %7
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %51, i32 %52, i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0), i32 %48, i32 %49, i32 %46)
%56 = add nuw nsw i32 %22, 1
%57 = load i32, i32* %1
%58 = icmp slt i32 %22, %57
br i1 %58, label %21, label %20
}