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

/* Variables and functions */
int /*<<< orphan*/ init(struct ListNode **, int *, int);
int /*<<< orphan*/ print(struct ListNode *);
struct ListNode *rm(struct ListNode *, int);
int main(int argc, char **argv) {
  struct ListNode *head = NULL;
  int a[] = {1, 2, 3, 4, 5};
  init(&head, a, 5);
  print(head);
  head = rm(head, 2);
  print(head);
  head = rm(head, 4);
  print(head);
  head = rm(head, 100);
  print(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea6(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x5,%edx
call   1050 <init@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <rm@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1030 <rm@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x64,%esi
call   1030 <rm@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movq   $0x0,0x8(%rsp)
mov    0xecd(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x5,%edx
call   1050 <init@plt>
mov    0x8(%rsp),%rdi
call   1040 <print@plt>
mov    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1030 <rm@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1040 <print@plt>
mov    0x8(%rsp),%rdi
mov    $0x4,%esi
call   1030 <rm@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1040 <print@plt>
mov    0x8(%rsp),%rdi
mov    $0x64,%esi
call   1030 <rm@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ListNode*
%7 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.ListNode* null, %struct.ListNode** %6
%8 = bitcast [5 x i32]* %7 to i8*
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%10 = call i32 @init(%struct.ListNode** %6, i32* %9, i32 5)
%11 = load %struct.ListNode*, %struct.ListNode** %6
%12 = call i32 @print(%struct.ListNode* %11)
%13 = load %struct.ListNode*, %struct.ListNode** %6
%14 = call %struct.ListNode* @rm(%struct.ListNode* %13, i32 2)
store %struct.ListNode* %14, %struct.ListNode** %6
%15 = load %struct.ListNode*, %struct.ListNode** %6
%16 = call i32 @print(%struct.ListNode* %15)
%17 = load %struct.ListNode*, %struct.ListNode** %6
%18 = call %struct.ListNode* @rm(%struct.ListNode* %17, i32 4)
store %struct.ListNode* %18, %struct.ListNode** %6
%19 = load %struct.ListNode*, %struct.ListNode** %6
%20 = call i32 @print(%struct.ListNode* %19)
%21 = load %struct.ListNode*, %struct.ListNode** %6
%22 = call %struct.ListNode* @rm(%struct.ListNode* %21, i32 100)
store %struct.ListNode* %22, %struct.ListNode** %6
%23 = load %struct.ListNode*, %struct.ListNode** %6
%24 = call i32 @print(%struct.ListNode* %23)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.ListNode*
%4 = alloca [5 x i32]
%5 = bitcast %struct.ListNode** %3 to i8*
store %struct.ListNode* null, %struct.ListNode** %3
%6 = bitcast [5 x i32]* %4 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%8 = call i32 @init(%struct.ListNode** %3, i32* %7, i32 5)
%9 = load %struct.ListNode*, %struct.ListNode** %3
%10 = call i32 @print(%struct.ListNode* %9)
%11 = load %struct.ListNode*, %struct.ListNode** %3
%12 = call %struct.ListNode* @rm(%struct.ListNode* %11, i32 2)
store %struct.ListNode* %12, %struct.ListNode** %3
%13 = call i32 @print(%struct.ListNode* %12)
%14 = load %struct.ListNode*, %struct.ListNode** %3
%15 = call %struct.ListNode* @rm(%struct.ListNode* %14, i32 4)
store %struct.ListNode* %15, %struct.ListNode** %3
%16 = call i32 @print(%struct.ListNode* %15)
%17 = load %struct.ListNode*, %struct.ListNode** %3
%18 = call %struct.ListNode* @rm(%struct.ListNode* %17, i32 100)
store %struct.ListNode* %18, %struct.ListNode** %3
%19 = call i32 @print(%struct.ListNode* %18)
ret i32 0
}