#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 *, char *);
int strlen(char *);
int main() {
  int a, b, number[2], valid;
  number[0] = 0;
  number[0] = 0;
  number[0] = 0;
  char string[250];
  int vector[125], vector_start[125], vector_end[125];
  for (a = 0; a < 126; a++) {
    vector[125] = 0;
    vector_start[125] = 0;
    vector_end[125] = 0;
  }
  scanf("%s", string);
  valid = 1;
  for (a = 0; a < strlen(string); a++) {
    if (string[a] == '{' || string[a] == '}') {
      number[0]++;
    }
    if (string[a] == '(' || string[a] == ')') {
      number[1]++;
    }
    if (string[a] == '<' || string[a] == '>') {
      number[2]++;
    }
  }
  if ((number[0] % 2 == 0) && (number[1] % 2 == 0) && (number[2] % 2 == 0)) {
    for (a = 0; a < strlen(string); a++) {
      for (b = strlen(string); b > 0; b--) {
        if ((string[a] == '(' && string[b] == ')') ||
            (string[a] == '{' && string[b] == '}') ||
            (string[a] == '[' && string[b] == ']')) {
          vector[a] = b - a;
          vector_end[b] = b;
          vector_start[a] = a;
          valid = 1;
        }
      }
    }
  }
  if (valid != 1) {
    printf("NOT VALID");
    return 0;
  }
  for (a = 0; vector[a] != 0 && vector[a + 1] != 0 && a < 126; a++) {
    if ((vector[a + 1] < vector[a]) && (vector_end[a + 1] < vector_end[a])) {
      if (vector_start[a] < vector_start[a + 1] &&
          vector_end[a] > vector_end[a + 1]) {
        valid = 1;
      } else {
        printf("NOT VALID");
        return 0;
      }
    } else {
      if (vector_start[a + 1] < vector_start[a] &&
          vector_end[a + 1] > vector_end[a]) {
        valid = 1;
      } else {
        printf("NOT VALID");
        return 0;
      }
    }
  }
  printf("VALID");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x730,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jge    1194 <main+0x64>
movl   $0x0,-0x12c(%rbp)
movl   $0x0,-0x32c(%rbp)
movl   $0x0,-0x52c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x2e>
lea    -0x120(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x724(%rbp)
lea    -0x120(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x724(%rbp),%eax
cmp    %ecx,%eax
jge    1286 <main+0x156>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x7b,%eax
je     1204 <main+0xd4>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x7d,%eax
jne    120d <main+0xdd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x28,%eax
je     1237 <main+0x107>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x29,%eax
jne    1240 <main+0x110>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x3c,%eax
je     126a <main+0x13a>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x3e,%eax
jne    1273 <main+0x143>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1278 <main+0x148>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b5 <main+0x85>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13e4 <main+0x2b4>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13e4 <main+0x2b4>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13e4 <main+0x2b4>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x728(%rbp)
lea    -0x120(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x728(%rbp),%eax
cmp    %ecx,%eax
jge    13df <main+0x2af>
lea    -0x120(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    13cc <main+0x29c>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x28,%eax
jne    1331 <main+0x201>
movslq -0xc(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x29,%eax
je     1385 <main+0x255>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x7b,%eax
jne    135b <main+0x22b>
movslq -0xc(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x7d,%eax
je     1385 <main+0x255>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x5b,%eax
jne    13b9 <main+0x289>
movslq -0xc(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x5d,%eax
jne    13b9 <main+0x289>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x320(%rbp,%rax,4)
mov    -0xc(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x720(%rbp,%rax,4)
mov    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x520(%rbp,%rax,4)
movl   $0x1,-0x18(%rbp)
jmp    13be <main+0x28e>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    12fd <main+0x1cd>
jmp    13d1 <main+0x2a1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c9 <main+0x199>
jmp    13e4 <main+0x2b4>
cmpl   $0x1,-0x18(%rbp)
je     1406 <main+0x2d6>
lea    0xc0e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15a0 <main+0x470>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,-0x320(%rbp,%rcx,4)
mov    %al,-0x729(%rbp)
je     1453 <main+0x323>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
xor    %eax,%eax
cmpl   $0x0,-0x320(%rbp,%rcx,4)
mov    %al,-0x729(%rbp)
je     1453 <main+0x323>
cmpl   $0x7e,-0x8(%rbp)
setl   %al
mov    %al,-0x729(%rbp)
mov    -0x729(%rbp),%al
test   $0x1,%al
jne    1466 <main+0x336>
jmp    158d <main+0x45d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x320(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x320(%rbp,%rcx,4),%eax
jge    1511 <main+0x3e1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x720(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x720(%rbp,%rcx,4),%eax
jge    1511 <main+0x3e1>
movslq -0x8(%rbp),%rax
mov    -0x520(%rbp,%rax,4),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x520(%rbp,%rcx,4),%eax
jge    14f4 <main+0x3c4>
movslq -0x8(%rbp),%rax
mov    -0x720(%rbp,%rax,4),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x720(%rbp,%rcx,4),%eax
jle    14f4 <main+0x3c4>
movl   $0x1,-0x18(%rbp)
jmp    150c <main+0x3dc>
lea    0xb08(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15a0 <main+0x470>
jmp    157a <main+0x44a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x520(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x520(%rbp,%rcx,4),%eax
jge    155d <main+0x42d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x720(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x720(%rbp,%rcx,4),%eax
jle    155d <main+0x42d>
movl   $0x1,-0x18(%rbp)
jmp    1575 <main+0x445>
lea    0xa9f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15a0 <main+0x470>
jmp    157a <main+0x44a>
jmp    157f <main+0x44f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    140d <main+0x2dd>
lea    0xa73(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x6f8,%rsp
movl   $0x0,0x6f4(%rsp)
movl   $0x0,0x3f4(%rsp)
movl   $0x0,0x1f4(%rsp)
lea    0xe9e(%rip),%rdi
lea    0x400(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11a3 <main+0x73>
xor    %ebx,%ebx
lea    0x400(%rsp),%r14
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1190 <main+0x60>
mov    0x504(%rsp),%esi
lea    0xe56(%rip),%rdi
test   %esi,%esi
je     1236 <main+0x106>
mov    $0x1,%ecx
lea    0xe3e(%rip),%rax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edx
mov    %esi,%ebx
cmp    %edx,%esi
jge    1200 <main+0xd0>
mov    (%rsp,%rcx,4),%edx
cmp    -0x4(%rsp,%rcx,4),%edx
jge    1200 <main+0xd0>
mov    0x1fc(%rsp,%rcx,4),%edx
cmp    0x200(%rsp,%rcx,4),%edx
jl     1219 <main+0xe9>
jmp    1233 <main+0x103>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x200(%rsp,%rcx,4),%edx
cmp    0x1fc(%rsp,%rcx,4),%edx
jge    1233 <main+0x103>
mov    (%rsp,%rcx,4),%edx
cmp    -0x4(%rsp,%rcx,4),%edx
jle    1233 <main+0x103>
mov    0x504(%rsp,%rcx,4),%esi
test   %esi,%esi
je     1236 <main+0x106>
lea    0x1(%rcx),%rdx
cmp    $0x7e,%rcx
mov    %rdx,%rcx
jb     11d0 <main+0xa0>
jmp    1236 <main+0x106>
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x6f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"NOT VALID\00"
@.str.2 = [6 x i8] c"VALID\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca [250 x i8]
%7 = alloca [125 x i32]
%8 = alloca [125 x i32]
%9 = alloca [125 x i32]
store i32 0, i32* %1
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %10
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %12
store i32 0, i32* %2
br label %13
13: ; preds = %20, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 126
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 125
store i32 0, i32* %17
%18 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 125
store i32 0, i32* %18
%19 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 125
store i32 0, i32* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %13
23: ; preds = %13
%24 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 1, i32* %5
store i32 0, i32* %2
br label %26
26: ; preds = %86, %23
%27 = load i32, i32* %2
%28 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
%30 = icmp slt i32 %27, %29
br i1 %30, label %31, label %89
31: ; preds = %26
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 123
br i1 %37, label %45, label %38
38: ; preds = %31
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 125
br i1 %44, label %45, label %49
45: ; preds = %38, %31
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
store i32 %48, i32* %46
br label %49
49: ; preds = %45, %38
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 40
br i1 %55, label %63, label %56
56: ; preds = %49
%57 = load i32, i32* %2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 41
br i1 %62, label %63, label %67
63: ; preds = %56, %49
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%65 = load i32, i32* %64
%66 = add nsw i32 %65, 1
store i32 %66, i32* %64
br label %67
67: ; preds = %63, %56
%68 = load i32, i32* %2
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 60
br i1 %73, label %81, label %74
74: ; preds = %67
%75 = load i32, i32* %2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 62
br i1 %80, label %81, label %85
81: ; preds = %74, %67
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 2
%83 = load i32, i32* %82
%84 = add nsw i32 %83, 1
store i32 %84, i32* %82
br label %85
85: ; preds = %81, %74
br label %86
86: ; preds = %85
%87 = load i32, i32* %2
%88 = add nsw i32 %87, 1
store i32 %88, i32* %2
br label %26
89: ; preds = %26
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%91 = load i32, i32* %90
%92 = srem i32 %91, 2
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %182
94: ; preds = %89
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%96 = load i32, i32* %95
%97 = srem i32 %96, 2
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %182
99: ; preds = %94
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 2
%101 = load i32, i32* %100
%102 = srem i32 %101, 2
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %182
104: ; preds = %99
store i32 0, i32* %2
br label %105
105: ; preds = %178, %104
%106 = load i32, i32* %2
%107 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%108 = call i32 @strlen(i8* %107)
%109 = icmp slt i32 %106, %108
br i1 %109, label %110, label %181
110: ; preds = %105
%111 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%112 = call i32 @strlen(i8* %111)
store i32 %112, i32* %3
br label %113
113: ; preds = %174, %110
%114 = load i32, i32* %3
%115 = icmp sgt i32 %114, 0
br i1 %115, label %116, label %177
116: ; preds = %113
%117 = load i32, i32* %2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 40
br i1 %122, label %123, label %130
123: ; preds = %116
%124 = load i32, i32* %3
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %125
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 41
br i1 %129, label %158, label %130
130: ; preds = %123, %116
%131 = load i32, i32* %2
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 123
br i1 %136, label %137, label %144
137: ; preds = %130
%138 = load i32, i32* %3
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %142, 125
br i1 %143, label %158, label %144
144: ; preds = %137, %130
%145 = load i32, i32* %2
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %146
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 91
br i1 %150, label %151, label %173
151: ; preds = %144
%152 = load i32, i32* %3
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 %153
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = icmp eq i32 %156, 93
br i1 %157, label %158, label %173
158: ; preds = %151, %137, %123
%159 = load i32, i32* %3
%160 = load i32, i32* %2
%161 = sub nsw i32 %159, %160
%162 = load i32, i32* %2
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 %163
store i32 %161, i32* %164
%165 = load i32, i32* %3
%166 = load i32, i32* %3
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %167
store i32 %165, i32* %168
%169 = load i32, i32* %2
%170 = load i32, i32* %2
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 %171
store i32 %169, i32* %172
store i32 1, i32* %5
br label %173
173: ; preds = %158, %151, %144
br label %174
174: ; preds = %173
%175 = load i32, i32* %3
%176 = add nsw i32 %175, -1
store i32 %176, i32* %3
br label %113
177: ; preds = %113
br label %178
178: ; preds = %177
%179 = load i32, i32* %2
%180 = add nsw i32 %179, 1
store i32 %180, i32* %2
br label %105
181: ; preds = %105
br label %182
182: ; preds = %181, %99, %94, %89
%183 = load i32, i32* %5
%184 = icmp ne i32 %183, 1
br i1 %184, label %185, label %187
185: ; preds = %182
%186 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %286
187: ; preds = %182
store i32 0, i32* %2
br label %188
188: ; preds = %281, %187
%189 = load i32, i32* %2
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 %190
%192 = load i32, i32* %191
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %204
194: ; preds = %188
%195 = load i32, i32* %2
%196 = add nsw i32 %195, 1
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 %197
%199 = load i32, i32* %198
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %204
201: ; preds = %194
%202 = load i32, i32* %2
%203 = icmp slt i32 %202, 126
br label %204
204: ; preds = %201, %194, %188
%205 = phi i1 [ false, %194 ], [ false, %188 ], [ %203, %201 ]
br i1 %205, label %206, label %284
206: ; preds = %204
%207 = load i32, i32* %2
%208 = add nsw i32 %207, 1
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 %209
%211 = load i32, i32* %210
%212 = load i32, i32* %2
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds [125 x i32], [125 x i32]* %7, i64 0, i64 %213
%215 = load i32, i32* %214
%216 = icmp slt i32 %211, %215
br i1 %216, label %217, label %254
217: ; preds = %206
%218 = load i32, i32* %2
%219 = add nsw i32 %218, 1
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %220
%222 = load i32, i32* %221
%223 = load i32, i32* %2
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %224
%226 = load i32, i32* %225
%227 = icmp slt i32 %222, %226
br i1 %227, label %228, label %254
228: ; preds = %217
%229 = load i32, i32* %2
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 %230
%232 = load i32, i32* %231
%233 = load i32, i32* %2
%234 = add nsw i32 %233, 1
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 %235
%237 = load i32, i32* %236
%238 = icmp slt i32 %232, %237
br i1 %238, label %239, label %251
239: ; preds = %228
%240 = load i32, i32* %2
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %241
%243 = load i32, i32* %242
%244 = load i32, i32* %2
%245 = add nsw i32 %244, 1
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %246
%248 = load i32, i32* %247
%249 = icmp sgt i32 %243, %248
br i1 %249, label %250, label %251
250: ; preds = %239
store i32 1, i32* %5
br label %253
251: ; preds = %239, %228
%252 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %286
253: ; preds = %250
br label %280
254: ; preds = %217, %206
%255 = load i32, i32* %2
%256 = add nsw i32 %255, 1
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 %257
%259 = load i32, i32* %258
%260 = load i32, i32* %2
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds [125 x i32], [125 x i32]* %8, i64 0, i64 %261
%263 = load i32, i32* %262
%264 = icmp slt i32 %259, %263
br i1 %264, label %265, label %277
265: ; preds = %254
%266 = load i32, i32* %2
%267 = add nsw i32 %266, 1
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %268
%270 = load i32, i32* %269
%271 = load i32, i32* %2
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds [125 x i32], [125 x i32]* %9, i64 0, i64 %272
%274 = load i32, i32* %273
%275 = icmp sgt i32 %270, %274
br i1 %275, label %276, label %277
276: ; preds = %265
store i32 1, i32* %5
br label %279
277: ; preds = %265, %254
%278 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %286
279: ; preds = %276
br label %280
280: ; preds = %279, %253
br label %281
281: ; preds = %280
%282 = load i32, i32* %2
%283 = add nsw i32 %282, 1
store i32 %283, i32* %2
br label %188
284: ; preds = %204
%285 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %286
286: ; preds = %284, %277, %251, %185
%287 = load i32, i32* %1
ret i32 %287
}

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