#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 first[20], middle[20], last[20];
  printf("Enter your first name\n");
  scanf("%s", first);
  printf("Enter your middle name\n");
  scanf("%s", middle);
  printf("Enter you last name\n");
  scanf("%s", last);
  last[0] = last[0] >= 'a' && last[0] <= 'z' ? last[0] += 'A' - 'a' : last[0];
  middle[0] =
      middle[0] >= 'a' && middle[0] <= 'z' ? middle[0] += 'A' - 'a' : middle[0];
  first[0] =
      first[0] >= 'a' && first[0] <= 'z' ? first[0] += 'A' - 'a' : first[0];
  printf("%c.%c.%s\n", last[0], middle[0], first);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x60(%rbp),%eax
cmp    $0x61,%eax
jl     11b8 <main+0x98>
movsbl -0x60(%rbp),%eax
cmp    $0x7a,%eax
jg     11b8 <main+0x98>
movsbl -0x60(%rbp),%eax
add    $0xffffffe0,%eax
mov    %al,-0x60(%rbp)
movsbl %al,%eax
mov    %eax,-0x64(%rbp)
jmp    11bf <main+0x9f>
movsbl -0x60(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %al,-0x60(%rbp)
movsbl -0x40(%rbp),%eax
cmp    $0x61,%eax
jl     11f4 <main+0xd4>
movsbl -0x40(%rbp),%eax
cmp    $0x7a,%eax
jg     11f4 <main+0xd4>
movsbl -0x40(%rbp),%eax
add    $0xffffffe0,%eax
mov    %al,-0x40(%rbp)
movsbl %al,%eax
mov    %eax,-0x68(%rbp)
jmp    11fb <main+0xdb>
movsbl -0x40(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    %al,-0x40(%rbp)
movsbl -0x20(%rbp),%eax
cmp    $0x61,%eax
jl     1230 <main+0x110>
movsbl -0x20(%rbp),%eax
cmp    $0x7a,%eax
jg     1230 <main+0x110>
movsbl -0x20(%rbp),%eax
add    $0xffffffe0,%eax
mov    %al,-0x20(%rbp)
movsbl %al,%eax
mov    %eax,-0x6c(%rbp)
jmp    1237 <main+0x117>
movsbl -0x20(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %al,-0x20(%rbp)
movsbl -0x60(%rbp),%esi
movsbl -0x40(%rbp),%edx
lea    -0x20(%rbp),%rcx
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rbx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%ecx
lea    -0x61(%rcx),%eax
lea    -0x20(%rcx),%edx
cmp    $0x1a,%al
movzbl %dl,%eax
cmovae %ecx,%eax
mov    0x20(%rsp),%ecx
lea    -0x61(%rcx),%edx
lea    -0x20(%rcx),%esi
cmp    $0x1a,%dl
movzbl %sil,%edx
cmovae %ecx,%edx
mov    %al,(%rsp)
mov    0x40(%rsp),%ecx
lea    -0x61(%rcx),%esi
lea    -0x20(%rcx),%edi
cmp    $0x1a,%sil
movzbl %dil,%esi
cmovae %ecx,%esi
mov    %dl,0x20(%rsp)
mov    %sil,0x40(%rsp)
movsbl %al,%esi
movsbl %dl,%edx
lea    0xe26(%rip),%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter your first name\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"Enter your middle name\0A\00"
@.str.3 = [21 x i8] c"Enter you last name\0A\00"
@.str.4 = [10 x i8] c"%c.%c.%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %30
18: ; preds = %0
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 122
br i1 %22, label %23, label %30
23: ; preds = %18
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = add nsw i32 %26, -32
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
%29 = sext i8 %28 to i32
br label %34
30: ; preds = %18, %0
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
br label %34
34: ; preds = %30, %23
%35 = phi i32 [ %29, %23 ], [ %33, %30 ]
%36 = trunc i32 %35 to i8
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
store i8 %36, i8* %37
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp sge i32 %40, 97
br i1 %41, label %42, label %54
42: ; preds = %34
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp sle i32 %45, 122
br i1 %46, label %47, label %54
47: ; preds = %42
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = add nsw i32 %50, -32
%52 = trunc i32 %51 to i8
store i8 %52, i8* %48
%53 = sext i8 %52 to i32
br label %58
54: ; preds = %42, %34
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
br label %58
58: ; preds = %54, %47
%59 = phi i32 [ %53, %47 ], [ %57, %54 ]
%60 = trunc i32 %59 to i8
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 %60, i8* %61
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp sge i32 %64, 97
br i1 %65, label %66, label %78
66: ; preds = %58
%67 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp sle i32 %69, 122
br i1 %70, label %71, label %78
71: ; preds = %66
%72 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = add nsw i32 %74, -32
%76 = trunc i32 %75 to i8
store i8 %76, i8* %72
%77 = sext i8 %76 to i32
br label %82
78: ; preds = %66, %58
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
br label %82
82: ; preds = %78, %71
%83 = phi i32 [ %77, %71 ], [ %81, %78 ]
%84 = trunc i32 %83 to i8
%85 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
store i8 %84, i8* %85
%86 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %88, i32 %91, i8* %92)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [10 x i8] c"%c.%c.%s\0A\00"
@str = [22 x i8] c"Enter your first name\00"
@str.5 = [23 x i8] c"Enter your middle name\00"
@str.6 = [20 x i8] c"Enter you last name\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%13 = load i8, i8* %6
%14 = add i8 %13, -97
%15 = icmp ult i8 %14, 26
%16 = add nsw i8 %13, -32
%17 = select i1 %15, i8 %16, i8 %13
store i8 %17, i8* %6
%18 = load i8, i8* %5
%19 = add i8 %18, -97
%20 = icmp ult i8 %19, 26
%21 = add nsw i8 %18, -32
%22 = select i1 %20, i8 %21, i8 %18
store i8 %22, i8* %5
%23 = load i8, i8* %4
%24 = add i8 %23, -97
%25 = icmp ult i8 %24, 26
%26 = add nsw i8 %23, -32
%27 = select i1 %25, i8 %26, i8 %23
store i8 %27, i8* %4
%28 = sext i8 %17 to i32
%29 = sext i8 %22 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %28, i32 %29, i8* %4)
ret i32 0
}