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

/* Variables and functions */
int /*<<< orphan*/ free_list(struct element *);
int /*<<< orphan*/ print_list(struct element *);
int /*<<< orphan*/ printf(char *);
struct element *prompt_list();
struct element *rmEvens(struct element *);
int main(void) {
  struct element *l = prompt_list();
  printf("Got the following list: ");
  print_list(l);
  printf("Removing evens: ");
  l = rmEvens(l);
  print_list(l);
  free_list(l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <prompt_list@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_list@plt>
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rmEvens@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <print_list@plt>
mov    -0x10(%rbp),%rdi
call   1060 <free_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <prompt_list@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <print_list@plt>
lea    0xea3(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <rmEvens@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <print_list@plt>
mov    %rbx,%rdi
call   1060 <free_list@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.element = type { i32 }
@.str = [25 x i8] c"Got the following list: \00"
@.str.1 = [17 x i8] c"Removing evens: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.element*
store i32 0, i32* %1
%3 = call %struct.element* (...) @prompt_list()
store %struct.element* %3, %struct.element** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.element*, %struct.element** %2
%6 = call i32 @print_list(%struct.element* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = load %struct.element*, %struct.element** %2
%9 = call %struct.element* @rmEvens(%struct.element* %8)
store %struct.element* %9, %struct.element** %2
%10 = load %struct.element*, %struct.element** %2
%11 = call i32 @print_list(%struct.element* %10)
%12 = load %struct.element*, %struct.element** %2
%13 = call i32 @free_list(%struct.element* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.element = type { i32 }
@.str = [25 x i8] c"Got the following list: \00"
@.str.1 = [17 x i8] c"Removing evens: \00"
define i32 @main() {
%1 = tail call %struct.element* (...) @prompt_list()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_list(%struct.element* %1)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call %struct.element* @rmEvens(%struct.element* %1)
%6 = tail call i32 @print_list(%struct.element* %5)
%7 = tail call i32 @free_list(%struct.element* %5)
ret i32 0
}