#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 *);
int main() {
  char str[10] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
  char strNew[10];
  int i;
  printf("The string is: %s", str);
  for (i = 0; i < 10; i++) {
    if (str[i] >= 65 && str[i] <= 90) {
      strNew[i] = str[i] + 32;
    }
  }
  printf("\nThe string in uppercase is: %s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    11a3 <main+0x93>
movslq -0x1c(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jl     1190 <main+0x80>
movslq -0x1c(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jg     1190 <main+0x80>
movslq -0x1c(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
add    $0x20,%eax
mov    %al,%cl
movslq -0x1c(%rbp),%rax
mov    %cl,-0x18(%rbp,%rax,1)
jmp    1195 <main+0x85>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <main+0x3c>
lea    -0xe(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x4847464544434241,%rax
46 47 48
mov    %rax,(%rsp)
movw   $0x4a49,0x8(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"ABCDEFGHIJ"
@.str = [18 x i8] c"The string is: %s\00"
@.str.1 = [32 x i8] c"\0AThe string in uppercase is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i8]* %2 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %4
br label %8
8: ; preds = %37, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %40
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %36
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %36
25: ; preds = %18
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = add nsw i32 %30, 32
%32 = trunc i32 %31 to i8
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %34
store i8 %32, i8* %35
br label %36
36: ; preds = %25, %18, %11
br label %37
37: ; preds = %36
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %8
40: ; preds = %8
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%42 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %41)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"ABCDEFGHIJ"
@.str = [18 x i8] c"The string is: %s\00"
@.str.1 = [32 x i8] c"\0AThe string in uppercase is: %s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}