#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main(void) {
  char fi, ch;
  printf("Enter first and last name: ");
  while ((ch = getchar()) == ' ')
    ;
  fi = ch;
  while ((ch = getchar()) != ' ')
    ;
  while ((ch = getchar()) != '\n') {
    if (ch != ' ')
      putchar(ch);
  }
  printf(", %c.\n", fi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
jne    1168 <main+0x38>
jmp    114d <main+0x1d>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
je     1189 <main+0x59>
jmp    116e <main+0x3e>
jmp    118e <main+0x5e>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11bf <main+0x8f>
movsbl -0x6(%rbp),%eax
cmp    $0x20,%eax
je     11ba <main+0x8a>
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
jmp    118e <main+0x5e>
movsbl -0x5(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
nop
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
je     1140 <main+0x10>
mov    %eax,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
jne    1150 <main+0x20>
jmp    1168 <main+0x38>
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
je     1168 <main+0x38>
cmp    $0xa,%al
jne    1160 <main+0x30>
movsbl %bl,%esi
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter first and last name: \00"
@.str.1 = [7 x i8] c", %c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %9, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i8, i8* %3
store i8 %11, i8* %2
br label %12
12: ; preds = %16, %10
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 32
br i1 %15, label %16, label %17
16: ; preds = %12
br label %12
17: ; preds = %12
br label %18
18: ; preds = %29, %17
%19 = call signext i8 (...) @getchar()
store i8 %19, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 10
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 32
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i8, i8* %3
%28 = call i32 @putchar(i8 signext %27)
br label %29
29: ; preds = %26, %22
br label %18
30: ; preds = %18
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter first and last name: \00"
@.str.1 = [7 x i8] c", %c.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 32
br i1 %4, label %2, label %5
5: ; preds = %2, %5
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %5
8: ; preds = %5, %10
%9 = tail call signext i8 (...) @getchar()
switch i8 %9, label %11 [
i8 10, label %13
i8 32, label %10
]
10: ; preds = %8, %11
br label %8
11: ; preds = %8
%12 = tail call i32 @putchar(i8 signext %9)
br label %10
13: ; preds = %8
%14 = sext i8 %3 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}