#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*/ fread(unsigned char *, int, unsigned long,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stdin;
unsigned char *inputWord(unsigned long *len) {
  int tmp;
  int tmplen;
  unsigned char *phrase;
  fscanf(stdin, "%9d %9d ", &tmp, &tmplen);
  *len = (unsigned long)tmplen;
  phrase = (unsigned char *)malloc(sizeof(char) * ((*len) + 1));
  fread(phrase, sizeof(unsigned char), *len, stdin);
  phrase[*len] = '\0';
  return phrase;
}


x86 assembly (clang, -O0):
<inputWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <fscanf@plt>
movslq -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    0x2e58(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputWord>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    0x2ea5(%rip),%r15
mov    (%r15),%edi
lea    0xeb3(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <fscanf@plt>
movslq 0x8(%rsp),%rax
mov    %rax,(%r14)
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    (%r14),%rdx
mov    (%r15),%ecx
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
mov    (%r14),%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [9 x i8] c"%9d %9d \00"
define i8* @inputWord(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i64* %0, i64** %2
%6 = load i32, i32* @stdin
%7 = call i32 @fscanf(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = load i64*, i64** %2
store i64 %9, i64* %10
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = add i64 %12, 1
%14 = mul i64 1, %13
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = load i32, i32* @stdin
%22 = call i32 @fread(i8* %18, i32 1, i64 %20, i32 %21)
%23 = load i8*, i8** %5
%24 = load i64*, i64** %2
%25 = load i64, i64* %24
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 0, i8* %26
%27 = load i8*, i8** %5
ret i8* %27
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [9 x i8] c"%9d %9d \00"
define i8* @inputWord(i64* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* @stdin
%7 = call i32 @fscanf(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
store i64 %9, i64* %0
%10 = add i32 %8, 1
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = load i64, i64* %0
%14 = load i32, i32* @stdin
%15 = call i32 @fread(i8* %12, i32 1, i64 %13, i32 %14)
%16 = load i64, i64* %0
%17 = getelementptr inbounds i8, i8* %12, i64 %16
store i8 0, i8* %17
ret i8* %12
}