#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*/ scanf(char *, char *);
int main() {
  char s[10], i;
  printf("Enter any string in lower case");
  scanf("%s", s);
  for (i = 0; i < 10 && s[i] != '\0'; i++) {
    s[i] = s[i] - 32;
  }
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
movb   $0x0,-0xf(%rbp)
movsbl -0xf(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x10(%rbp)
jge    1176 <main+0x56>
movsbq -0xf(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%al
test   $0x1,%al
jne    1186 <main+0x66>
jmp    11ab <main+0x8b>
movsbq -0xf(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
sub    $0x20,%eax
mov    %al,%cl
movsbq -0xf(%rbp),%rax
mov    %cl,-0xe(%rbp,%rax,1)
mov    -0xf(%rbp),%al
add    $0x1,%al
mov    %al,-0xf(%rbp)
jmp    1151 <main+0x31>
lea    -0xe(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xe(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0xe(%rsp)
mov    0xf(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0xf(%rsp)
mov    0x10(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x10(%rsp)
mov    0x11(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x11(%rsp)
mov    0x12(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x12(%rsp)
mov    0x13(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x13(%rsp)
mov    0x14(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x14(%rsp)
mov    0x15(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x15(%rsp)
mov    0x16(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x16(%rsp)
mov    0x17(%rsp),%al
test   %al,%al
je     11e3 <main+0xb3>
add    $0xe0,%al
mov    %al,0x17(%rsp)
lea    0xe(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Enter any string in lower case\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i8 0, i8* %3
br label %7
7: ; preds = %31, %0
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %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 ne i32 %16, 0
br label %18
18: ; preds = %11, %7
%19 = phi i1 [ false, %7 ], [ %17, %11 ]
br i1 %19, label %20, label %34
20: ; preds = %18
%21 = load i8, i8* %3
%22 = sext i8 %21 to i64
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 32
%27 = trunc i32 %26 to i8
%28 = load i8, i8* %3
%29 = sext i8 %28 to i64
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %29
store i8 %27, i8* %30
br label %31
31: ; preds = %20
%32 = load i8, i8* %3
%33 = add i8 %32, 1
store i8 %33, i8* %3
br label %7
34: ; preds = %18
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter any string in lower case\00"
@.str.1 = [3 x i8] c"%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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %54, label %7
7: ; preds = %0
%8 = add i8 %5, -32
store i8 %8, i8* %2
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %54, label %12
12: ; preds = %7
%13 = add i8 %10, -32
store i8 %13, i8* %9
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %54, label %17
17: ; preds = %12
%18 = add i8 %15, -32
store i8 %18, i8* %14
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %54, label %22
22: ; preds = %17
%23 = add i8 %20, -32
store i8 %23, i8* %19
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %54, label %27
27: ; preds = %22
%28 = add i8 %25, -32
store i8 %28, i8* %24
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 5
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %54, label %32
32: ; preds = %27
%33 = add i8 %30, -32
store i8 %33, i8* %29
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 6
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
br i1 %36, label %54, label %37
37: ; preds = %32
%38 = add i8 %35, -32
store i8 %38, i8* %34
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 7
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 0
br i1 %41, label %54, label %42
42: ; preds = %37
%43 = add i8 %40, -32
store i8 %43, i8* %39
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 8
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 0
br i1 %46, label %54, label %47
47: ; preds = %42
%48 = add i8 %45, -32
store i8 %48, i8* %44
%49 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %47
%53 = add i8 %50, -32
store i8 %53, i8* %49
br label %54
54: ; preds = %52, %47, %42, %37, %32, %27, %22, %17, %12, %7, %0
%55 = call i32 @puts(i8* %2)
ret i32 0
}