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

/* Variables and functions */
int /*<<< orphan*/ __get_robust_list(int, struct robust_list_head **, size_t *);
int /*<<< orphan*/ __set_robust_list(struct robust_list_head *, int);
int getpid();
int main() {
  int pid;
  struct robust_list_head *lhp;
  size_t len;
  __get_robust_list(getpid(), &lhp, &len);
  __set_robust_list(lhp, len);
  __get_robust_list(-1, &lhp, &len);
  __get_robust_list(0, (struct robust_list_head **)-1, &len);
  __get_robust_list(0, &lhp, (size_t *)-1);
  __set_robust_list((struct robust_list_head *)-1, 0);
  __set_robust_list(0, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <__get_robust_list@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <__set_robust_list@plt>
mov    $0xffffffff,%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <__get_robust_list@plt>
xor    %edi,%edi
mov    $0xffffffffffffffff,%rsi
lea    -0x18(%rbp),%rdx
call   1050 <__get_robust_list@plt>
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
mov    $0xffffffffffffffff,%rdx
call   1050 <__get_robust_list@plt>
mov    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1030 <__set_robust_list@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1030 <__set_robust_list@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <__get_robust_list@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%esi
call   1030 <__set_robust_list@plt>
mov    $0xffffffff,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <__get_robust_list@plt>
xor    %edi,%edi
mov    $0xffffffffffffffff,%rsi
mov    %rbx,%rdx
call   1050 <__get_robust_list@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    $0xffffffffffffffff,%rdx
call   1050 <__get_robust_list@plt>
mov    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1030 <__set_robust_list@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <__set_robust_list@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.robust_list_head = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.robust_list_head*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (...) @getpid()
%6 = call i32 @__get_robust_list(i32 %5, %struct.robust_list_head** %3, i64* %4)
%7 = load %struct.robust_list_head*, %struct.robust_list_head** %3
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @__set_robust_list(%struct.robust_list_head* %7, i32 %9)
%11 = call i32 @__get_robust_list(i32 -1, %struct.robust_list_head** %3, i64* %4)
%12 = call i32 @__get_robust_list(i32 0, %struct.robust_list_head** inttoptr (i64 -1 to %struct.robust_list_head**), i64* %4)
%13 = call i32 @__get_robust_list(i32 0, %struct.robust_list_head** %3, i64* inttoptr (i64 -1 to i64*))
%14 = call i32 @__set_robust_list(%struct.robust_list_head* inttoptr (i64 -1 to %struct.robust_list_head*), i32 0)
%15 = call i32 @__set_robust_list(%struct.robust_list_head* null, i32 -1)
ret i32 0
}

LLVM IR (-O2):
%struct.robust_list_head = type { i32 }
define i32 @main() {
%1 = alloca %struct.robust_list_head*
%2 = alloca i64
%3 = bitcast %struct.robust_list_head** %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 (...) @getpid()
%6 = call i32 @__get_robust_list(i32 %5, %struct.robust_list_head** %1, i64* %2)
%7 = load %struct.robust_list_head*, %struct.robust_list_head** %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = call i32 @__set_robust_list(%struct.robust_list_head* %7, i32 %9)
%11 = call i32 @__get_robust_list(i32 -1, %struct.robust_list_head** %1, i64* %2)
%12 = call i32 @__get_robust_list(i32 0, %struct.robust_list_head** inttoptr (i64 -1 to %struct.robust_list_head**), i64* %2)
%13 = call i32 @__get_robust_list(i32 0, %struct.robust_list_head** %1, i64* inttoptr (i64 -1 to i64*))
%14 = call i32 @__set_robust_list(%struct.robust_list_head* inttoptr (i64 -1 to %struct.robust_list_head*), i32 0)
%15 = call i32 @__set_robust_list(%struct.robust_list_head* null, i32 -1)
ret i32 0
}