#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*/ addword(char *, char *, int /*<<< orphan*/);
int scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void makeword() {
  char s[80];
  char t[80];
  char y[180];
  int i;
  i = scanf("%s", s);
  strcpy(y, "");
  i = scanf("%s", t);
  while (strcmp(t, ";")) {
    strcat(y, t);
    strcat(y, " ");
    i = scanf("%s", t);
  }
  addword(s, y, 0);
  i = i;
}


x86 assembly (clang, -O0):
<makeword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
lea    -0x50(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1060 <scanf@plt>
mov    %eax,-0x164(%rbp)
lea    -0x160(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1060 <scanf@plt>
mov    %eax,-0x164(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11fe <makeword+0xae>
lea    -0x160(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0x160(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1070 <strcat@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe12(%rip),%rdi
call   1060 <scanf@plt>
mov    %eax,-0x164(%rbp)
jmp    119d <makeword+0x4d>
lea    -0x50(%rbp),%rdi
lea    -0x160(%rbp),%rsi
xor    %edx,%edx
call   1050 <addword@plt>
mov    -0x164(%rbp),%eax
mov    %eax,-0x164(%rbp)
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeword>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x160,%rsp
lea    0xe99(%rip),%r14
lea    0x50(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    0xe8b(%rip),%rsi
lea    0xa0(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xe66(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1201 <makeword+0xb1>
lea    0xa0(%rsp),%r14
mov    %rsp,%rbx
lea    0xe49(%rip),%r15
lea    0xe3d(%rip),%r12
lea    0xe39(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcat@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11d0 <makeword+0x80>
lea    0x50(%rsp),%rdi
lea    0xa0(%rsp),%rsi
xor    %edx,%edx
call   1050 <addword@plt>
add    $0x160,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c";\00"
@.str.3 = [2 x i8] c" \00"
define void @makeword() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = alloca [180 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 %6, i32* %4
%7 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 %10, i32* %4
br label %11
11: ; preds = %15, %0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 %22, i32* %4
br label %11
23: ; preds = %11
%24 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%25 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%26 = call i32 @addword(i8* %24, i8* %25, i32 0)
%27 = load i32, i32* %4
store i32 %27, i32* %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c";\00"
@.str.3 = [2 x i8] c" \00"
define void @makeword() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = alloca [180 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %0, %12
%13 = call i32 @strcat(i8* %6, i8* %5)
%14 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%16 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %12
18: ; preds = %12, %0
%19 = call i32 @addword(i8* %4, i8* %6, i32 0)
ret void
}