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

/* Variables and functions */
struct Edge *edge_oNext(struct Edge *);
struct Edge *edge_rot(struct Edge *);
int /*<<< orphan*/ edge_setNext(struct Edge *, struct Edge *);
void quadEdge_splice(struct Edge *a, struct Edge *b) {
  struct Edge *alpha = edge_rot(edge_oNext(a));
  struct Edge *beta = edge_rot(edge_oNext(b));
  struct Edge *t1 = edge_oNext(b);
  struct Edge *t2 = edge_oNext(a);
  struct Edge *t3 = edge_oNext(beta);
  struct Edge *t4 = edge_oNext(alpha);
  edge_setNext(a, t1);
  edge_setNext(b, t2);
  edge_setNext(alpha, t3);
  edge_setNext(beta, t4);
}


x86 assembly (clang, -O0):
<quadEdge_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,%rdi
call   1030 <edge_rot@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,%rdi
call   1030 <edge_rot@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <edge_oNext@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <edge_setNext@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <edge_setNext@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <edge_setNext@plt>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <edge_setNext@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadEdge_splice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <edge_oNext@plt>
mov    %rax,%rdi
call   1030 <edge_rot@plt>
mov    %rax,%rbp
mov    %r14,%rdi
call   1050 <edge_oNext@plt>
mov    %rax,%rdi
call   1030 <edge_rot@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1050 <edge_oNext@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1050 <edge_oNext@plt>
mov    %rax,0x10(%rsp)
mov    %r12,%rdi
call   1050 <edge_oNext@plt>
mov    %rax,0x8(%rsp)
mov    %rbp,%rdi
call   1050 <edge_oNext@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <edge_setNext@plt>
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
call   1040 <edge_setNext@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
call   1040 <edge_setNext@plt>
mov    %r12,%rdi
mov    %r15,%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <edge_setNext@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define void @quadEdge_splice(%struct.Edge* %0, %struct.Edge* %1) {
%3 = alloca %struct.Edge*
%4 = alloca %struct.Edge*
%5 = alloca %struct.Edge*
%6 = alloca %struct.Edge*
%7 = alloca %struct.Edge*
%8 = alloca %struct.Edge*
%9 = alloca %struct.Edge*
%10 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %3
store %struct.Edge* %1, %struct.Edge** %4
%11 = load %struct.Edge*, %struct.Edge** %3
%12 = call %struct.Edge* @edge_oNext(%struct.Edge* %11)
%13 = call %struct.Edge* @edge_rot(%struct.Edge* %12)
store %struct.Edge* %13, %struct.Edge** %5
%14 = load %struct.Edge*, %struct.Edge** %4
%15 = call %struct.Edge* @edge_oNext(%struct.Edge* %14)
%16 = call %struct.Edge* @edge_rot(%struct.Edge* %15)
store %struct.Edge* %16, %struct.Edge** %6
%17 = load %struct.Edge*, %struct.Edge** %4
%18 = call %struct.Edge* @edge_oNext(%struct.Edge* %17)
store %struct.Edge* %18, %struct.Edge** %7
%19 = load %struct.Edge*, %struct.Edge** %3
%20 = call %struct.Edge* @edge_oNext(%struct.Edge* %19)
store %struct.Edge* %20, %struct.Edge** %8
%21 = load %struct.Edge*, %struct.Edge** %6
%22 = call %struct.Edge* @edge_oNext(%struct.Edge* %21)
store %struct.Edge* %22, %struct.Edge** %9
%23 = load %struct.Edge*, %struct.Edge** %5
%24 = call %struct.Edge* @edge_oNext(%struct.Edge* %23)
store %struct.Edge* %24, %struct.Edge** %10
%25 = load %struct.Edge*, %struct.Edge** %3
%26 = load %struct.Edge*, %struct.Edge** %7
%27 = call i32 @edge_setNext(%struct.Edge* %25, %struct.Edge* %26)
%28 = load %struct.Edge*, %struct.Edge** %4
%29 = load %struct.Edge*, %struct.Edge** %8
%30 = call i32 @edge_setNext(%struct.Edge* %28, %struct.Edge* %29)
%31 = load %struct.Edge*, %struct.Edge** %5
%32 = load %struct.Edge*, %struct.Edge** %9
%33 = call i32 @edge_setNext(%struct.Edge* %31, %struct.Edge* %32)
%34 = load %struct.Edge*, %struct.Edge** %6
%35 = load %struct.Edge*, %struct.Edge** %10
%36 = call i32 @edge_setNext(%struct.Edge* %34, %struct.Edge* %35)
ret void
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define void @quadEdge_splice(%struct.Edge* %0, %struct.Edge* %1) {
%3 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %0)
%4 = tail call %struct.Edge* @edge_rot(%struct.Edge* %3)
%5 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %1)
%6 = tail call %struct.Edge* @edge_rot(%struct.Edge* %5)
%7 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %1)
%8 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %0)
%9 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %6)
%10 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %4)
%11 = tail call i32 @edge_setNext(%struct.Edge* %0, %struct.Edge* %7)
%12 = tail call i32 @edge_setNext(%struct.Edge* %1, %struct.Edge* %8)
%13 = tail call i32 @edge_setNext(%struct.Edge* %4, %struct.Edge* %9)
%14 = tail call i32 @edge_setNext(%struct.Edge* %6, %struct.Edge* %10)
ret void
}