#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 */
char lower(char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
main() {
  int i;
  char text[] = "asdFgHJKL;' qweRtYu 123-";
  i = 0;
  while (text[i] != '\0') {
    putchar(lower(text[i]));
    ++i;
  }
  putchar('\n');
  printf("%s\n", text);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11a6 <main+0x76>
movslq -0x8(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1050 <lower@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x30(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xecd(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x1(%rsp),%rbx
mov    $0x61,%al
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1050 <lower@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8d(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.text = [25 x i8] c"asdFgHJKL;' qweRtYu 123-\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [25 x i8]
store i32 0, i32* %1
%4 = bitcast [25 x i8]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %5
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @lower(i8 signext %16)
%18 = call i32 @putchar(i8 signext %17)
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = call i32 @putchar(i8 signext 10)
%23 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [25 x i8] c"asdFgHJKL;' qweRtYu 123-\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %8, %3 ]
%5 = phi i8 [ 97, %0 ], [ %10, %3 ]
%6 = tail call signext i8 @lower(i8 signext %5)
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %4, 1
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = tail call i32 @putchar(i8 signext 10)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}