#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 *, ...);
char rand();
main() {
  char niz[100];
  int i, n;
  n = rand() % 100;
  for (i = 0; i < n; i++) {
    if (rand() % 2)
      printf("%c", niz[i] = rand() % ('Z' - 'A' + 1) + 'A');
    else
      printf("%c", niz[i] = rand() % (('z' - 'a') + 1) + 'a');
  }
  printf("\n\n");
  niz[9] = 'L';
  niz[10] = 'A';
  niz[11] = 'N';
  niz[12] = 'A';
  for (i = 0; i < n; i++)
    printf("%c", niz[i]);
  printf("\n\n");
  for (i = 0; i < n; i++) {
    if (niz[i] >= 'A' && niz[i] <= 'Z')
      printf("%c", niz[i] = 'a' + niz[i] - 'A');
    else
      printf("%c", niz[i] = 'A' + niz[i] - 'a');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsbl %al,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x78(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    11ed <main+0xcd>
mov    $0x0,%al
call   1040 <rand@plt>
movsbl %al,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11aa <main+0x8a>
mov    $0x0,%al
call   1040 <rand@plt>
movsbl %al,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
movslq -0x74(%rbp),%rcx
mov    %al,-0x70(%rbp,%rcx,1)
movsbl %al,%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xba>
mov    $0x0,%al
call   1040 <rand@plt>
movsbl %al,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
movslq -0x74(%rbp),%rcx
mov    %al,-0x70(%rbp,%rcx,1)
movsbl %al,%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11df <main+0xbf>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    114e <main+0x2e>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x4c,-0x67(%rbp)
movb   $0x41,-0x66(%rbp)
movb   $0x4e,-0x65(%rbp)
movb   $0x41,-0x64(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    1243 <main+0x123>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1212 <main+0xf2>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    12f0 <main+0x1d0>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jl     12b5 <main+0x195>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jg     12b5 <main+0x195>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    $0x61,%eax
sub    $0x41,%eax
movslq -0x74(%rbp),%rcx
mov    %al,-0x70(%rbp,%rcx,1)
movsbl %al,%esi
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dd <main+0x1bd>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    $0x41,%eax
sub    $0x61,%eax
movslq -0x74(%rbp),%rcx
mov    %al,-0x70(%rbp,%rcx,1)
movsbl %al,%esi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e2 <main+0x1c2>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1258 <main+0x138>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %eax,%eax
call   1050 <rand@plt>
movsbl %al,%r15d
lea    (%r15,%r15,4),%eax
lea    (%r15,%rax,8),%eax
movzwl %ax,%ecx
shr    $0xc,%eax
shr    $0xf,%ecx
add    %al,%cl
movzbl %cl,%eax
imul   $0x64,%eax,%eax
sub    %al,%r15b
test   %r15b,%r15b
jle    124e <main+0x11e>
movsbl %r15b,%eax
mov    %eax,%r14d
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <rand@plt>
test   $0x1,%al
sete   %bl
xor    %eax,%eax
call   1050 <rand@plt>
movsbl %al,%eax
imul   $0x4f,%eax,%ecx
movzwl %cx,%edx
shr    $0xb,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %dl,%al
shl    $0x5,%bl
add    %al,%bl
add    $0x41,%bl
movzbl %bl,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    %bl,(%rsp,%r12,1)
add    $0x1,%r12
cmp    %r12,%r14
jne    1180 <main+0x50>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
movl   $0x414e414c,0x9(%rsp)
41
test   %r15b,%r15b
jle    1262 <main+0x132>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11f0 <main+0xc0>
lea    0xdf7(%rip),%rdi
call   1040 <puts@plt>
test   %r15b,%r15b
jle    126e <main+0x13e>
xor    %ebx,%ebx
jmp    123a <main+0x10a>
nopw   0x0(%rax,%rax,1)
add    $0xe0,%dil
mov    %dil,(%rsp,%rbx,1)
movsbl %dil,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
je     126e <main+0x13e>
movzbl (%rsp,%rbx,1),%edi
lea    -0x41(%rdi),%eax
cmp    $0x19,%al
ja     1220 <main+0xf0>
add    $0x20,%edi
mov    %dil,(%rsp,%rbx,1)
jmp    122c <main+0xfc>
lea    0xdab(%rip),%rdi
call   1040 <puts@plt>
movl   $0x414e414c,0x9(%rsp)
41
lea    0xd97(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call signext i8 (...) @rand()
%6 = sext i8 %5 to i32
%7 = srem i32 %6, 100
store i32 %7, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %40, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %43
12: ; preds = %8
%13 = call signext i8 (...) @rand()
%14 = sext i8 %13 to i32
%15 = srem i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %12
%18 = call signext i8 (...) @rand()
%19 = sext i8 %18 to i32
%20 = srem i32 %19, 26
%21 = add nsw i32 %20, 65
%22 = trunc i32 %21 to i8
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
store i8 %22, i8* %25
%26 = sext i8 %22 to i32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %39
28: ; preds = %12
%29 = call signext i8 (...) @rand()
%30 = sext i8 %29 to i32
%31 = srem i32 %30, 26
%32 = add nsw i32 %31, 97
%33 = trunc i32 %32 to i8
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %35
store i8 %33, i8* %36
%37 = sext i8 %33 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %28, %17
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %8
43: ; preds = %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 9
store i8 76, i8* %45
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 10
store i8 65, i8* %46
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 11
store i8 78, i8* %47
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 12
store i8 65, i8* %48
store i32 0, i32* %3
br label %49
49: ; preds = %60, %43
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %49
63: ; preds = %49
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %65
65: ; preds = %112, %63
%66 = load i32, i32* %3
%67 = load i32, i32* %4
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %115
69: ; preds = %65
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp sge i32 %74, 65
br i1 %75, label %76, label %97
76: ; preds = %69
%77 = load i32, i32* %3
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp sle i32 %81, 90
br i1 %82, label %83, label %97
83: ; preds = %76
%84 = load i32, i32* %3
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = add nsw i32 97, %88
%90 = sub nsw i32 %89, 65
%91 = trunc i32 %90 to i8
%92 = load i32, i32* %3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %93
store i8 %91, i8* %94
%95 = sext i8 %91 to i32
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %95)
br label %111
97: ; preds = %76, %69
%98 = load i32, i32* %3
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = add nsw i32 65, %102
%104 = sub nsw i32 %103, 97
%105 = trunc i32 %104 to i8
%106 = load i32, i32* %3
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %107
store i8 %105, i8* %108
%109 = sext i8 %105 to i32
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %97, %83
br label %112
112: ; preds = %111
%113 = load i32, i32* %3
%114 = add nsw i32 %113, 1
store i32 %114, i32* %3
br label %65
115: ; preds = %65
%116 = load i32, i32* %1
ret i32 %116
}

LLVM IR (-O2):
@str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 (...) @rand()
%4 = srem i8 %3, 100
%5 = sext i8 %4 to i32
%6 = icmp sgt i8 %4, 0
br i1 %6, label %7, label %31
7: ; preds = %0
%8 = zext i32 %5 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %23, %9 ]
%11 = tail call signext i8 (...) @rand()
%12 = and i8 %11, 1
%13 = icmp eq i8 %12, 0
%14 = tail call signext i8 (...) @rand()
%15 = srem i8 %14, 26
%16 = add nsw i8 %15, 65
%17 = add nsw i8 %15, 97
%18 = select i1 %13, i8 %17, i8 %16
%19 = select i1 %13, i8 %17, i8 %16
%20 = zext i8 %18 to i32
%21 = tail call i32 @putchar(i32 %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %10
store i8 %19, i8* %22
%23 = add nuw nsw i64 %10, 1
%24 = icmp eq i64 %23, %8
br i1 %24, label %25, label %9
25: ; preds = %9
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 9
store i8 76, i8* %27
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
store i8 65, i8* %28
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 11
store i8 78, i8* %29
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 12
store i8 65, i8* %30
br i1 %6, label %39, label %37
31: ; preds = %0
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 9
store i8 76, i8* %33
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
store i8 65, i8* %34
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 11
store i8 78, i8* %35
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 12
store i8 65, i8* %36
br label %37
37: ; preds = %31, %25
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
br label %70
39: ; preds = %25
%40 = zext i32 %5 to i64
br label %41
41: ; preds = %39, %41
%42 = phi i64 [ 0, %39 ], [ %47, %41 ]
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = tail call i32 @putchar(i32 %45)
%47 = add nuw nsw i64 %42, 1
%48 = icmp eq i64 %47, %40
br i1 %48, label %49, label %41
49: ; preds = %41
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
br i1 %6, label %51, label %70
51: ; preds = %49
%52 = zext i32 %5 to i64
br label %53
53: ; preds = %51, %65
%54 = phi i64 [ 0, %51 ], [ %68, %65 ]
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = add i8 %56, -65
%58 = icmp ult i8 %57, 26
br i1 %58, label %59, label %62
59: ; preds = %53
%60 = add nuw nsw i8 %56, 32
store i8 %60, i8* %55
%61 = zext i8 %60 to i32
br label %65
62: ; preds = %53
%63 = add i8 %56, -32
store i8 %63, i8* %55
%64 = sext i8 %63 to i32
br label %65
65: ; preds = %59, %62
%66 = phi i32 [ %61, %59 ], [ %64, %62 ]
%67 = tail call i32 @putchar(i32 %66)
%68 = add nuw nsw i64 %54, 1
%69 = icmp eq i64 %68, %52
br i1 %69, label %70, label %53
70: ; preds = %65, %37, %49
ret i32 0
}