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

/* Variables and functions */
int /*<<< orphan*/ destroy_list(struct jsw_skip *);
struct jsw_skip *make_list(int *, int);
int /*<<< orphan*/ print_list(struct jsw_skip *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Starting program");
  int elems = 5;
  int numbers[] = {1, 5, 6, 23, 7};
  struct jsw_skip *my_list = make_list(numbers, elems);
  puts("List created:");
  printf("head: %d\n", (int)my_list);
  print_list(my_list);
  puts("Destroying list:");
  destroy_list(my_list);
  puts("List destroyed:");
  printf("head: %d\n", (int)my_list);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
movl   $0x5,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1070 <make_list@plt>
mov    %rax,-0x28(%rbp)
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <print_list@plt>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
mov    -0x28(%rbp),%rdi
call   1030 <destroy_list@plt>
lea    0xe5d(%rip),%rdi
call   1040 <puts@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%esi
lea    0xe30(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
mov    0xef7(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1070 <make_list@plt>
mov    %rax,%rbx
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
lea    0xe84(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <print_list@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <destroy_list@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.jsw_skip = type { i32 }
@.str = [17 x i8] c"Starting program\00"
@__const.main.numbers = [5 x i32] [i32 1, i32 5, i32 6, i32 23, i32 7]
@.str.1 = [14 x i8] c"List created:\00"
@.str.2 = [10 x i8] c"head: %d\0A\00"
@.str.3 = [17 x i8] c"Destroying list:\00"
@.str.4 = [16 x i8] c"List destroyed:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca %struct.jsw_skip*
%4 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %1
%8 = call %struct.jsw_skip* @make_list(i32* %6, i32 %7)
store %struct.jsw_skip* %8, %struct.jsw_skip** %3
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = load %struct.jsw_skip*, %struct.jsw_skip** %3
%11 = ptrtoint %struct.jsw_skip* %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load %struct.jsw_skip*, %struct.jsw_skip** %3
%14 = call i32 @print_list(%struct.jsw_skip* %13)
%15 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%16 = load %struct.jsw_skip*, %struct.jsw_skip** %3
%17 = call i32 @destroy_list(%struct.jsw_skip* %16)
%18 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%19 = load %struct.jsw_skip*, %struct.jsw_skip** %3
%20 = ptrtoint %struct.jsw_skip* %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
%struct.jsw_skip = type { i32 }
@.str = [17 x i8] c"Starting program\00"
@__const.main.numbers = [5 x i32] [i32 1, i32 5, i32 6, i32 23, i32 7]
@.str.1 = [14 x i8] c"List created:\00"
@.str.2 = [10 x i8] c"head: %d\0A\00"
@.str.3 = [17 x i8] c"Destroying list:\00"
@.str.4 = [16 x i8] c"List destroyed:\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call %struct.jsw_skip* @make_list(i32* %4, i32 5)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = ptrtoint %struct.jsw_skip* %5 to i64
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @print_list(%struct.jsw_skip* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @destroy_list(%struct.jsw_skip* %5)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}