#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ isalnum(char);
scalar_t__ isalpha(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(void) {
  int len = 0;
  int i = 0;
  char text[256] = {'\0'};
  unsigned char not_alnum = 0;
  unsigned char lower = 0;
  unsigned char upper = 0;
  fgets(text, 256, stdin);
  len = strlen(text);
  if (text[len - 1] == '\n') {
    text[len - 1] = '\0';
  }
  len = strlen(text);
  for (i = 0; i < len; i++) {
    if (!isalnum(text[i])) {
      not_alnum = 1;
    } else if (isalpha(text[i])) {
      if (isupper(text[i])) {
        upper = 1;
      } else {
        lower = 1;
      }
    }
    if (not_alnum && upper && lower) {
      printf("String suitable for password!\n");
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
movb   $0x0,-0x111(%rbp)
movb   $0x0,-0x112(%rbp)
movb   $0x0,-0x113(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e22(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1070 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    120a <main+0x9a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1300 <main+0x190>
movslq -0xc(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1050 <isalnum@plt>
cmp    $0x0,%eax
jne    1252 <main+0xe2>
movb   $0x1,-0x111(%rbp)
jmp    12a5 <main+0x135>
movslq -0xc(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1080 <isalpha@plt>
cmp    $0x0,%rax
je     12a0 <main+0x130>
movslq -0xc(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1090 <isupper@plt>
cmp    $0x0,%rax
je     1294 <main+0x124>
movb   $0x1,-0x113(%rbp)
jmp    129b <main+0x12b>
movb   $0x1,-0x112(%rbp)
jmp    12a0 <main+0x130>
jmp    12a5 <main+0x135>
movzbl -0x111(%rbp),%eax
cmp    $0x0,%eax
je     12ed <main+0x17d>
movzbl -0x113(%rbp),%eax
cmp    $0x0,%eax
je     12ed <main+0x17d>
movzbl -0x112(%rbp),%eax
cmp    $0x0,%eax
je     12ed <main+0x17d>
lea    0xd24(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1307 <main+0x197>
jmp    12f2 <main+0x182>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1220 <main+0xb0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x2e06(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    120a <main+0xaa>
movb   $0x0,-0x1(%rsp,%rax,1)
mov    %rsp,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    129e <main+0x13e>
mov    %eax,%r14d
xor    %ebx,%ebx
mov    $0x1,%r15d
xor    %ebp,%ebp
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1239 <main+0xd9>
nop
add    $0x1,%rbx
cmp    %rbx,%r14
je     129e <main+0x13e>
movsbl (%rsp,%rbx,1),%edi
call   1050 <isalnum@plt>
test   %eax,%eax
je     1280 <main+0x120>
movsbl (%rsp,%rbx,1),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     1270 <main+0x110>
movsbl (%rsp,%rbx,1),%edi
call   1080 <isupper@plt>
test   %rax,%rax
movzbl %r12b,%r12d
cmove  %r15d,%r12d
movzbl %bpl,%ebp
cmovne %r15d,%ebp
test   %r13b,%r13b
jne    1288 <main+0x128>
jmp    1230 <main+0xd0>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%r13b
test   %r13b,%r13b
je     1230 <main+0xd0>
test   %bpl,%bpl
je     1230 <main+0xd0>
test   %r12b,%r12b
je     1230 <main+0xd0>
lea    0xd67(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [31 x i8] c"String suitable for password!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%8 = bitcast [256 x i8]* %4 to i8*
store i8 0, i8* %5
store i8 0, i8* %6
store i8 0, i8* %7
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 256, i32 %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br i1 %20, label %21, label %26
21: ; preds = %0
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %21, %0
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
store i32 %28, i32* %2
store i32 0, i32* %3
br label %29
29: ; preds = %74, %26
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %77
33: ; preds = %29
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = call i32 @isalnum(i8 signext %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %33
store i8 1, i8* %5
br label %59
41: ; preds = %33
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = call i64 @isalpha(i8 signext %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %58
48: ; preds = %41
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = call i64 @isupper(i8 signext %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %48
store i8 1, i8* %7
br label %57
56: ; preds = %48
store i8 1, i8* %6
br label %57
57: ; preds = %56, %55
br label %58
58: ; preds = %57, %41
br label %59
59: ; preds = %58, %40
%60 = load i8, i8* %5
%61 = zext i8 %60 to i32
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %73
63: ; preds = %59
%64 = load i8, i8* %7
%65 = zext i8 %64 to i32
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %73
67: ; preds = %63
%68 = load i8, i8* %6
%69 = zext i8 %68 to i32
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %78
73: ; preds = %67, %63, %59
br label %74
74: ; preds = %73
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %29
77: ; preds = %29
store i32 0, i32* %1
br label %78
78: ; preds = %77, %71
%79 = load i32, i32* %1
ret i32 %79
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [30 x i8] c"String suitable for password!\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 256, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %0
store i8 0, i8* %8
br label %12
12: ; preds = %11, %0
%13 = call i32 @strlen(i8* %2)
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %50
15: ; preds = %12
%16 = zext i32 %13 to i64
br label %19
17: ; preds = %38
%18 = icmp eq i64 %47, %16
br i1 %18, label %50, label %19
19: ; preds = %15, %17
%20 = phi i64 [ 0, %15 ], [ %47, %17 ]
%21 = phi i8 [ 0, %15 ], [ %41, %17 ]
%22 = phi i8 [ 0, %15 ], [ %40, %17 ]
%23 = phi i8 [ 0, %15 ], [ %39, %17 ]
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %20
%25 = load i8, i8* %24
%26 = call i32 @isalnum(i8 signext %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %38, label %28
28: ; preds = %19
%29 = load i8, i8* %24
%30 = call i64 @isalpha(i8 signext %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %38, label %32
32: ; preds = %28
%33 = load i8, i8* %24
%34 = call i64 @isupper(i8 signext %33)
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i8 1, i8 %22
%37 = select i1 %35, i8 %21, i8 1
br label %38
38: ; preds = %32, %19, %28
%39 = phi i8 [ %23, %28 ], [ 1, %19 ], [ %23, %32 ]
%40 = phi i8 [ %22, %28 ], [ %22, %19 ], [ %36, %32 ]
%41 = phi i8 [ %21, %28 ], [ %21, %19 ], [ %37, %32 ]
%42 = icmp ne i8 %39, 0
%43 = icmp ne i8 %41, 0
%44 = select i1 %42, i1 %43, i1 false
%45 = icmp ne i8 %40, 0
%46 = select i1 %44, i1 %45, i1 false
%47 = add nuw nsw i64 %20, 1
br i1 %46, label %48, label %17
48: ; preds = %38
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %50
50: ; preds = %17, %12, %48
ret i32 0
}