#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, i, weight = 1;
  float x_vector, y_vector;
  float first_coordinates[999], second_coordinates[999];
  printf("Input number of nacepin: ");
  scanf("%d\n", &n);
  scanf("%f %f", &x_vector, &y_vector);
  for (i = 0; i < n; i++) {
    scanf("%f %f", &first_coordinates[i], &second_coordinates[i]);
  }
  for (i = 0; i < n; i++) {
    float f_vector = first_coordinates[i] - x_vector;
    float s_vector = second_coordinates[i] - y_vector;
    f_vector = f_vector + (f_vector / weight);
    s_vector = s_vector + (s_vector / weight);
    printf("%.2f %.2f\n", f_vector, s_vector);
    x_vector = x_vector + f_vector;
    y_vector = y_vector + s_vector;
    weight = weight * 2;
  }
  printf("%.2f %.2f\n", x_vector, y_vector);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c2 <main+0xa2>
movslq -0xc(%rbp),%rax
lea    -0xfc0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
lea    -0x1f60(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b4 <main+0x194>
movslq -0xc(%rbp),%rax
movss  -0xfc0(%rbp,%rax,4),%xmm0
ff ff
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1f64(%rbp)
ff
movslq -0xc(%rbp),%rax
movss  -0x1f60(%rbp,%rax,4),%xmm0
ff ff
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1f68(%rbp)
ff
movss  -0x1f64(%rbp),%xmm0
ff
movss  -0x1f64(%rbp),%xmm1
ff
cvtsi2ssl -0x10(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1f64(%rbp)
ff
movss  -0x1f68(%rbp),%xmm0
ff
movss  -0x1f68(%rbp),%xmm1
ff
cvtsi2ssl -0x10(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1f68(%rbp)
ff
movss  -0x1f64(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x1f68(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xdb2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x1f64(%rbp),%xmm0
ff
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x1f68(%rbp),%xmm0
ff
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c9 <main+0xa9>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd57(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1f68,%rsp
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1260 <main+0x140>
lea    0x20(%rsp),%r14
lea    0xfc0(%rsp),%rbx
lea    0xe99(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%r14
add    $0x4,%rbx
cmp    %rax,%rbp
jl     1190 <main+0x70>
test   %eax,%eax
jle    1260 <main+0x140>
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm0
unpcklps %xmm1,%xmm0
mov    $0x1,%ebp
xor    %ebx,%ebx
lea    0xe49(%rip),%r14
nopl   0x0(%rax,%rax,1)
movss  0xfc0(%rsp,%rbx,4),%xmm1
movss  0x20(%rsp,%rbx,4),%xmm2
xorps  %xmm3,%xmm3
cvtsi2ss %ebp,%xmm3
unpcklps %xmm1,%xmm2
subps  %xmm0,%xmm2
shufps $0x0,%xmm3,%xmm3
movaps %xmm2,%xmm1
divps  %xmm3,%xmm1
addps  %xmm2,%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %r14,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm0
unpcklps %xmm1,%xmm0
addps  0x10(%rsp),%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
add    %ebp,%ebp
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11e0 <main+0xc0>
jmp    126f <main+0x14f>
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm0
unpcklps %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd9f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1f68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Input number of nacepin: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"%f %f\00"
@.str.3 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca [999 x float]
%8 = alloca [999 x float]
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
store i32 1, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %5, float* %6)
store i32 0, i32* %3
br label %14
14: ; preds = %26, %0
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [999 x float], [999 x float]* %7, i64 0, i64 %20
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [999 x float], [999 x float]* %8, i64 0, i64 %23
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %21, float* %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %14
29: ; preds = %14
store i32 0, i32* %3
br label %30
30: ; preds = %72, %29
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %75
34: ; preds = %30
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [999 x float], [999 x float]* %7, i64 0, i64 %36
%38 = load float, float* %37
%39 = load float, float* %5
%40 = fsub float %38, %39
store float %40, float* %9
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [999 x float], [999 x float]* %8, i64 0, i64 %42
%44 = load float, float* %43
%45 = load float, float* %6
%46 = fsub float %44, %45
store float %46, float* %10
%47 = load float, float* %9
%48 = load float, float* %9
%49 = load i32, i32* %4
%50 = sitofp i32 %49 to float
%51 = fdiv float %48, %50
%52 = fadd float %47, %51
store float %52, float* %9
%53 = load float, float* %10
%54 = load float, float* %10
%55 = load i32, i32* %4
%56 = sitofp i32 %55 to float
%57 = fdiv float %54, %56
%58 = fadd float %53, %57
store float %58, float* %10
%59 = load float, float* %9
%60 = fpext float %59 to double
%61 = load float, float* %10
%62 = fpext float %61 to double
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %60, double %62)
%64 = load float, float* %5
%65 = load float, float* %9
%66 = fadd float %64, %65
store float %66, float* %5
%67 = load float, float* %6
%68 = load float, float* %10
%69 = fadd float %67, %68
store float %69, float* %6
%70 = load i32, i32* %4
%71 = mul nsw i32 %70, 2
store i32 %71, i32* %4
br label %72
72: ; preds = %34
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %30
75: ; preds = %30
%76 = load float, float* %5
%77 = fpext float %76 to double
%78 = load float, float* %6
%79 = fpext float %78 to double
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %77, double %79)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Input number of nacepin: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"%f %f\00"
@.str.3 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca [999 x float]
%5 = alloca [999 x float]
%6 = bitcast i32* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast [999 x float]* %4 to i8*
%10 = bitcast [999 x float]* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %2, float* %3)
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %28, label %18
16: ; preds = %28
%17 = icmp sgt i32 %34, 0
br i1 %17, label %23, label %18
18: ; preds = %0, %16
%19 = load float, float* %2
%20 = load float, float* %3
%21 = insertelement <2 x float> poison, float %20, i64 0
%22 = insertelement <2 x float> %21, float %19, i64 1
br label %70
23: ; preds = %16
%24 = load float, float* %2
%25 = load float, float* %3
%26 = insertelement <2 x float> poison, float %25, i64 0
%27 = insertelement <2 x float> %26, float %24, i64 1
br label %37
28: ; preds = %0, %28
%29 = phi i64 [ %33, %28 ], [ 0, %0 ]
%30 = getelementptr inbounds [999 x float], [999 x float]* %4, i64 0, i64 %29
%31 = getelementptr inbounds [999 x float], [999 x float]* %5, i64 0, i64 %29
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %30, float* %31)
%33 = add nuw nsw i64 %29, 1
%34 = load i32, i32* %1
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %28, label %16
37: ; preds = %23, %37
%38 = phi i64 [ 0, %23 ], [ %66, %37 ]
%39 = phi i32 [ 1, %23 ], [ %65, %37 ]
%40 = phi <2 x float> [ %27, %23 ], [ %62, %37 ]
%41 = getelementptr inbounds [999 x float], [999 x float]* %4, i64 0, i64 %38
%42 = load float, float* %41
%43 = getelementptr inbounds [999 x float], [999 x float]* %5, i64 0, i64 %38
%44 = load float, float* %43
%45 = insertelement <2 x float> poison, float %44, i64 0
%46 = insertelement <2 x float> %45, float %42, i64 1
%47 = fsub <2 x float> %46, %40
%48 = sitofp i32 %39 to float
%49 = insertelement <2 x float> poison, float %48, i64 0
%50 = shufflevector <2 x float> %49, <2 x float> poison, <2 x i32> zeroinitializer
%51 = fdiv <2 x float> %47, %50
%52 = fadd <2 x float> %47, %51
%53 = extractelement <2 x float> %52, i64 1
%54 = fpext float %53 to double
%55 = extractelement <2 x float> %52, i64 0
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %54, double %56)
%58 = load float, float* %2
%59 = load float, float* %3
%60 = insertelement <2 x float> poison, float %59, i64 0
%61 = insertelement <2 x float> %60, float %58, i64 1
%62 = fadd <2 x float> %52, %61
%63 = extractelement <2 x float> %62, i64 1
store float %63, float* %2
%64 = extractelement <2 x float> %62, i64 0
store float %64, float* %3
%65 = shl nsw i32 %39, 1
%66 = add nuw nsw i64 %38, 1
%67 = load i32, i32* %1
%68 = sext i32 %67 to i64
%69 = icmp slt i64 %66, %68
br i1 %69, label %37, label %70
70: ; preds = %37, %18
%71 = phi <2 x float> [ %22, %18 ], [ %62, %37 ]
%72 = extractelement <2 x float> %71, i64 1
%73 = fpext float %72 to double
%74 = extractelement <2 x float> %71, i64 0
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %73, double %75)
ret i32 0
}