#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_artist(char *);
int /*<<< orphan*/ free_list();
int /*<<< orphan*/ populate();
int /*<<< orphan*/ print_node(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void test_find_artist() {
  printf(
      "====================================================================\n");
  printf("TESTING FIND ARTIST...\n");
  populate();
  print_node(find_artist("donny osmond"));
  print_node(find_artist("sia"));
  print_node(find_artist("lin manuel miranda"));
  print_node(find_artist("against the current"));
  print_node(find_artist("taylor swift"));
  print_node(find_artist("test"));
  free_list();
}


x86 assembly (clang, -O0):
<test_find_artist>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <populate@plt>
lea    0xee4(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xede(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xecf(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xecf(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xed0(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xeca(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
mov    $0x0,%al
call   1050 <free_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_find_artist>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <populate@plt>
lea    0xe89(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xe83(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xe74(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xe74(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xe75(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
lea    0xe6f(%rip),%rdi
call   1070 <find_artist@plt>
mov    %eax,%edi
call   1060 <print_node@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <free_list@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"====================================================================\0A\00"
@.str.1 = [24 x i8] c"TESTING FIND ARTIST...\0A\00"
@.str.2 = [13 x i8] c"donny osmond\00"
@.str.3 = [4 x i8] c"sia\00"
@.str.4 = [19 x i8] c"lin manuel miranda\00"
@.str.5 = [20 x i8] c"against the current\00"
@.str.6 = [13 x i8] c"taylor swift\00"
@.str.7 = [5 x i8] c"test\00"
define void @test_find_artist() {
%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 ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @populate()
%4 = call i32 @find_artist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @print_node(i32 %4)
%6 = call i32 @find_artist(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @print_node(i32 %6)
%8 = call i32 @find_artist(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @print_node(i32 %8)
%10 = call i32 @find_artist(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @print_node(i32 %10)
%12 = call i32 @find_artist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @print_node(i32 %12)
%14 = call i32 @find_artist(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @print_node(i32 %14)
%16 = call i32 (...) @free_list()
ret void
}

LLVM IR (-O2):
@.str.2 = [13 x i8] c"donny osmond\00"
@.str.3 = [4 x i8] c"sia\00"
@.str.4 = [19 x i8] c"lin manuel miranda\00"
@.str.5 = [20 x i8] c"against the current\00"
@.str.6 = [13 x i8] c"taylor swift\00"
@.str.7 = [5 x i8] c"test\00"
@str = [69 x i8] c"====================================================================\00"
@str.8 = [23 x i8] c"TESTING FIND ARTIST...\00"
define void @test_find_artist() {
%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 ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%3 = tail call i32 (...) @populate()
%4 = tail call i32 @find_artist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @print_node(i32 %4)
%6 = tail call i32 @find_artist(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @print_node(i32 %6)
%8 = tail call i32 @find_artist(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @print_node(i32 %8)
%10 = tail call i32 @find_artist(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @print_node(i32 %10)
%12 = tail call i32 @find_artist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @print_node(i32 %12)
%14 = tail call i32 @find_artist(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 @print_node(i32 %14)
%16 = tail call i32 (...) @free_list()
ret void
}