#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 linked_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append(struct linked_list *, void *);
scalar_t__ get(struct linked_list *, int);
struct linked_list *new_list();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  struct linked_list *list = new_list();
  printf("%p\n", list);
  append(list, (void *)5);
  append(list, (void *)6);
  append(list, (void *)7);
  printf("%d\n", (int)get(list, 0));
  printf("%d\n", (int)get(list, 1));
  printf("%d\n", (int)get(list, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <new_list@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
call   1030 <append@plt>
mov    -0x18(%rbp),%rdi
mov    $0x6,%esi
call   1030 <append@plt>
mov    -0x18(%rbp),%rdi
mov    $0x7,%esi
call   1030 <append@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <get@plt>
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1050 <get@plt>
mov    %eax,%esi
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1050 <get@plt>
mov    %eax,%esi
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <new_list@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0x5,%esi
mov    %rbx,%rdi
call   1030 <append@plt>
mov    $0x6,%esi
mov    %rbx,%rdi
call   1030 <append@plt>
mov    $0x7,%esi
mov    %rbx,%rdi
call   1030 <append@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <get@plt>
lea    0xe70(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <get@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <get@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.linked_list = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.linked_list*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call %struct.linked_list* (...) @new_list()
store %struct.linked_list* %6, %struct.linked_list** %5
%7 = load %struct.linked_list*, %struct.linked_list** %5
%8 = ptrtoint %struct.linked_list* %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load %struct.linked_list*, %struct.linked_list** %5
%11 = call i32 @append(%struct.linked_list* %10, i8* inttoptr (i64 5 to i8*))
%12 = load %struct.linked_list*, %struct.linked_list** %5
%13 = call i32 @append(%struct.linked_list* %12, i8* inttoptr (i64 6 to i8*))
%14 = load %struct.linked_list*, %struct.linked_list** %5
%15 = call i32 @append(%struct.linked_list* %14, i8* inttoptr (i64 7 to i8*))
%16 = load %struct.linked_list*, %struct.linked_list** %5
%17 = call i64 @get(%struct.linked_list* %16, i32 0)
%18 = trunc i64 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load %struct.linked_list*, %struct.linked_list** %5
%21 = call i64 @get(%struct.linked_list* %20, i32 1)
%22 = trunc i64 %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load %struct.linked_list*, %struct.linked_list** %5
%25 = call i64 @get(%struct.linked_list* %24, i32 2)
%26 = trunc i64 %25 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
%struct.linked_list = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.linked_list* (...) @new_list()
%4 = ptrtoint %struct.linked_list* %3 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @append(%struct.linked_list* %3, i8* inttoptr (i64 5 to i8*))
%8 = tail call i32 @append(%struct.linked_list* %3, i8* inttoptr (i64 6 to i8*))
%9 = tail call i32 @append(%struct.linked_list* %3, i8* inttoptr (i64 7 to i8*))
%10 = tail call i64 @get(%struct.linked_list* %3, i32 0)
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = tail call i64 @get(%struct.linked_list* %3, i32 1)
%14 = trunc i64 %13 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i64 @get(%struct.linked_list* %3, i32 2)
%17 = trunc i64 %16 to i32
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}