#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*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ tolower(char);
int /*<<< orphan*/ toupper(char);
int main() {
  int i = 0;
  char str[] = "Linkerist Heracles";
  while (str[i])
    putchar(toupper(str[i++]));
  printf("\n");
  i = 0;
  while (str[i])
    putchar(tolower(str[i++]));
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe9d(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xe95(%rip),%al
mov    %al,-0xe(%rbp)
movslq -0x8(%rbp),%rax
cmpb   $0x0,-0x20(%rbp,%rax,1)
je     11b2 <main+0x72>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
movsbl -0x20(%rbp,%rax,1),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x40>
lea    0xe5a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmpb   $0x0,-0x20(%rbp,%rax,1)
je     11f7 <main+0xb7>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
movsbl -0x20(%rbp,%rax,1),%edi
call   1060 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    11c5 <main+0x85>
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4c,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6b,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4c,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6b,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [19 x i8] c"Linkerist Heracles\00"
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [19 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [19 x i8]* %3 to i8*
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @toupper(i8 signext %16)
%18 = call i32 @putchar(i32 %17)
br label %5
19: ; preds = %5
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %21
21: ; preds = %27, %19
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = icmp ne i8 %25, 0
br i1 %26, label %27, label %35
27: ; preds = %21
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @tolower(i8 signext %32)
%34 = call i32 @putchar(i32 %33)
br label %21
35: ; preds = %21
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @toupper(i8 signext 76)
%2 = tail call i32 @putchar(i32 %1)
%3 = tail call i32 @toupper(i8 signext 105)
%4 = tail call i32 @putchar(i32 %3)
%5 = tail call i32 @toupper(i8 signext 110)
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 @toupper(i8 signext 107)
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 @toupper(i8 signext 101)
%10 = tail call i32 @putchar(i32 %9)
%11 = tail call i32 @toupper(i8 signext 114)
%12 = tail call i32 @putchar(i32 %11)
%13 = tail call i32 @toupper(i8 signext 105)
%14 = tail call i32 @putchar(i32 %13)
%15 = tail call i32 @toupper(i8 signext 115)
%16 = tail call i32 @putchar(i32 %15)
%17 = tail call i32 @toupper(i8 signext 116)
%18 = tail call i32 @putchar(i32 %17)
%19 = tail call i32 @toupper(i8 signext 32)
%20 = tail call i32 @putchar(i32 %19)
%21 = tail call i32 @toupper(i8 signext 72)
%22 = tail call i32 @putchar(i32 %21)
%23 = tail call i32 @toupper(i8 signext 101)
%24 = tail call i32 @putchar(i32 %23)
%25 = tail call i32 @toupper(i8 signext 114)
%26 = tail call i32 @putchar(i32 %25)
%27 = tail call i32 @toupper(i8 signext 97)
%28 = tail call i32 @putchar(i32 %27)
%29 = tail call i32 @toupper(i8 signext 99)
%30 = tail call i32 @putchar(i32 %29)
%31 = tail call i32 @toupper(i8 signext 108)
%32 = tail call i32 @putchar(i32 %31)
%33 = tail call i32 @toupper(i8 signext 101)
%34 = tail call i32 @putchar(i32 %33)
%35 = tail call i32 @toupper(i8 signext 115)
%36 = tail call i32 @putchar(i32 %35)
%37 = tail call i32 @putchar(i32 10)
%38 = tail call i32 @tolower(i8 signext 76)
%39 = tail call i32 @putchar(i32 %38)
%40 = tail call i32 @tolower(i8 signext 105)
%41 = tail call i32 @putchar(i32 %40)
%42 = tail call i32 @tolower(i8 signext 110)
%43 = tail call i32 @putchar(i32 %42)
%44 = tail call i32 @tolower(i8 signext 107)
%45 = tail call i32 @putchar(i32 %44)
%46 = tail call i32 @tolower(i8 signext 101)
%47 = tail call i32 @putchar(i32 %46)
%48 = tail call i32 @tolower(i8 signext 114)
%49 = tail call i32 @putchar(i32 %48)
%50 = tail call i32 @tolower(i8 signext 105)
%51 = tail call i32 @putchar(i32 %50)
%52 = tail call i32 @tolower(i8 signext 115)
%53 = tail call i32 @putchar(i32 %52)
%54 = tail call i32 @tolower(i8 signext 116)
%55 = tail call i32 @putchar(i32 %54)
%56 = tail call i32 @tolower(i8 signext 32)
%57 = tail call i32 @putchar(i32 %56)
%58 = tail call i32 @tolower(i8 signext 72)
%59 = tail call i32 @putchar(i32 %58)
%60 = tail call i32 @tolower(i8 signext 101)
%61 = tail call i32 @putchar(i32 %60)
%62 = tail call i32 @tolower(i8 signext 114)
%63 = tail call i32 @putchar(i32 %62)
%64 = tail call i32 @tolower(i8 signext 97)
%65 = tail call i32 @putchar(i32 %64)
%66 = tail call i32 @tolower(i8 signext 99)
%67 = tail call i32 @putchar(i32 %66)
%68 = tail call i32 @tolower(i8 signext 108)
%69 = tail call i32 @putchar(i32 %68)
%70 = tail call i32 @tolower(i8 signext 101)
%71 = tail call i32 @putchar(i32 %70)
%72 = tail call i32 @tolower(i8 signext 115)
%73 = tail call i32 @putchar(i32 %72)
%74 = tail call i32 @putchar(i32 10)
ret i32 0
}