#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*/ find_song(char *, char *);
int /*<<< orphan*/ free_list();
int /*<<< orphan*/ populate();
int /*<<< orphan*/ print_node(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void test_find_song() {
  printf(
      "====================================================================\n");
  printf("TESTING FIND SONG...\n");
  populate();
  print_node(find_song("make a man out of you", "donny osmond"));
  print_node(find_song("chandelier", "sia"));
  print_node(find_song("how far ill go", "lin manuel miranda"));
  print_node(find_song("legends never die", "against the current"));
  print_node(find_song("look what you made me do", "taylor swift"));
  print_node(find_song("ours", "taylor swift"));
  print_node(find_song("theirs", "taylor swift"));
  print_node(find_song("you belong with me", "taylor swift"));
  print_node(find_song("test", "t"));
  print_node(find_song("", "t"));
  free_list();
}


x86 assembly (clang, -O0):
<test_find_song>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <populate@plt>
lea    0xee2(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xeeb(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xee0(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xee8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xef4(%rip),%rdi
lea    0xf06(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xf00(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xeeb(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xed8(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xed1(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xdf7(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
mov    $0x0,%al
call   1060 <free_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_find_song>:
push   %rbx
lea    0xf6c(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <populate@plt>
lea    0xe89(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe92(%rip),%rdi
lea    0xe96(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe87(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe8f(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe9b(%rip),%rdi
lea    0xead(%rip),%rbx
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe84(%rip),%rdi
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xe81(%rip),%rdi
lea    0xe59(%rip),%rbx
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <free_list@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"====================================================================\0A\00"
@.str.1 = [22 x i8] c"TESTING FIND SONG...\0A\00"
@.str.2 = [22 x i8] c"make a man out of you\00"
@.str.3 = [13 x i8] c"donny osmond\00"
@.str.4 = [11 x i8] c"chandelier\00"
@.str.5 = [4 x i8] c"sia\00"
@.str.6 = [15 x i8] c"how far ill go\00"
@.str.7 = [19 x i8] c"lin manuel miranda\00"
@.str.8 = [18 x i8] c"legends never die\00"
@.str.9 = [20 x i8] c"against the current\00"
@.str.10 = [25 x i8] c"look what you made me do\00"
@.str.11 = [13 x i8] c"taylor swift\00"
@.str.12 = [5 x i8] c"ours\00"
@.str.13 = [7 x i8] c"theirs\00"
@.str.14 = [19 x i8] c"you belong with me\00"
@.str.15 = [5 x i8] c"test\00"
@.str.16 = [2 x i8] c"t\00"
@.str.17 = [1 x i8] zeroinitializer
define void @test_find_song() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @populate()
%4 = call i32 @find_song(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @print_node(i32 %4)
%6 = call i32 @find_song(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @print_node(i32 %6)
%8 = call i32 @find_song(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @print_node(i32 %8)
%10 = call i32 @find_song(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @print_node(i32 %10)
%12 = call i32 @find_song(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @print_node(i32 %12)
%14 = call i32 @find_song(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @print_node(i32 %14)
%16 = call i32 @find_song(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 @print_node(i32 %16)
%18 = call i32 @find_song(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%19 = call i32 @print_node(i32 %18)
%20 = call i32 @find_song(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%21 = call i32 @print_node(i32 %20)
%22 = call i32 @find_song(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%23 = call i32 @print_node(i32 %22)
%24 = call i32 (...) @free_list()
ret void
}

LLVM IR (-O2):
@.str.2 = [22 x i8] c"make a man out of you\00"
@.str.3 = [13 x i8] c"donny osmond\00"
@.str.4 = [11 x i8] c"chandelier\00"
@.str.5 = [4 x i8] c"sia\00"
@.str.6 = [15 x i8] c"how far ill go\00"
@.str.7 = [19 x i8] c"lin manuel miranda\00"
@.str.8 = [18 x i8] c"legends never die\00"
@.str.9 = [20 x i8] c"against the current\00"
@.str.10 = [25 x i8] c"look what you made me do\00"
@.str.11 = [13 x i8] c"taylor swift\00"
@.str.12 = [5 x i8] c"ours\00"
@.str.13 = [7 x i8] c"theirs\00"
@.str.14 = [19 x i8] c"you belong with me\00"
@.str.15 = [5 x i8] c"test\00"
@.str.16 = [2 x i8] c"t\00"
@.str.17 = [1 x i8] zeroinitializer
@str = [69 x i8] c"====================================================================\00"
@str.18 = [21 x i8] c"TESTING FIND SONG...\00"
define void @test_find_song() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.18, i64 0, i64 0))
%3 = tail call i32 (...) @populate()
%4 = tail call i32 @find_song(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @print_node(i32 %4)
%6 = tail call i32 @find_song(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @print_node(i32 %6)
%8 = tail call i32 @find_song(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @print_node(i32 %8)
%10 = tail call i32 @find_song(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i32 @print_node(i32 %10)
%12 = tail call i32 @find_song(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 @print_node(i32 %12)
%14 = tail call i32 @find_song(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%15 = tail call i32 @print_node(i32 %14)
%16 = tail call i32 @find_song(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%17 = tail call i32 @print_node(i32 %16)
%18 = tail call i32 @find_song(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%19 = tail call i32 @print_node(i32 %18)
%20 = tail call i32 @find_song(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%21 = tail call i32 @print_node(i32 %20)
%22 = tail call i32 @find_song(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%23 = tail call i32 @print_node(i32 %22)
%24 = tail call i32 (...) @free_list()
ret void
}