#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 */

/* Variables and functions */
int /*<<< orphan*/ list_unlink_after(int *, int *, int, int, int);
void dlist_unlink(int *first, int *last, int *next, int *prev, int head,
                  int node) {
  list_unlink_after(first, next, head, node, prev[node]);
  list_unlink_after(last, prev, head, node, next[node]);
}


x86 assembly (clang, -O0):
<dlist_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%r8
mov    (%rax,%r8,4),%r8d
call   1030 <list_unlink_after@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%r8
mov    (%rax,%r8,4),%r8d
call   1030 <list_unlink_after@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlist_unlink>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r12
mov    %rdx,%rbp
mov    %rsi,%r15
movslq %r9d,%rbx
mov    (%rcx,%rbx,4),%r8d
mov    %rdx,%rsi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1030 <list_unlink_after@plt>
mov    0x0(%rbp,%rbx,4),%r8d
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <list_unlink_after@plt>

LLVM IR (-O0):
define void @dlist_unlink(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32*, i32** %9
%15 = load i32, i32* %11
%16 = load i32, i32* %12
%17 = load i32*, i32** %10
%18 = load i32, i32* %12
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @list_unlink_after(i32* %13, i32* %14, i32 %15, i32 %16, i32 %21)
%23 = load i32*, i32** %8
%24 = load i32*, i32** %10
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = load i32*, i32** %9
%28 = load i32, i32* %12
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
%32 = call i32 @list_unlink_after(i32* %23, i32* %24, i32 %25, i32 %26, i32 %31)
ret void
}

LLVM IR (-O2):
define void @dlist_unlink(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5) {
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %3, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @list_unlink_after(i32* %0, i32* %2, i32 %4, i32 %5, i32 %9)
%11 = getelementptr inbounds i32, i32* %2, i64 %7
%12 = load i32, i32* %11
%13 = tail call i32 @list_unlink_after(i32* %1, i32* %3, i32 %4, i32 %5, i32 %12)
ret void
}