#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 */
scalar_t__ check_values(int, int, int, int);
int dif_hour(int, int, int, int);
int dif_min(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int h1, h2, m1, m2, difh = 0, difm = 0;
  printf("digite as horas do horario de inicio(valor entre 0-23)\n");
  scanf("%d", &h1);
  printf("digite os minutos do horario de inicio (valor entre 0-59)\n");
  scanf("%d", &m1);
  printf("digite as horas do horario de termino (valor entre 0-23)\n");
  scanf("%d", &h2);
  printf("digite os minutos do horario de termino (valor entre 0-59)\n");
  scanf("%d", &m2);
  if (check_values(h1, h2, m1, m2)) {
    difm = dif_min(m1, m2);
    difh = dif_hour(h1, h2, m1, m2);
    printf("A duração do jogo é de %d horas e %d minutos.\n", difh, difm);
  } else {
    printf("Dados Inválidos \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe73(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe55(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1050 <check_values@plt>
cmp    $0x0,%rax
je     1242 <main+0xf2>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1060 <dif_min@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <dif_hour@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1250 <main+0x100>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
call   1060 <check_values@plt>
test   %rax,%rax
je     121d <main+0xbd>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1070 <dif_min@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
call   1050 <dif_hour@plt>
lea    0xdf3(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1229 <main+0xc9>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"digite as horas do horario de inicio(valor entre 0-23)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [59 x i8] c"digite os minutos do horario de inicio (valor entre 0-59)\0A\00"
@.str.3 = [58 x i8] c"digite as horas do horario de termino (valor entre 0-23)\0A\00"
@.str.4 = [60 x i8] c"digite os minutos do horario de termino (valor entre 0-59)\0A\00"
@.str.5 = [50 x i8] c"A dura\C3\A7\C3\A3o do jogo \C3\A9 de %d horas e %d minutos.\0A\00"
@.str.6 = [19 x i8] c"Dados Inv\C3\A1lidos \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
store i32 0, i32* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = call i64 @check_values(i32 %20, i32 %21, i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %38
26: ; preds = %2
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = call i32 @dif_min(i32 %27, i32 %28)
store i32 %29, i32* %11
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = call i32 @dif_hour(i32 %30, i32 %31, i32 %32, i32 %33)
store i32 %34, i32* %10
%35 = load i32, i32* %10
%36 = load i32, i32* %11
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %35, i32 %36)
br label %40
38: ; preds = %2
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %40
40: ; preds = %38, %26
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [50 x i8] c"A dura\C3\A7\C3\A3o do jogo \C3\A9 de %d horas e %d minutos.\0A\00"
@str = [55 x i8] c"digite as horas do horario de inicio(valor entre 0-23)\00"
@str.7 = [58 x i8] c"digite os minutos do horario de inicio (valor entre 0-59)\00"
@str.8 = [57 x i8] c"digite as horas do horario de termino (valor entre 0-23)\00"
@str.9 = [59 x i8] c"digite os minutos do horario de termino (valor entre 0-59)\00"
@str.10 = [18 x i8] c"Dados Inv\C3\A1lidos \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.7, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.8, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.9, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i64 @check_values(i32 %19, i32 %20, i32 %21, i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %35, label %25
25: ; preds = %2
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = call i32 @dif_min(i32 %26, i32 %27)
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = call i32 @dif_hour(i32 %29, i32 %30, i32 %31, i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %33, i32 %28)
br label %37
35: ; preds = %2
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
br label %37
37: ; preds = %35, %25
ret i32 0
}