#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*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strlwr(char *);
int /*<<< orphan*/ strupr(char *);
int main() {
  char nam[500];
  printf("Enter your string.\n");
  gets(nam);
  printf("Making Uppercase of your string....\n");
  sleep(8000);
  strupr(nam);
  printf("\n\nUppercase of your string is:");
  puts(nam);
  printf("----------------------------------------------------------\n");
  printf("\n\nMaking lowercase of your string....\n");
  sleep(8000);
  strlwr(nam);
  printf("\n\nLowercase of your string is:");
  puts(nam);
  printf("\n\n\n\n\n\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1060 <gets@plt>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1f40,%edi
call   1080 <sleep@plt>
lea    -0x200(%rbp),%rdi
call   1070 <strupr@plt>
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1f40,%edi
call   1080 <sleep@plt>
lea    -0x200(%rbp),%rdi
call   1030 <strlwr@plt>
lea    0xec2(%rip),%rdi
call   1050 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1f40,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
call   1070 <strupr@plt>
lea    0xe5c(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1f40,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
call   1030 <strlwr@plt>
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xee0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter your string.\0A\00"
@.str.1 = [37 x i8] c"Making Uppercase of your string....\0A\00"
@.str.2 = [31 x i8] c"\0A\0AUppercase of your string is:\00"
@.str.3 = [60 x i8] c"----------------------------------------------------------\0A\00"
@.str.4 = [39 x i8] c"\0A\0AMaking lowercase of your string....\0A\00"
@.str.5 = [31 x i8] c"\0A\0ALowercase of your string is:\00"
@.str.6 = [8 x i8] c"\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [500 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @sleep(i32 8000)
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%9 = call i32 @strupr(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%12 = call i32 @puts(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @sleep(i32 8000)
%16 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%17 = call i32 @strlwr(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%20 = call i32 @puts(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [31 x i8] c"\0A\0AUppercase of your string is:\00"
@.str.5 = [31 x i8] c"\0A\0ALowercase of your string is:\00"
@str = [19 x i8] c"Enter your string.\00"
@str.7 = [36 x i8] c"Making Uppercase of your string....\00"
@str.8 = [59 x i8] c"----------------------------------------------------------\00"
@str.9 = [38 x i8] c"\0A\0AMaking lowercase of your string....\00"
@str.10 = [7 x i8] c"\0A\0A\0A\0A\0A\0A\00"
define i32 @main() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.7, i64 0, i64 0))
%6 = call i32 @sleep(i32 8000)
%7 = call i32 @strupr(i8* %2)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @puts(i8* %2)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.8, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.9, i64 0, i64 0))
%12 = call i32 @sleep(i32 8000)
%13 = call i32 @strlwr(i8* %2)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @puts(i8* %2)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}