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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x20,%eax
jne    1167 <main+0x47>
cmpl   $0x20,-0xc(%rbp)
je     1162 <main+0x42>
jmp    1167 <main+0x47>
jmp    113d <main+0x1d>
jmp    116c <main+0x4c>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x20,%eax
je     1184 <main+0x64>
jmp    116c <main+0x4c>
jmp    1189 <main+0x69>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     11bf <main+0x9f>
cmpl   $0x20,-0x8(%rbp)
je     11ba <main+0x9a>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <main+0x69>
mov    -0xc(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <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    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"Enter your first and last name: \00"
@.str.2 = [7 x i8] c", %c.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 %14
i8 32, label %10
]
10: ; preds = %8, %11
br label %8
11: ; preds = %8
%12 = sext i8 %9 to i32
%13 = tail call i32 @putchar(i32 %12)
br label %10
14: ; preds = %8
%15 = sext i8 %3 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}