#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 GET_ELEM_N1(int);
int GET_ELEM_N2(int);
double GET_NODE_X(int);
double GET_NODE_Y(int);
int gfx_pos_x(double);
int gfx_pos_y(double);
void gfx_elem_act_point(int pos, int *x, int *y) {
  int n1, n2;
  n1 = GET_ELEM_N1(pos);
  n2 = GET_ELEM_N2(pos);
  *x = gfx_pos_x((0.5 * (GET_NODE_X(n1) + GET_NODE_X(n2))));
  *y = gfx_pos_y((0.5 * (GET_NODE_Y(n1) + GET_NODE_Y(n2))));
}


x86 assembly (clang, -O0):
<gfx_elem_act_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GET_ELEM_N1@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <GET_ELEM_N2@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <GET_NODE_X@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%edi
call   1050 <GET_NODE_X@plt>
movsd  -0x30(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe51(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <gfx_pos_x@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%edi
call   1080 <GET_NODE_Y@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%edi
call   1080 <GET_NODE_Y@plt>
movsd  -0x28(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe1a(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <gfx_pos_y@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_elem_act_point>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
call   1030 <GET_ELEM_N1@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1060 <GET_ELEM_N2@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <GET_NODE_X@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
call   1050 <GET_NODE_X@plt>
addsd  (%rsp),%xmm0
mulsd  0xe61(%rip),%xmm0
call   1070 <gfx_pos_x@plt>
mov    %eax,(%r15)
mov    %ebx,%edi
call   1080 <GET_NODE_Y@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
call   1080 <GET_NODE_Y@plt>
addsd  (%rsp),%xmm0
mulsd  0xe39(%rip),%xmm0
call   1040 <gfx_pos_y@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @gfx_elem_act_point(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32, i32* %4
%10 = call i32 @GET_ELEM_N1(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = call i32 @GET_ELEM_N2(i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = call double @GET_NODE_X(i32 %13)
%15 = load i32, i32* %8
%16 = call double @GET_NODE_X(i32 %15)
%17 = fadd double %14, %16
%18 = fmul double 5.000000e-01, %17
%19 = call i32 @gfx_pos_x(double %18)
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = load i32, i32* %7
%22 = call double @GET_NODE_Y(i32 %21)
%23 = load i32, i32* %8
%24 = call double @GET_NODE_Y(i32 %23)
%25 = fadd double %22, %24
%26 = fmul double 5.000000e-01, %25
%27 = call i32 @gfx_pos_y(double %26)
%28 = load i32*, i32** %6
store i32 %27, i32* %28
ret void
}

LLVM IR (-O2):
define void @gfx_elem_act_point(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @GET_ELEM_N1(i32 %0)
%5 = tail call i32 @GET_ELEM_N2(i32 %0)
%6 = tail call double @GET_NODE_X(i32 %4)
%7 = tail call double @GET_NODE_X(i32 %5)
%8 = fadd double %6, %7
%9 = fmul double %8, 5.000000e-01
%10 = tail call i32 @gfx_pos_x(double %9)
store i32 %10, i32* %1
%11 = tail call double @GET_NODE_Y(i32 %4)
%12 = tail call double @GET_NODE_Y(i32 %5)
%13 = fadd double %11, %12
%14 = fmul double %13, 5.000000e-01
%15 = tail call i32 @gfx_pos_y(double %14)
store i32 %15, i32* %2
ret void
}