#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 main() {
  char str[200];
  char *p, a;
  int len = 0, i;
  printf("Please enter the passwords (do not more than 200 strings):");
  scanf("%s", &str);
  printf("wait...\n==========\n");
  for (i = 0; str[i] != '\0'; i++)
    len++;
  for (i = 0; i < len; i++) {
    if (str[i] >= 'A' && str[i] <= 'Z') {
      a = str[i] + 'a' - 'A' + 1;
      p = &a;
      str[i] = *p;
    } else if (str[i] >= 'a' && str[i] <= 'z') {
      a = str[i] + 'A' - 'a' + 1;
      p = &a;
      str[i] = *p;
    }
  }
  printf("The sronger passwords is : %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xe0(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rsi
lea    0xee3(%rip),%rdi
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xe4(%rbp)
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11b0 <main+0x90>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1175 <main+0x55>
movl   $0x0,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jge    12d5 <main+0x1b5>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jl     1244 <main+0x124>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jg     1244 <main+0x124>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
add    $0x61,%eax
sub    $0x41,%eax
add    $0x1,%eax
mov    %al,-0xd9(%rbp)
lea    -0xd9(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    (%rax),%cl
movslq -0xe4(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
jmp    12bc <main+0x19c>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     12b7 <main+0x197>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     12b7 <main+0x197>
movslq -0xe4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
add    $0x41,%eax
sub    $0x61,%eax
add    $0x1,%eax
mov    %al,-0xd9(%rbp)
lea    -0xd9(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    (%rax),%cl
movslq -0xe4(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
jmp    12bc <main+0x19c>
jmp    12c1 <main+0x1a1>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    11ba <main+0x9a>
lea    -0xd0(%rbp),%rsi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%al
test   %al,%al
je     11bb <main+0x8b>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rsp,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1170 <main+0x40>
test   %ecx,%ecx
je     11bb <main+0x8b>
mov    %ecx,%esi
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
lea    -0x41(%rax),%edi
mov    $0x21,%cl
cmp    $0x1a,%dil
jb     11a6 <main+0x76>
lea    -0x61(%rax),%edi
mov    $0xe1,%cl
cmp    $0x19,%dil
ja     11ac <main+0x7c>
add    %cl,%al
mov    %al,-0x1(%rsp,%rdx,1)
cmp    %rdx,%rsi
je     11bb <main+0x8b>
movzbl (%rsp,%rdx,1),%eax
add    $0x1,%rdx
jmp    1190 <main+0x60>
lea    0xe7c(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"Please enter the passwords (do not more than 200 strings):\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"wait...\0A==========\0A\00"
@.str.3 = [31 x i8] c"The sronger passwords is : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = bitcast [200 x i8]* %2 to i8**
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %21
21: ; preds = %18
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %11
24: ; preds = %11
store i32 0, i32* %6
br label %25
25: ; preds = %89, %24
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %92
29: ; preds = %25
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sge i32 %34, 65
br i1 %35, label %36, label %58
36: ; preds = %29
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp sle i32 %41, 90
br i1 %42, label %43, label %58
43: ; preds = %36
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = add nsw i32 %48, 97
%50 = sub nsw i32 %49, 65
%51 = add nsw i32 %50, 1
%52 = trunc i32 %51 to i8
store i8 %52, i8* %4
store i8* %4, i8** %3
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %56
store i8 %54, i8* %57
br label %88
58: ; preds = %36, %29
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp sge i32 %63, 97
br i1 %64, label %65, label %87
65: ; preds = %58
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp sle i32 %70, 122
br i1 %71, label %72, label %87
72: ; preds = %65
%73 = load i32, i32* %6
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = add nsw i32 %77, 65
%79 = sub nsw i32 %78, 97
%80 = add nsw i32 %79, 1
%81 = trunc i32 %80 to i8
store i8 %81, i8* %4
store i8* %4, i8** %3
%82 = load i8*, i8** %3
%83 = load i8, i8* %82
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %85
store i8 %83, i8* %86
br label %87
87: ; preds = %72, %65, %58
br label %88
88: ; preds = %87, %43
br label %89
89: ; preds = %88
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %25
92: ; preds = %25
%93 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %93)
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"Please enter the passwords (do not more than 200 strings):\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [31 x i8] c"The sronger passwords is : %s\0A\00"
@str = [19 x i8] c"wait...\0A==========\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [200 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 0
br i1 %8, label %38, label %14
9: ; preds = %14
%10 = trunc i64 %16 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %38, label %12
12: ; preds = %9
%13 = and i64 %16, 4294967295
br label %20
14: ; preds = %0, %14
%15 = phi i64 [ %16, %14 ], [ 0, %0 ]
%16 = add nuw nsw i64 %15, 1
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %9, label %14
20: ; preds = %35, %12
%21 = phi i8 [ %7, %12 ], [ %37, %35 ]
%22 = phi i64 [ 0, %12 ], [ %33, %35 ]
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %22
%24 = add i8 %21, -65
%25 = icmp ult i8 %24, 26
br i1 %25, label %29, label %26
26: ; preds = %20
%27 = add i8 %21, -97
%28 = icmp ult i8 %27, 26
br i1 %28, label %29, label %32
29: ; preds = %26, %20
%30 = phi i8 [ 33, %20 ], [ -31, %26 ]
%31 = add nsw i8 %21, %30
store i8 %31, i8* %23
br label %32
32: ; preds = %29, %26
%33 = add nuw nsw i64 %22, 1
%34 = icmp eq i64 %33, %13
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %33
%37 = load i8, i8* %36
br label %20
38: ; preds = %32, %0, %9
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret i32 0
}