#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_dict_info();
int /*<<< orphan*/ stem(char *, char *);
int main() {
  char word[80];
  char thestem[80];
  read_dict_info();
  do {
    printf("Please enter a word (<CR> to quit): ");
    gets(word);
    if (*word == '\0')
      break;
    stem(word, thestem);
    printf("\n\nThe stem was: %s\n", thestem);
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <read_dict_info@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
movsbl -0x60(%rbp),%eax
cmp    $0x0,%eax
jne    1182 <main+0x42>
jmp    11b6 <main+0x76>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1030 <stem@plt>
lea    -0xb0(%rbp),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1159 <main+0x19>
jmp    11b6 <main+0x76>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
xor    %eax,%eax
call   1060 <read_dict_info@plt>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1050 <gets@plt>
cmpb   $0x0,(%rsp)
je     11c0 <main+0x80>
mov    %rsp,%r14
lea    0x50(%rsp),%rbx
lea    0xea5(%rip),%r15
lea    0xe79(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <stem@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1050 <gets@plt>
cmpb   $0x0,(%rsp)
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Please enter a word (<CR> to quit): \00"
@.str.1 = [20 x i8] c"\0A\0AThe stem was: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = call i32 (...) @read_dict_info()
br label %5
5: ; preds = %20, %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %21
14: ; preds = %5
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%17 = call i32 @stem(i8* %15, i8* %16)
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %14
br i1 true, label %5, label %21
21: ; preds = %20, %13
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [37 x i8] c"Please enter a word (<CR> to quit): \00"
@.str.1 = [20 x i8] c"\0A\0AThe stem was: %s\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @read_dict_info()
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @gets(i8* %3)
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %0, %10
%11 = call i32 @stem(i8* %3, i8* %4)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @gets(i8* %3)
%15 = load i8, i8* %3
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %0
ret i32 0
}