#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 i, pac_masa = 1, nacepin_count;
  float pac_x = 0, pac_y = 0, vect_x, vect_y, nacepin_x[100], nacepin_y[100];
  printf("how many nacepin?");
  scanf("%d", &nacepin_count);
  printf("pacman x,y?\n");
  scanf("%f %f", &pac_x, &pac_y);
  for (i = 1; i <= nacepin_count; i++) {
    printf("nacepin x,y?\n");
    scanf("%f %f", &nacepin_x[i], &nacepin_y[i]);
  }
  for (i = 1; i <= nacepin_count; i++) {
    vect_x = (nacepin_x[i] - pac_x) + (nacepin_x[i] - pac_x) / pac_masa;
    vect_y = (nacepin_y[i] - pac_y) + (nacepin_y[i] - pac_y) / pac_masa;
    printf("%.1f %.1f \n", vect_x, vect_y);
    pac_masa *= 2;
    pac_x += vect_x;
    pac_y += vect_y;
  }
  printf("%.1f %.1f\n", pac_x, pac_y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11ee <main+0xce>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x1b0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x8(%rbp),%rax
lea    -0x340(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1194 <main+0x74>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12c2 <main+0x1a2>
movslq -0x8(%rbp),%rax
movss  -0x1b0(%rbp,%rax,4),%xmm0
ff ff
subss  -0x14(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  -0x1b0(%rbp,%rax,4),%xmm1
ff ff
subss  -0x14(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movslq -0x8(%rbp),%rax
movss  -0x340(%rbp,%rax,4),%xmm0
ff ff
subss  -0x18(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  -0x340(%rbp,%rax,4),%xmm1
ff ff
subss  -0x18(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdb0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f5 <main+0xd5>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd67(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x340,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    12a7 <main+0x177>
lea    0x24(%rsp),%r14
lea    0x1b4(%rsp),%rbx
lea    0xe8b(%rip),%r15
lea    0xe5b(%rip),%r12
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbp
add    $0x4,%r14
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11c0 <main+0x90>
test   %eax,%eax
jle    12a7 <main+0x177>
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm0
unpcklps %xmm1,%xmm0
mov    $0x1,%ebp
xor    %ebx,%ebx
lea    0xe08(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
movss  0x1b4(%rsp,%rbx,4),%xmm2
movss  0x24(%rsp,%rbx,4),%xmm3
unpcklps %xmm2,%xmm3
subps  %xmm0,%xmm3
shufps $0x0,%xmm1,%xmm1
movaps %xmm3,%xmm2
divps  %xmm1,%xmm2
addps  %xmm3,%xmm2
movaps %xmm2,0x10(%rsp)
movaps %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mov    %r14,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    %ebp,%ebp
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)
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1220 <main+0xf0>
jmp    12b6 <main+0x186>
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    0xd5b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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