#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*/ clr();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlwr(char *);
int /*<<< orphan*/ strupr(char *);
int main() {
  char name[255];
  clr();
  gotoxy(10, 10);
  printf("Enter string: ");
  gets(name);
  clr();
  strupr(name);
  gotoxy(10, 10);
  printf("Upper case string: %s", name);
  getchar();
  clr();
  strlwr(name);
  gotoxy(10, 10);
  printf("Lower case string: %s", name);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    $0x0,%al
call   1040 <clr@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1090 <gotoxy@plt>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x100(%rbp),%rdi
call   1070 <gets@plt>
mov    $0x0,%al
call   1040 <clr@plt>
lea    -0x100(%rbp),%rdi
call   1080 <strupr@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1090 <gotoxy@plt>
lea    -0x100(%rbp),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1040 <clr@plt>
lea    -0x100(%rbp),%rdi
call   1030 <strlwr@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1090 <gotoxy@plt>
lea    -0x100(%rbp),%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1040 <clr@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1090 <gotoxy@plt>
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
xor    %eax,%eax
call   1040 <clr@plt>
mov    %rbx,%rdi
call   1080 <strupr@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1090 <gotoxy@plt>
lea    0xe43(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1040 <clr@plt>
mov    %rbx,%rdi
call   1030 <strlwr@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1090 <gotoxy@plt>
lea    0xe23(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [22 x i8] c"Upper case string: %s\00"
@.str.2 = [22 x i8] c"Lower case string: %s\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = call i32 (...) @clr()
%3 = call i32 @gotoxy(i32 10, i32 10)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 (...) @clr()
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%9 = call i32 @strupr(i8* %8)
%10 = call i32 @gotoxy(i32 10, i32 10)
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (...) @getchar()
%14 = call i32 (...) @clr()
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%16 = call i32 @strlwr(i8* %15)
%17 = call i32 @gotoxy(i32 10, i32 10)
%18 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [22 x i8] c"Upper case string: %s\00"
@.str.2 = [22 x i8] c"Lower case string: %s\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @clr()
%4 = tail call i32 @gotoxy(i32 10, i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %2)
%7 = call i32 (...) @clr()
%8 = call i32 @strupr(i8* %2)
%9 = call i32 @gotoxy(i32 10, i32 10)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%11 = call i32 (...) @getchar()
%12 = call i32 (...) @clr()
%13 = call i32 @strlwr(i8* %2)
%14 = call i32 @gotoxy(i32 10, i32 10)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%16 = call i32 (...) @getchar()
ret i32 0
}