#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__ isdigit(char);
scalar_t__ islower(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main(void) {
  int num = 0, upper = 0, lower = 0, i;
  char pass[21];
  scanf("%s\n", pass);
  if (strlen(pass) < 6) {
    printf("INVALID\n");
    return 0;
  }
  for (i = 0; i < strlen(pass); i++) {
    if (isdigit(pass[i])) {
      num = 1;
    } else if (islower(pass[i])) {
      lower = 1;
    } else if (isupper(pass[i])) {
      upper = 1;
    }
  }
  if (num == 1 && lower == 1 && upper == 1) {
    printf("VALID\n");
  } else {
    printf("INVALID\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1080 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x6,%eax
jge    11be <main+0x5e>
lea    0xe57(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12a7 <main+0x147>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    1265 <main+0x105>
movslq -0x14(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1205 <main+0xa5>
movl   $0x1,-0x8(%rbp)
jmp    1252 <main+0xf2>
movslq -0x14(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     1229 <main+0xc9>
movl   $0x1,-0x10(%rbp)
jmp    124d <main+0xed>
movslq -0x14(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1070 <isupper@plt>
cmp    $0x0,%rax
je     1248 <main+0xe8>
movl   $0x1,-0xc(%rbp)
jmp    124d <main+0xed>
jmp    1252 <main+0xf2>
jmp    1257 <main+0xf7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c5 <main+0x65>
cmpl   $0x1,-0x8(%rbp)
jne    1294 <main+0x134>
cmpl   $0x1,-0x10(%rbp)
jne    1294 <main+0x134>
cmpl   $0x1,-0xc(%rbp)
jne    1294 <main+0x134>
lea    0xd7c(%rip),%rdi
call   1060 <printf@plt>
jmp    12a0 <main+0x140>
lea    0xd69(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe8b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0xe75(%rip),%r14
cmp    $0x6,%eax
jl     122d <main+0xcd>
mov    %rsp,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    122d <main+0xcd>
xor    %ebp,%ebp
mov    %rsp,%rbx
xor    %r13d,%r13d
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    11d9 <main+0x79>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%r12d
add    $0x1,%rbp
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    1214 <main+0xb4>
movsbl (%rsp,%rbp,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    11c0 <main+0x60>
movsbl (%rsp,%rbp,1),%edi
call   1040 <islower@plt>
test   %rax,%rax
je     11fd <main+0x9d>
mov    $0x1,%r13d
jmp    11c6 <main+0x66>
movsbl (%rsp,%rbp,1),%edi
call   1070 <isupper@plt>
test   %rax,%rax
mov    $0x1,%eax
cmovne %eax,%r15d
jmp    11c6 <main+0x66>
cmp    $0x1,%r12d
jne    122d <main+0xcd>
cmp    $0x1,%r13d
jne    122d <main+0xcd>
cmp    $0x1,%r15d
jne    122d <main+0xcd>
lea    0xdd9(%rip),%r14
mov    %r14,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"INVALID\0A\00"
@.str.2 = [7 x i8] c"VALID\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [21 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%7 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %10, 6
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %64
14: ; preds = %0
store i32 0, i32* %5
br label %15
15: ; preds = %47, %14
%16 = load i32, i32* %5
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %50
20: ; preds = %15
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = call i64 @isdigit(i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %20
store i32 1, i32* %2
br label %46
28: ; preds = %20
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i64 @islower(i8 signext %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %28
store i32 1, i32* %4
br label %45
36: ; preds = %28
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = call i64 @isupper(i8 signext %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %36
store i32 1, i32* %3
br label %44
44: ; preds = %43, %36
br label %45
45: ; preds = %44, %35
br label %46
46: ; preds = %45, %27
br label %47
47: ; preds = %46
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %15
50: ; preds = %15
%51 = load i32, i32* %2
%52 = icmp eq i32 %51, 1
br i1 %52, label %53, label %61
53: ; preds = %50
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %61
56: ; preds = %53
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %63
61: ; preds = %56, %53, %50
%62 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %63
63: ; preds = %61, %59
store i32 0, i32* %1
br label %64
64: ; preds = %63, %12
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@str.3 = [6 x i8] c"VALID\00"
@str.4 = [8 x i8] c"INVALID\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp slt i32 %4, 6
br i1 %5, label %42, label %6
6: ; preds = %0
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %41
9: ; preds = %6, %27
%10 = phi i64 [ %31, %27 ], [ 0, %6 ]
%11 = phi i32 [ %30, %27 ], [ 0, %6 ]
%12 = phi i32 [ %29, %27 ], [ 0, %6 ]
%13 = phi i32 [ %28, %27 ], [ 0, %6 ]
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %10
%15 = load i8, i8* %14
%16 = call i64 @isdigit(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %9
%19 = load i8, i8* %14
%20 = call i64 @islower(i8 signext %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8, i8* %14
%24 = call i64 @isupper(i8 signext %23)
%25 = icmp eq i64 %24, 0
%26 = select i1 %25, i32 %12, i32 1
br label %27
27: ; preds = %22, %18, %9
%28 = phi i32 [ 1, %9 ], [ %13, %18 ], [ %13, %22 ]
%29 = phi i32 [ %12, %9 ], [ %12, %18 ], [ %26, %22 ]
%30 = phi i32 [ %11, %9 ], [ 1, %18 ], [ %11, %22 ]
%31 = add nuw nsw i64 %10, 1
%32 = call i32 @strlen(i8* %2)
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %31, %33
br i1 %34, label %9, label %35
35: ; preds = %27
%36 = icmp eq i32 %28, 1
%37 = icmp eq i32 %30, 1
%38 = select i1 %36, i1 %37, i1 false
%39 = icmp eq i32 %29, 1
%40 = select i1 %38, i1 %39, i1 false
br i1 %40, label %42, label %41
41: ; preds = %6, %35
br label %42
42: ; preds = %35, %0, %41
%43 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %35 ]
%44 = call i32 @puts(i8* dereferenceable(1) %43)
ret i32 0
}