#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);
void main() {
  char str[20] = "C languAge", c;
  int i;
  i = 0;
  while ((c = str[i]) != '\0') {
    i++;
    if (c >= 'a' && c <= 'z')
      c = c + 'A' - 'a';
    printf("%c", c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%al
mov    %al,-0x21(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     119a <main+0x8a>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x61,%eax
jl     1185 <main+0x75>
movsbl -0x21(%rbp),%eax
cmp    $0x7a,%eax
jg     1185 <main+0x75>
movsbl -0x21(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %al,-0x21(%rbp)
lea    0xe88(%rip),%rdi
movsbl -0x21(%rbp),%esi
call   1030 <printf@plt>
jmp    113e <main+0x2e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x47,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x47,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.str = [20 x i8] c"C languAge\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca [20 x i8]
%2 = alloca i8
%3 = alloca i32
%4 = bitcast [20 x i8]* %1 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %28, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %31
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %28
18: ; preds = %12
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, 65
%26 = sub nsw i32 %25, 97
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
br label %28
28: ; preds = %22, %18, %12
%29 = load i8, i8* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
br label %5
31: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 67)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 32)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 76)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 78)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 71)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 85)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 71)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 69)
ret void
}