#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() {
  struct nacepin {
    float pX;
    float pY;
  };
  int nacepinCount, weight = 1, counter;
  float posX, posY;
  struct nacepin ncpn[nacepinCount];
  printf("Enter number of Nacepins:\n");
  scanf("%d", &nacepinCount);
  printf("Enter Pacman Origin point:");
  scanf("%.1f %.1f", &posX, &posY);
  for (counter = 0; counter < nacepinCount; counter++) {
    printf("Enter Nacepin coordinates:");
    scanf("%.1f %.1f", &ncpn[counter].pX, &ncpn[counter].pY);
  }
  for (counter = 0; counter < nacepinCount; counter++) {
    float mvX = ncpn[counter].pX - posX;
    float mvY = ncpn[counter].pY - posY;
    mvX += mvX / weight;
    mvY += mvY / weight;
    posX += mvX;
    posY += mvY;
    printf("%.2f %.2f\n", mvX, mvY);
  }
  printf("%.2f %.2f\n", posX, posY);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ff <main+0xdf>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdx
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %rdx,%rsi
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
add    $0x4,%rdx
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a8 <main+0x88>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b9 <main+0x199>
mov    -0x38(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movslq -0x10(%rbp),%rcx
movss  0x4(%rax,%rcx,8),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x30(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x30(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x30(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdba(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1206 <main+0xe6>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd8c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%r12
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1251 <main+0x121>
mov    %rsp,%rbx
lea    0xe8e(%rip),%r14
lea    0xe7d(%rip),%r15
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rbx),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r13
movslq 0xc(%rsp),%rax
add    $0x8,%rbx
cmp    %rax,%r13
jl     11b0 <main+0x80>
test   %eax,%eax
jle    1251 <main+0x121>
xor    %ebx,%ebx
lea    0xe59(%rip),%r14
nopw   0x0(%rax,%rax,1)
movss  0x8(%rsp),%xmm0
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm3
subss  %xmm3,%xmm2
addss  %xmm1,%xmm1
addss  %xmm2,%xmm2
addss  %xmm1,%xmm0
movss  %xmm0,0x8(%rsp)
addss  %xmm2,%xmm3
movss  %xmm3,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mov    %r14,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11f0 <main+0xc0>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdd7(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %r12,%rsp
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.nacepin = type { float, float }
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Enter Pacman Origin point:\00"
@.str.3 = [10 x i8] c"%.1f %.1f\00"
@.str.4 = [27 x i8] c"Enter Nacepin coordinates:\00"
@.str.5 = [11 x i8] c"%.2f %.2f\0A\00"
@str = [26 x i8] c"Enter number of Nacepins:\00"
define i32 @main() {
%1 = alloca [0 x %struct.nacepin]
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = tail call i8* @llvm.stacksave()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), float* %3, float* %4)
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %20, label %49
15: ; preds = %20
%16 = icmp sgt i32 %27, 0
br i1 %16, label %17, label %49
17: ; preds = %15
%18 = getelementptr inbounds [0 x %struct.nacepin], [0 x %struct.nacepin]* %1, i64 0, i64 0, i32 0
%19 = getelementptr inbounds [0 x %struct.nacepin], [0 x %struct.nacepin]* %1, i64 0, i64 0, i32 1
br label %30
20: ; preds = %0, %20
%21 = phi i64 [ %26, %20 ], [ 0, %0 ]
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%23 = getelementptr inbounds [0 x %struct.nacepin], [0 x %struct.nacepin]* %1, i64 0, i64 %21, i32 0
%24 = getelementptr inbounds [0 x %struct.nacepin], [0 x %struct.nacepin]* %1, i64 0, i64 %21, i32 1
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), float* %23, float* %24)
%26 = add nuw nsw i64 %21, 1
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %20, label %15
30: ; preds = %17, %30
%31 = phi i64 [ 0, %17 ], [ %45, %30 ]
%32 = load float, float* %18
%33 = load float, float* %3
%34 = fsub float %32, %33
%35 = load float, float* %19
%36 = load float, float* %4
%37 = fsub float %35, %36
%38 = fadd float %34, %34
%39 = fadd float %37, %37
%40 = fadd float %33, %38
store float %40, float* %3
%41 = fadd float %36, %39
store float %41, float* %4
%42 = fpext float %38 to double
%43 = fpext float %39 to double
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %42, double %43)
%45 = add nuw nsw i64 %31, 1
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = icmp slt i64 %45, %47
br i1 %48, label %30, label %49
49: ; preds = %30, %0, %15
%50 = load float, float* %3
%51 = fpext float %50 to double
%52 = load float, float* %4
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %51, double %53)
ret i32 0
}