#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ lower(char);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i;
  char s[] = "HELLO, World!\n";
  for (i = 0; i < sizeof(s); ++i)
    putchar(lower(s[i]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x23(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x15(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0xf,%rax
jae    1196 <main+0x76>
movslq -0x14(%rbp),%rax
movsbl -0x23(%rbp,%rax,1),%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <main+0x45>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x45,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x4c,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x4c,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x4f,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x57,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @lower(i8 signext 72)
%4 = tail call i32 @putchar(i32 %3)
%5 = tail call i32 @lower(i8 signext 69)
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 @lower(i8 signext 76)
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 @lower(i8 signext 76)
%10 = tail call i32 @putchar(i32 %9)
%11 = tail call i32 @lower(i8 signext 79)
%12 = tail call i32 @putchar(i32 %11)
%13 = tail call i32 @lower(i8 signext 44)
%14 = tail call i32 @putchar(i32 %13)
%15 = tail call i32 @lower(i8 signext 32)
%16 = tail call i32 @putchar(i32 %15)
%17 = tail call i32 @lower(i8 signext 87)
%18 = tail call i32 @putchar(i32 %17)
%19 = tail call i32 @lower(i8 signext 111)
%20 = tail call i32 @putchar(i32 %19)
%21 = tail call i32 @lower(i8 signext 114)
%22 = tail call i32 @putchar(i32 %21)
%23 = tail call i32 @lower(i8 signext 108)
%24 = tail call i32 @putchar(i32 %23)
%25 = tail call i32 @lower(i8 signext 100)
%26 = tail call i32 @putchar(i32 %25)
%27 = tail call i32 @lower(i8 signext 33)
%28 = tail call i32 @putchar(i32 %27)
%29 = tail call i32 @lower(i8 signext 10)
%30 = tail call i32 @putchar(i32 %29)
%31 = tail call i32 @lower(i8 signext 0)
%32 = tail call i32 @putchar(i32 %31)
ret i32 0
}