#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(void) {
  char a[4];
  char b[6];
  char c[9];
  char *words[3] = {a, b, c};
  printf("Please enter a word with at  most 3 letters: ");
  scanf("%s", a);
  printf("Please enter a word with at  most 5 letters: ");
  scanf("%s", b);
  printf("Please enter a word with at  most 8 letters: ");
  scanf("%s", c);
  printf("You entered: \n");
  printf("%s %s %s.\n", a, b, c);
  printf("%s %s %s.\n", *words, *(words + 1), *(words + 2));
  printf("%s %s %s.\n", words[0], words[1], words[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x17(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x17(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <scanf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    -0xe(%rbp),%rdx
lea    -0x17(%rbp),%rcx
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%r12
lea    0xd(%rsp),%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x11(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x17(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Please enter a word with at most 3 letters: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [46 x i8] c"Please enter a word with at most 5 letters: \00"
@.str.3 = [46 x i8] c"Please enter a word with at most 8 letters: \00"
@.str.4 = [15 x i8] c"You entered: \0A\00"
@.str.5 = [11 x i8] c"%s %s %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca [6 x i8]
%4 = alloca [9 x i8]
%5 = alloca [3 x i8*]
store i32 0, i32* %1
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8* %7, i8** %6
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
store i8* %9, i8** %8
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
store i8* %11, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%23 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %22, i8* %23, i8* %24)
%26 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%27 = load i8*, i8** %26
%28 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %27, i8* %30, i8* %33)
%35 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%36 = load i8*, i8** %35
%37 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 1
%38 = load i8*, i8** %37
%39 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 2
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %36, i8* %38, i8* %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Please enter a word with at most 3 letters: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [46 x i8] c"Please enter a word with at most 5 letters: \00"
@.str.3 = [46 x i8] c"Please enter a word with at most 8 letters: \00"
@.str.5 = [11 x i8] c"%s %s %s.\0A\00"
@str = [14 x i8] c"You entered: \00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca [6 x i8]
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, 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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
ret i32 0
}