#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*/ scanf(char *, char *);
int main(void) {
  char ln[20];
  int fi;
  printf("Enter your first and last name: ");
  while ((fi = getchar()) == ' ') {
    if (fi != ' ') {
      break;
    }
  }
  while (getchar() != ' ') {
  }
  for (int i = 0; i <= 20; i += 1) {
    scanf("%c", &ln[i]);
    if (ln[i] == '\n') {
      break;
    }
  }
  printf("You entered the name: ");
  for (int i = 0; i <= 20; i += 1) {
    printf("%c", ln[i]);
    if (ln[i + 1] == '\n') {
      break;
    }
  }
  printf(", %c.\n", fi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x24(%rbp)
cmp    $0x20,%eax
jne    1177 <main+0x47>
cmpl   $0x20,-0x24(%rbp)
je     1172 <main+0x42>
jmp    1177 <main+0x47>
jmp    114d <main+0x1d>
jmp    117c <main+0x4c>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x20,%eax
je     1194 <main+0x64>
jmp    117c <main+0x4c>
movl   $0x0,-0x28(%rbp)
cmpl   $0x14,-0x28(%rbp)
jg     11e6 <main+0xb6>
movslq -0x28(%rbp),%rax
lea    -0x20(%rbp),%rsi
add    %rax,%rsi
lea    0xe6a(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    11d3 <main+0xa3>
jmp    11e6 <main+0xb6>
jmp    11d8 <main+0xa8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    119b <main+0x6b>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x14,-0x2c(%rbp)
jg     124a <main+0x11a>
movslq -0x2c(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%esi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1237 <main+0x107>
jmp    124a <main+0x11a>
jmp    123c <main+0x10c>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11fb <main+0xcb>
mov    -0x24(%rbp),%esi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
je     1160 <main+0x20>
mov    %eax,%ebp
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
jne    1170 <main+0x30>
lea    0xe9f(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmpb   $0xa,(%rsp)
je     13a5 <main+0x265>
lea    0x1(%rsp),%rsi
lea    0xe81(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x1(%rsp)
je     13a5 <main+0x265>
lea    0x2(%rsp),%rsi
lea    0xe65(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x2(%rsp)
je     13a5 <main+0x265>
lea    0x3(%rsp),%rsi
lea    0xe49(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x3(%rsp)
je     13a5 <main+0x265>
lea    0x4(%rsp),%rsi
lea    0xe2d(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x4(%rsp)
je     13a5 <main+0x265>
lea    0x5(%rsp),%rsi
lea    0xe11(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x5(%rsp)
je     13a5 <main+0x265>
lea    0x6(%rsp),%rsi
lea    0xdf5(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x6(%rsp)
je     13a5 <main+0x265>
lea    0x7(%rsp),%rsi
lea    0xdd9(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     13a5 <main+0x265>
lea    0x8(%rsp),%rsi
lea    0xdbd(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x8(%rsp)
je     13a5 <main+0x265>
lea    0x9(%rsp),%rsi
lea    0xda1(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x9(%rsp)
je     13a5 <main+0x265>
lea    0xa(%rsp),%rsi
lea    0xd85(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xa(%rsp)
je     13a5 <main+0x265>
lea    0xb(%rsp),%rsi
lea    0xd69(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xb(%rsp)
je     13a5 <main+0x265>
lea    0xc(%rsp),%rsi
lea    0xd4d(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xc(%rsp)
je     13a5 <main+0x265>
lea    0xd(%rsp),%rsi
lea    0xd31(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xd(%rsp)
je     13a5 <main+0x265>
lea    0xe(%rsp),%rsi
lea    0xd15(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xe(%rsp)
je     13a5 <main+0x265>
lea    0xf(%rsp),%rsi
lea    0xcf9(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0xf(%rsp)
je     13a5 <main+0x265>
lea    0x10(%rsp),%rsi
lea    0xce1(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x10(%rsp)
je     13a5 <main+0x265>
lea    0x11(%rsp),%rsi
lea    0xcc9(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x11(%rsp)
je     13a5 <main+0x265>
lea    0x12(%rsp),%rsi
lea    0xcb1(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x12(%rsp)
je     13a5 <main+0x265>
lea    0x13(%rsp),%rsi
lea    0xc99(%rip),%rdi
call   1060 <scanf@plt>
cmpb   $0xa,0x13(%rsp)
je     13a5 <main+0x265>
lea    0x14(%rsp),%rsi
lea    0xc81(%rip),%rdi
call   1060 <scanf@plt>
lea    0xc78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
cmp    $0x16,%rbx
je     13da <main+0x29a>
movsbl -0x1(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
cmpb   $0xa,(%rsp,%rbx,1)
lea    0x1(%rbx),%rbx
jne    13c0 <main+0x280>
movsbl %bpl,%esi
lea    0xc56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
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 = [23 x i8] c"You entered the name: \00"
@.str.3 = [7 x i8] c", %c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %15, %0
%8 = call signext i8 (...) @getchar()
%9 = sext i8 %8 to i32
store i32 %9, i32* %3
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 32
br i1 %13, label %14, label %15
14: ; preds = %11
br label %16
15: ; preds = %11
br label %7
16: ; preds = %14, %7
br label %17
17: ; preds = %21, %16
%18 = call signext i8 (...) @getchar()
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 32
br i1 %20, label %21, label %22
21: ; preds = %17
br label %17
22: ; preds = %17
store i32 0, i32* %4
br label %23
23: ; preds = %39, %22
%24 = load i32, i32* %4
%25 = icmp sle i32 %24, 20
br i1 %25, label %26, label %42
26: ; preds = %23
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 10
br i1 %36, label %37, label %38
37: ; preds = %26
br label %42
38: ; preds = %26
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %23
42: ; preds = %37, %23
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %44
44: ; preds = %63, %42
%45 = load i32, i32* %5
%46 = icmp sle i32 %45, 20
br i1 %46, label %47, label %66
47: ; preds = %44
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 10
br i1 %60, label %61, label %62
61: ; preds = %47
br label %66
62: ; preds = %47
br label %63
63: ; preds = %62
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %5
br label %44
66: ; preds = %61, %44
%67 = load i32, i32* %3
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %67)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter your first and last name: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [23 x i8] c"You entered the name: \00"
@.str.3 = [7 x i8] c", %c.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 32
br i1 %6, label %4, label %7
7: ; preds = %4, %7
%8 = tail call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%12 = load i8, i8* %2
%13 = icmp eq i8 %12, 10
br i1 %13, label %112, label %14
14: ; preds = %10
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 10
br i1 %18, label %112, label %19
19: ; preds = %14
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8, i8* %20
%23 = icmp eq i8 %22, 10
br i1 %23, label %112, label %24
24: ; preds = %19
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = load i8, i8* %25
%28 = icmp eq i8 %27, 10
br i1 %28, label %112, label %29
29: ; preds = %24
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load i8, i8* %30
%33 = icmp eq i8 %32, 10
br i1 %33, label %112, label %34
34: ; preds = %29
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = load i8, i8* %35
%38 = icmp eq i8 %37, 10
br i1 %38, label %112, label %39
39: ; preds = %34
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = load i8, i8* %40
%43 = icmp eq i8 %42, 10
br i1 %43, label %112, label %44
44: ; preds = %39
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %45)
%47 = load i8, i8* %45
%48 = icmp eq i8 %47, 10
br i1 %48, label %112, label %49
49: ; preds = %44
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 8
%51 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %50)
%52 = load i8, i8* %50
%53 = icmp eq i8 %52, 10
br i1 %53, label %112, label %54
54: ; preds = %49
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 9
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %55)
%57 = load i8, i8* %55
%58 = icmp eq i8 %57, 10
br i1 %58, label %112, label %59
59: ; preds = %54
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 10
%61 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %60)
%62 = load i8, i8* %60
%63 = icmp eq i8 %62, 10
br i1 %63, label %112, label %64
64: ; preds = %59
%65 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 11
%66 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %65)
%67 = load i8, i8* %65
%68 = icmp eq i8 %67, 10
br i1 %68, label %112, label %69
69: ; preds = %64
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 12
%71 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %70)
%72 = load i8, i8* %70
%73 = icmp eq i8 %72, 10
br i1 %73, label %112, label %74
74: ; preds = %69
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 13
%76 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %75)
%77 = load i8, i8* %75
%78 = icmp eq i8 %77, 10
br i1 %78, label %112, label %79
79: ; preds = %74
%80 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 14
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %80)
%82 = load i8, i8* %80
%83 = icmp eq i8 %82, 10
br i1 %83, label %112, label %84
84: ; preds = %79
%85 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 15
%86 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %85)
%87 = load i8, i8* %85
%88 = icmp eq i8 %87, 10
br i1 %88, label %112, label %89
89: ; preds = %84
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 16
%91 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %90)
%92 = load i8, i8* %90
%93 = icmp eq i8 %92, 10
br i1 %93, label %112, label %94
94: ; preds = %89
%95 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 17
%96 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %95)
%97 = load i8, i8* %95
%98 = icmp eq i8 %97, 10
br i1 %98, label %112, label %99
99: ; preds = %94
%100 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 18
%101 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %100)
%102 = load i8, i8* %100
%103 = icmp eq i8 %102, 10
br i1 %103, label %112, label %104
104: ; preds = %99
%105 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 19
%106 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %105)
%107 = load i8, i8* %105
%108 = icmp eq i8 %107, 10
br i1 %108, label %112, label %109
109: ; preds = %104
%110 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 20
%111 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %110)
br label %112
112: ; preds = %109, %104, %99, %94, %89, %84, %79, %74, %69, %64, %59, %54, %49, %44, %39, %34, %29, %24, %19, %14, %10
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %114
114: ; preds = %117, %112
%115 = phi i64 [ %122, %117 ], [ 0, %112 ]
%116 = icmp eq i64 %115, 21
br i1 %116, label %126, label %117
117: ; preds = %114
%118 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %115
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = call i32 @putchar(i32 %120)
%122 = add nuw nsw i64 %115, 1
%123 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %122
%124 = load i8, i8* %123
%125 = icmp eq i8 %124, 10
br i1 %125, label %126, label %114
126: ; preds = %117, %114
%127 = sext i8 %5 to i32
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %127)
ret i32 0
}