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

/* Variables and functions */
struct node *add_node(struct node *, double, double, int);
struct node *delete (struct node *, double, double, int);
void move(struct node **from_list, struct node **to_list, double x, double y,
          int i) {
  *to_list = add_node(*to_list, x, y, i);
  *from_list = delete (*from_list, x, y, i);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
call   1030 <add_node@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
call   1040 <delete@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
mov    %edx,%esi
call   1030 <add_node@plt>
mov    %rax,(%rbx)
mov    (%r14),%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %ebp,%esi
call   1040 <delete@plt>
mov    %rax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @move(%struct.node** %0, %struct.node** %1, double %2, double %3, i32 %4) {
%6 = alloca %struct.node**
%7 = alloca %struct.node**
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store %struct.node** %0, %struct.node*** %6
store %struct.node** %1, %struct.node*** %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load %struct.node**, %struct.node*** %7
%12 = load %struct.node*, %struct.node** %11
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load i32, i32* %10
%16 = call %struct.node* @add_node(%struct.node* %12, double %13, double %14, i32 %15)
%17 = load %struct.node**, %struct.node*** %7
store %struct.node* %16, %struct.node** %17
%18 = load %struct.node**, %struct.node*** %6
%19 = load %struct.node*, %struct.node** %18
%20 = load double, double* %8
%21 = load double, double* %9
%22 = load i32, i32* %10
%23 = call %struct.node* @delete(%struct.node* %19, double %20, double %21, i32 %22)
%24 = load %struct.node**, %struct.node*** %6
store %struct.node* %23, %struct.node** %24
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @move(%struct.node** nocapture %0, %struct.node** nocapture %1, double %2, double %3, i32 %4) {
%6 = load %struct.node*, %struct.node** %1
%7 = tail call %struct.node* @add_node(%struct.node* %6, double %2, double %3, i32 %4)
store %struct.node* %7, %struct.node** %1
%8 = load %struct.node*, %struct.node** %0
%9 = tail call %struct.node* @delete(%struct.node* %8, double %2, double %3, i32 %4)
store %struct.node* %9, %struct.node** %0
ret void
}