#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 */
struct namelist_node {
  int dummy;
};
struct namelist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ namelist_add(struct namelist *, struct namelist_node *);
struct namelist *namelist_new();
struct namelist_node *namelist_node_new(char *, char *);
int /*<<< orphan*/ namelist_print(struct namelist *);
int main(int argc, char *argv[]) {
  struct namelist *list;
  struct namelist_node *node;
  list = namelist_new();
  node = namelist_node_new("testing1", "test@test.com");
  namelist_add(list, node);
  node = namelist_node_new("testing2", "test2@test.com");
  namelist_add(list, node);
  node = namelist_node_new("testing3", "test3@test.com");
  namelist_add(list, node);
  namelist_print(list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <namelist_new@plt>
mov    %rax,-0x18(%rbp)
lea    0xe98(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <namelist_add@plt>
lea    0xe8b(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <namelist_add@plt>
lea    0xe7f(%rip),%rdi
lea    0xe81(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <namelist_add@plt>
mov    -0x18(%rbp),%rdi
call   1030 <namelist_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <namelist_new@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <namelist_add@plt>
lea    0xea7(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <namelist_add@plt>
lea    0xea1(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1060 <namelist_node_new@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <namelist_add@plt>
mov    %rbx,%rdi
call   1030 <namelist_print@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.namelist = type { i32 }
%struct.namelist_node = type { i32 }
@.str = [9 x i8] c"testing1\00"
@.str.1 = [14 x i8] c"test@test.com\00"
@.str.2 = [9 x i8] c"testing2\00"
@.str.3 = [15 x i8] c"test2@test.com\00"
@.str.4 = [9 x i8] c"testing3\00"
@.str.5 = [15 x i8] c"test3@test.com\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.namelist*
%7 = alloca %struct.namelist_node*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call %struct.namelist* (...) @namelist_new()
store %struct.namelist* %8, %struct.namelist** %6
%9 = call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store %struct.namelist_node* %9, %struct.namelist_node** %7
%10 = load %struct.namelist*, %struct.namelist** %6
%11 = load %struct.namelist_node*, %struct.namelist_node** %7
%12 = call i32 @namelist_add(%struct.namelist* %10, %struct.namelist_node* %11)
%13 = call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
store %struct.namelist_node* %13, %struct.namelist_node** %7
%14 = load %struct.namelist*, %struct.namelist** %6
%15 = load %struct.namelist_node*, %struct.namelist_node** %7
%16 = call i32 @namelist_add(%struct.namelist* %14, %struct.namelist_node* %15)
%17 = call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store %struct.namelist_node* %17, %struct.namelist_node** %7
%18 = load %struct.namelist*, %struct.namelist** %6
%19 = load %struct.namelist_node*, %struct.namelist_node** %7
%20 = call i32 @namelist_add(%struct.namelist* %18, %struct.namelist_node* %19)
%21 = load %struct.namelist*, %struct.namelist** %6
%22 = call i32 @namelist_print(%struct.namelist* %21)
ret i32 0
}

LLVM IR (-O2):
%struct.namelist = type { i32 }
%struct.namelist_node = type { i32 }
@.str = [9 x i8] c"testing1\00"
@.str.1 = [14 x i8] c"test@test.com\00"
@.str.2 = [9 x i8] c"testing2\00"
@.str.3 = [15 x i8] c"test2@test.com\00"
@.str.4 = [9 x i8] c"testing3\00"
@.str.5 = [15 x i8] c"test3@test.com\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.namelist* (...) @namelist_new()
%4 = tail call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @namelist_add(%struct.namelist* %3, %struct.namelist_node* %4)
%6 = tail call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @namelist_add(%struct.namelist* %3, %struct.namelist_node* %6)
%8 = tail call %struct.namelist_node* @namelist_node_new(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @namelist_add(%struct.namelist* %3, %struct.namelist_node* %8)
%10 = tail call i32 @namelist_print(%struct.namelist* %3)
ret i32 0
}