#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, char, char, int, int, int);
int /*<<< orphan*/ scanf(char *, char *, char *, char *);
int toupper(char);
int main() {
  char a = 0;
  char b = 0;
  char c = 0;
  scanf("%c%c%c", &a, &b, &c);
  printf("upper(%c%c%c)=%c%c%c\n", a, b, c, toupper(a), toupper(b), toupper(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0x6(%rbp),%rdx
lea    -0x7(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x5(%rbp),%al
mov    %al,-0x13(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x11(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x10(%rbp)
movsbl -0x6(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x7(%rbp),%edi
call   1030 <toupper@plt>
mov    -0x13(%rbp),%sil
mov    -0x12(%rbp),%dl
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe58(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
mov    %eax,(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
movb   $0x0,0xe(%rsp)
movb   $0x0,0xd(%rsp)
lea    0xeae(%rip),%rdi
lea    0xf(%rsp),%rsi
lea    0xe(%rsp),%rdx
lea    0xd(%rsp),%rcx
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%ebx
movsbl 0xe(%rsp),%r15d
movsbl 0xd(%rsp),%r14d
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %eax,%r12d
movsbl 0xe(%rsp),%edi
call   1030 <toupper@plt>
mov    %eax,%ebp
movsbl 0xd(%rsp),%edi
call   1030 <toupper@plt>
mov    %eax,(%rsp)
lea    0xe66(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
mov    %ebp,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [22 x i8] c"upper(%c%c%c)=%c%c%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
store i8 0, i8* %3
store i8 0, i8* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4)
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = load i8, i8* %4
%9 = load i8, i8* %2
%10 = call i32 @toupper(i8 signext %9)
%11 = load i8, i8* %3
%12 = call i32 @toupper(i8 signext %11)
%13 = load i8, i8* %4
%14 = call i32 @toupper(i8 signext %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8 signext %6, i8 signext %7, i8 signext %8, i32 %10, i32 %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [22 x i8] c"upper(%c%c%c)=%c%c%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %2
store i8 0, i8* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = call i32 @toupper(i8 signext %5)
%9 = load i8, i8* %2
%10 = call i32 @toupper(i8 signext %9)
%11 = load i8, i8* %3
%12 = call i32 @toupper(i8 signext %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %6, i8 signext %7, i32 %8, i32 %10, i32 %12)
ret i32 0
}