#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;
  float x, y, arr[2 * n], mass = 1.0;
  printf("Enter the number of nacepins: \n");
  scanf("%d", &n);
  printf("Enter pac-man's coordinates: \n");
  scanf("%f", &x);
  scanf("%f", &y);
  printf("Enter the coordinates of all nacepins: \n");
  for (i = 0; i < (2 * n); i++)
    scanf("%f", arr[i]);
  for (i = 0; i < (2 * n); i += 2) {
    if (arr[i] != x) {
      x += (arr[i] - x) / mass;
      printf("%f\n", x);
    } else
      printf("0.0\n");
    if (arr[i = 1] != y) {
      y += (arr[i + 1] - y) / mass;
      printf("%f", y);
    } else
      printf("0.0");
    mass *= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    120a <main+0xea>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe55(%rip),%rdi
mov    $0x1,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11cc <main+0xac>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1324 <main+0x204>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1244 <main+0x124>
jp     1244 <main+0x124>
jmp    1281 <main+0x161>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x10(%rbp),%xmm0
divss  -0x2c(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe01(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    128f <main+0x16f>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
movl   $0x1,-0xc(%rbp)
movss  0x4(%rax),%xmm0
ucomiss -0x14(%rbp),%xmm0
jne    12b4 <main+0x194>
jp     12b4 <main+0x194>
jmp    12f6 <main+0x1d6>
mov    -0x38(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x14(%rbp),%xmm0
divss  -0x2c(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1304 <main+0x1e4>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xcf8(%rip),%xmm0
mulss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1211 <main+0xf1>
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   %rbx
sub    $0x30,%rsp
mov    %rsp,%r15
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rbx
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    129b <main+0x16b>
lea    0xe61(%rip),%rdi
mov    $0x1,%al
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1202 <main+0xd2>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x1,%ebx
lea    0xe36(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,1),%rcx
cmp    %rcx,%rbx
jl     11e0 <main+0xb0>
test   %eax,%eax
jle    129b <main+0x16b>
movl   $0x7fc00000,0x24(%rsp)
7f
lea    0xdf5(%rip),%rdi
movsd  0xddf(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x7fc00000,0x20(%rsp)
7f
lea    0xdd4(%rip),%rdi
movsd  0xdc1(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x2,0xc(%rsp)
jl     129b <main+0x16b>
lea    0xdba(%rip),%r14
lea    0xdb0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
movl   $0x7fc00000,0x24(%rsp)
7f
mov    %r14,%rdi
movsd  0xd8d(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x7fc00000,0x20(%rsp)
7f
mov    %rbx,%rdi
movsd  0xd73(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x1,0xc(%rsp)
jg     1260 <main+0x130>
mov    %r15,%rsp
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@str = [31 x i8] c"Enter the number of nacepins: \00"
@str.8 = [30 x i8] c"Enter pac-man's coordinates: \00"
@str.9 = [40 x i8] c"Enter the coordinates of all nacepins: \00"
define i32 @main() {
%1 = alloca [0 x float]
%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 ([31 x i8], [31 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.8, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.9, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %46
17: ; preds = %0
%18 = getelementptr inbounds [0 x float], [0 x float]* %1, i64 0, i64 0
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double undef)
%20 = load i32, i32* %2
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load float, float* %18
%24 = fpext float %23 to double
br label %33
25: ; preds = %33, %17
%26 = phi i32 [ %20, %17 ], [ %37, %33 ]
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %46
28: ; preds = %25
store float 0x7FF8000000000000, float* %3
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 0x7FF8000000000000)
store float 0x7FF8000000000000, float* %4
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double 0x7FF8000000000000)
%31 = load i32, i32* %2
%32 = icmp sgt i32 %31, 1
br i1 %32, label %41, label %46
33: ; preds = %22, %33
%34 = phi i64 [ %36, %33 ], [ 1, %22 ]
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %24)
%36 = add nuw nsw i64 %34, 1
%37 = load i32, i32* %2
%38 = shl nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %36, %39
br i1 %40, label %33, label %25
41: ; preds = %28, %41
store float 0x7FF8000000000000, float* %3
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 0x7FF8000000000000)
store float 0x7FF8000000000000, float* %4
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double 0x7FF8000000000000)
%44 = load i32, i32* %2
%45 = icmp sgt i32 %44, 1
br i1 %45, label %41, label %46
46: ; preds = %41, %0, %28, %25
ret i32 0
}