#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 *, int *);
main() {
  int dia, mes, ano;
  printf("\ninforme dia mes ano: ");
  scanf("%d%d%d", &dia, &mes, &ano);
  if (dia == 0 || mes == 0 || dia > 31 || mes > 12) {
    printf("\nData invalida");
  } else {
    printf("\n Data valida %d/%d/%d", dia, mes, ano);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     117d <main+0x5d>
cmpl   $0x0,-0xc(%rbp)
je     117d <main+0x5d>
cmpl   $0x1f,-0x8(%rbp)
jg     117d <main+0x5d>
cmpl   $0xc,-0xc(%rbp)
jle    1190 <main+0x70>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
cmp    $0x1f,%esi
jg     117b <main+0x5b>
test   %esi,%esi
je     117b <main+0x5b>
mov    0x10(%rsp),%edx
test   %edx,%edx
je     117b <main+0x5b>
cmp    $0xd,%edx
jge    117b <main+0x5b>
mov    0xc(%rsp),%ecx
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1189 <main+0x69>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0Ainforme dia mes ano: \00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [15 x i8] c"\0AData invalida\00"
@.str.3 = [23 x i8] c"\0A Data valida %d/%d/%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 31
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 12
br i1 %17, label %18, label %20
18: ; preds = %15, %12, %9, %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %25
20: ; preds = %15
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
br label %25
25: ; preds = %20, %18
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0Ainforme dia mes ano: \00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [15 x i8] c"\0AData invalida\00"
@.str.3 = [23 x i8] c"\0A Data valida %d/%d/%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
%13 = select i1 %10, i1 true, i1 %12
%14 = icmp sgt i32 %9, 31
%15 = or i1 %14, %13
%16 = icmp sgt i32 %11, 12
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %23
20: ; preds = %0
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %11, i32 %21)
br label %23
23: ; preds = %20, %18
ret i32 0
}