#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 *);
main() {
  long int data, dia, mes, ano;
  printf("\nInforme uma data para consistir: ");
  scanf("%i", &data);
  dia = ((data % 10000000) * 10) + ((data % 10000000) / 1000000);
  mes = ((((data % 10000000) % 1000000) / 100000) * 10) +
        ((((data % 10000000) % 1000000) % 100000) / 10000);
  ano = (((((((data % 10000000) % 1000000) % 100000) % 10000) / 1000) * 1000) +
         (((((((data % 10000000) % 1000000) % 100000) % 10000) % 1000) / 100) *
          100) +
         ((((((((data % 10000000) % 1000000) % 100000) % 10000) % 1000) % 100) /
           10) *
          10) +
         ((((((((data % 10000000) % 1000000) % 100000) % 10000) % 1000) % 100) %
           10) *
          1));
  if ((ano >= 1000) && (ano <= 2999) && (mes >= 1) && (mes <= 12) &&
      (dia >= 1) && (dia <= 30)) {
    printf("\n\n\tA data %.0li/%.0li/%0li é valída!\n\n", dia, mes, ano);
  } else
    printf("\n\n\tData Invalida!!!\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
imul   $0xa,%rdx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
imul   $0xa,%rax,%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0x3e8,%rax,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x30(%rbp),%rax
shl    $0x0,%rdx
add    %rdx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x3e8,-0x28(%rbp)
jl     13ed <main+0x2cd>
cmpq   $0xbb7,-0x28(%rbp)
jg     13ed <main+0x2cd>
cmpq   $0x1,-0x20(%rbp)
jl     13ed <main+0x2cd>
cmpq   $0xc,-0x20(%rbp)
jg     13ed <main+0x2cd>
cmpq   $0x1,-0x18(%rbp)
jl     13ed <main+0x2cd>
cmpq   $0x1e,-0x18(%rbp)
jg     13ed <main+0x2cd>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13fb <main+0x2db>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%r8
movabs $0xd6bf94d5e57a42bd,%rcx
94 bf d6
mov    %r8,%rax
imul   %rcx
add    %r8,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x17,%rdx
add    %rax,%rdx
imul   $0x989680,%rdx,%rax
sub    %rax,%r8
movslq %r8d,%rcx
imul   $0x431bde83,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
imul   $0xf4240,%eax,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
imul   $0x14f8b589,%rcx,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x2d,%rdx
add    %edi,%edx
imul   $0x186a0,%edx,%edi
sub    %edi,%ecx
movslq %ecx,%rcx
imul   $0x68db8bad,%rcx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x2c,%rdi
add    %esi,%edi
imul   $0x2710,%edi,%esi
sub    %esi,%ecx
movslq %ecx,%rcx
lea    -0x3e8(%rcx),%rsi
cmp    $0x7cf,%rsi
ja     1223 <main+0xf3>
lea    (%rdx,%rdx,4),%edx
lea    (%rdi,%rdx,2),%edx
test   %edx,%edx
jle    1223 <main+0xf3>
cmp    $0xc,%edx
jg     1223 <main+0xf3>
lea    (%r8,%r8,4),%rsi
cltq
lea    (%rax,%rsi,2),%rsi
test   %rsi,%rsi
jle    1223 <main+0xf3>
cmp    $0x1e,%rsi
jg     1223 <main+0xf3>
mov    %edx,%edx
lea    0xe0c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    122f <main+0xff>
lea    0xe25(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0AInforme uma data para consistir: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [41 x i8] c"\0A\0A\09A data %.0li/%.0li/%0li \C3\A9 val\C3\ADda!\0A\0A\00"
@.str.3 = [22 x i8] c"\0A\0A\09Data Invalida!!!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%8 = load i64, i64* %2
%9 = srem i64 %8, 10000000
%10 = mul nsw i64 %9, 10
%11 = load i64, i64* %2
%12 = srem i64 %11, 10000000
%13 = sdiv i64 %12, 1000000
%14 = add nsw i64 %10, %13
store i64 %14, i64* %3
%15 = load i64, i64* %2
%16 = srem i64 %15, 10000000
%17 = srem i64 %16, 1000000
%18 = sdiv i64 %17, 100000
%19 = mul nsw i64 %18, 10
%20 = load i64, i64* %2
%21 = srem i64 %20, 10000000
%22 = srem i64 %21, 1000000
%23 = srem i64 %22, 100000
%24 = sdiv i64 %23, 10000
%25 = add nsw i64 %19, %24
store i64 %25, i64* %4
%26 = load i64, i64* %2
%27 = srem i64 %26, 10000000
%28 = srem i64 %27, 1000000
%29 = srem i64 %28, 100000
%30 = srem i64 %29, 10000
%31 = sdiv i64 %30, 1000
%32 = mul nsw i64 %31, 1000
%33 = load i64, i64* %2
%34 = srem i64 %33, 10000000
%35 = srem i64 %34, 1000000
%36 = srem i64 %35, 100000
%37 = srem i64 %36, 10000
%38 = srem i64 %37, 1000
%39 = sdiv i64 %38, 100
%40 = mul nsw i64 %39, 100
%41 = add nsw i64 %32, %40
%42 = load i64, i64* %2
%43 = srem i64 %42, 10000000
%44 = srem i64 %43, 1000000
%45 = srem i64 %44, 100000
%46 = srem i64 %45, 10000
%47 = srem i64 %46, 1000
%48 = srem i64 %47, 100
%49 = sdiv i64 %48, 10
%50 = mul nsw i64 %49, 10
%51 = add nsw i64 %41, %50
%52 = load i64, i64* %2
%53 = srem i64 %52, 10000000
%54 = srem i64 %53, 1000000
%55 = srem i64 %54, 100000
%56 = srem i64 %55, 10000
%57 = srem i64 %56, 1000
%58 = srem i64 %57, 100
%59 = srem i64 %58, 10
%60 = mul nsw i64 %59, 1
%61 = add nsw i64 %51, %60
store i64 %61, i64* %5
%62 = load i64, i64* %5
%63 = icmp sge i64 %62, 1000
br i1 %63, label %64, label %84
64: ; preds = %0
%65 = load i64, i64* %5
%66 = icmp sle i64 %65, 2999
br i1 %66, label %67, label %84
67: ; preds = %64
%68 = load i64, i64* %4
%69 = icmp sge i64 %68, 1
br i1 %69, label %70, label %84
70: ; preds = %67
%71 = load i64, i64* %4
%72 = icmp sle i64 %71, 12
br i1 %72, label %73, label %84
73: ; preds = %70
%74 = load i64, i64* %3
%75 = icmp sge i64 %74, 1
br i1 %75, label %76, label %84
76: ; preds = %73
%77 = load i64, i64* %3
%78 = icmp sle i64 %77, 30
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = load i64, i64* %3
%81 = load i64, i64* %4
%82 = load i64, i64* %5
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i64 %80, i64 %81, i64 %82)
br label %86
84: ; preds = %76, %73, %70, %67, %64, %0
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %86
86: ; preds = %84, %79
%87 = load i32, i32* %1
ret i32 %87
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0AInforme uma data para consistir: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [41 x i8] c"\0A\0A\09A data %.0li/%.0li/%0li \C3\A9 val\C3\ADda!\0A\0A\00"
@str = [21 x i8] c"\0A\0A\09Data Invalida!!!\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = srem i64 %5, 10000000
%7 = mul nsw i64 %6, 10
%8 = trunc i64 %6 to i32
%9 = sdiv i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %7, %10
%12 = srem i32 %8, 1000000
%13 = sdiv i32 %12, 100000
%14 = mul nsw i32 %13, 10
%15 = srem i32 %12, 100000
%16 = sdiv i32 %15, 10000
%17 = add nsw i32 %14, %16
%18 = srem i32 %15, 10000
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, -1000
%21 = icmp ult i64 %20, 2000
%22 = icmp sgt i32 %17, 0
%23 = select i1 %21, i1 %22, i1 false
%24 = icmp slt i32 %17, 13
%25 = select i1 %23, i1 %24, i1 false
%26 = icmp sgt i64 %11, 0
%27 = select i1 %25, i1 %26, i1 false
%28 = icmp slt i64 %11, 31
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %30, label %33
30: ; preds = %0
%31 = zext i32 %17 to i64
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i64 %11, i64 %31, i64 %19)
br label %35
33: ; preds = %0
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
ret i32 0
}