#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*/ get_phrase(char *, char *, char **);
int /*<<< orphan*/ max_phrase_length(char *);
scalar_t__ strcmp(char *, char *);
char *get_phrase_01a() {
  char hex[] = "00020000000100030000";
  char *wordlist[] = {"aahing", "aardvark", "aardvarks", "aardwolf"};
  char expected_phrase[] = "aardvarks aahing aardvark aardwolf aahing";
  char phrase[max_phrase_length(hex) + 1];
  get_phrase(phrase, hex, wordlist);
  do {
    if (!(strcmp(phrase, expected_phrase) == 0))
      return "return a valid phrase given a normalized string of hex pairs";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<get_phrase_01a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movaps 0xebe(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movabs $0x30303030333030,%rax
mov    %rax,-0x13(%rbp)
movaps 0x2cb5(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0x2c9a(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
movups 0xec9(%rip),%xmm0
movups %xmm0,-0x56(%rbp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <max_phrase_length@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x90(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x80(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <get_phrase@plt>
mov    -0x90(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11fe <get_phrase_01a+0xce>
lea    0xe82(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x84(%rbp)
jmp    121a <get_phrase_01a+0xea>
jmp    1203 <get_phrase_01a+0xd3>
jmp    1208 <get_phrase_01a+0xd8>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x84(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_phrase_01a>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
movaps 0xebc(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movabs $0x30303030333030,%rax
mov    %rax,-0x23(%rbp)
movaps 0x2cb3(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0x2c98(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
movups 0xec7(%rip),%xmm0
movups %xmm0,-0x46(%rbp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
lea    -0x30(%rbp),%r14
mov    %r14,%rdi
call   1050 <max_phrase_length@plt>
mov    %rsp,%r15
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x80(%rbp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <get_phrase@plt>
lea    -0x60(%rbp),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xe98(%rip),%rcx
cmovne %rcx,%rax
mov    %r15,%rsp
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.get_phrase_01a.hex = [21 x i8] c"00020000000100030000\00"
@.str = [7 x i8] c"aahing\00"
@.str.1 = [9 x i8] c"aardvark\00"
@.str.2 = [10 x i8] c"aardvarks\00"
@.str.3 = [9 x i8] c"aardwolf\00"
@__const.get_phrase_01a.wordlist = [4 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@__const.get_phrase_01a.expected_phrase = [42 x i8] c"aardvarks aahing aardvark aardwolf aahing\00"
@.str.4 = [61 x i8] c"return a valid phrase given a normalized string of hex pairs\00"
define i8* @get_phrase_01a() {
%1 = alloca i8*
%2 = alloca [21 x i8]
%3 = alloca [4 x i8*]
%4 = alloca [42 x i8]
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = bitcast [21 x i8]* %2 to i8*
%9 = bitcast [4 x i8*]* %3 to i8*
%10 = bitcast [42 x i8]* %4 to i8*
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%12 = call i32 @max_phrase_length(i8* %11)
%13 = add nsw i32 %12, 1
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %5
%16 = alloca i8, i64 %14
store i64 %14, i64* %6
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%19 = call i32 @get_phrase(i8* %16, i8* %17, i8** %18)
br label %20
20: ; preds = %0
%21 = getelementptr inbounds [42 x i8], [42 x i8]* %4, i64 0, i64 0
%22 = call i64 @strcmp(i8* %16, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
store i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0), i8** %1
store i32 1, i32* %7
br label %28
25: ; preds = %20
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26
store i8* null, i8** %1
store i32 1, i32* %7
br label %28
28: ; preds = %27, %24
%29 = load i8*, i8** %5
%30 = load i8*, i8** %1
ret i8* %30
}

LLVM IR (-O2):
@__const.get_phrase_01a.hex = [21 x i8] c"00020000000100030000\00"
@.str = [7 x i8] c"aahing\00"
@.str.1 = [9 x i8] c"aardvark\00"
@.str.2 = [10 x i8] c"aardvarks\00"
@.str.3 = [9 x i8] c"aardwolf\00"
@__const.get_phrase_01a.wordlist = [4 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@__const.get_phrase_01a.expected_phrase = [42 x i8] c"aardvarks aahing aardvark aardwolf aahing\00"
@.str.4 = [61 x i8] c"return a valid phrase given a normalized string of hex pairs\00"
define i8* @get_phrase_01a() {
%1 = alloca [21 x i8]
%2 = alloca [4 x i8*]
%3 = alloca [42 x i8]
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%5 = bitcast [4 x i8*]* %2 to i8*
%6 = getelementptr inbounds [42 x i8], [42 x i8]* %3, i64 0, i64 0
%7 = call i32 @max_phrase_length(i8* %4)
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
%11 = alloca i8, i64 %9
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%13 = call i32 @get_phrase(i8* %11, i8* %4, i8** %12)
%14 = call i64 @strcmp(i8* %11, i8* %6)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8* null, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0)
ret i8* %16
}