#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 *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void readWord(char **verb, char **sameVerb, char **adjective,
              char **pluraNoun) {
  char buf[100], contorlString[100];
  int len;
  sprintf(contorlString, "%%%ds", 100);
  printf("\tverb: ");
  scanf(contorlString, buf);
  len = strlen(buf);
  *verb = malloc(len + 1);
  strcpy(*verb, buf);
  printf("\tsame verb: ");
  scanf(contorlString, buf);
  len = strlen(buf);
  *sameVerb = malloc(len + 1);
  strcpy(*sameVerb, buf);
  printf("\tadjective: ");
  scanf(contorlString, buf);
  len = strlen(buf);
  *adjective = malloc(len + 1);
  strcpy(*adjective, buf);
  printf("\tplural noun: ");
  scanf(contorlString, buf);
  len = strlen(buf);
  *pluraNoun = malloc(len + 1);
  strcpy(*pluraNoun, buf);
}


x86 assembly (clang, -O0):
<readWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x64,%edx
call   1080 <sprintf@plt>
lea    0xe6c(%rip),%rdi
call   1050 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xe18(%rip),%rdi
call   1050 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xdc9(%rip),%rdi
call   1050 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xd7a(%rip),%rdi
call   1050 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readWord>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
lea    0xe7c(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x64,%edx
call   1080 <sprintf@plt>
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,0x0(%rbp)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe38(%rip),%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,0x0(%r13)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe0f(%rip),%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,(%r12)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xde6(%rip),%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%%%ds\00"
@.str.1 = [8 x i8] c"\09verb: \00"
@.str.2 = [13 x i8] c"\09same verb: \00"
@.str.3 = [13 x i8] c"\09adjective: \00"
@.str.4 = [15 x i8] c"\09plural noun: \00"
define void @readWord(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
%11 = alloca i32
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%13 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 100)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%17 = call i32 @scanf(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %11
%20 = load i32, i32* %11
%21 = add nsw i32 %20, 1
%22 = call i8* @malloc(i32 %21)
%23 = load i8**, i8*** %5
store i8* %22, i8** %23
%24 = load i8**, i8*** %5
%25 = load i8*, i8** %24
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%31 = call i32 @scanf(i8* %29, i8* %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%33 = call i32 @strlen(i8* %32)
store i32 %33, i32* %11
%34 = load i32, i32* %11
%35 = add nsw i32 %34, 1
%36 = call i8* @malloc(i32 %35)
%37 = load i8**, i8*** %6
store i8* %36, i8** %37
%38 = load i8**, i8*** %6
%39 = load i8*, i8** %38
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%41 = call i32 @strcpy(i8* %39, i8* %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%45 = call i32 @scanf(i8* %43, i8* %44)
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%47 = call i32 @strlen(i8* %46)
store i32 %47, i32* %11
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 1
%50 = call i8* @malloc(i32 %49)
%51 = load i8**, i8*** %7
store i8* %50, i8** %51
%52 = load i8**, i8*** %7
%53 = load i8*, i8** %52
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%55 = call i32 @strcpy(i8* %53, i8* %54)
%56 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%59 = call i32 @scanf(i8* %57, i8* %58)
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%61 = call i32 @strlen(i8* %60)
store i32 %61, i32* %11
%62 = load i32, i32* %11
%63 = add nsw i32 %62, 1
%64 = call i8* @malloc(i32 %63)
%65 = load i8**, i8*** %8
store i8* %64, i8** %65
%66 = load i8**, i8*** %8
%67 = load i8*, i8** %66
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%69 = call i32 @strcpy(i8* %67, i8* %68)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%%%ds\00"
@.str.1 = [8 x i8] c"\09verb: \00"
@.str.2 = [13 x i8] c"\09same verb: \00"
@.str.3 = [13 x i8] c"\09adjective: \00"
@.str.4 = [15 x i8] c"\09plural noun: \00"
define void @readWord(i8** nocapture writeonly %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 100)
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* %8, i8* %7)
%12 = call i32 @strlen(i8* %7)
%13 = add nsw i32 %12, 1
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %0
%15 = call i32 @strcpy(i8* %14, i8* %7)
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* %8, i8* %7)
%18 = call i32 @strlen(i8* %7)
%19 = add nsw i32 %18, 1
%20 = call i8* @malloc(i32 %19)
store i8* %20, i8** %1
%21 = call i32 @strcpy(i8* %20, i8* %7)
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @scanf(i8* %8, i8* %7)
%24 = call i32 @strlen(i8* %7)
%25 = add nsw i32 %24, 1
%26 = call i8* @malloc(i32 %25)
store i8* %26, i8** %2
%27 = call i32 @strcpy(i8* %26, i8* %7)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @scanf(i8* %8, i8* %7)
%30 = call i32 @strlen(i8* %7)
%31 = add nsw i32 %30, 1
%32 = call i8* @malloc(i32 %31)
store i8* %32, i8** %3
%33 = call i32 @strcpy(i8* %32, i8* %7)
ret void
}