#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 bidoni, a, pac_mass = 1;
  float pac_X = 0, pac_Y = 0, bidoni_X[20], bidoni_Y[20], vector_X, vector_Y;
  printf("Broi bidoni s nacepin: ");
  scanf("%d", &bidoni);
  for (a = 1; a <= bidoni; a++) {
    printf("Koordinati X i Y na bidon %d: ", a);
    scanf("%f %f", &bidoni_X[a], &bidoni_Y[a]);
  }
  for (a = 1; a <= bidoni; a++) {
    vector_X = (bidoni_X[a] - pac_X) + (bidoni_X[a] - pac_X) / pac_mass;
    vector_Y = (bidoni_Y[a] - pac_Y) + (bidoni_Y[a] - pac_Y) / pac_mass;
    printf("Vector X, vector Y: %.1f %.1f\n", vector_X, vector_Y);
    pac_mass *= 2;
    pac_X += vector_X;
    pac_Y += vector_Y;
    printf("Masata na Pacman: %d\n", pac_mass);
  }
  printf("Kraini koordinati na Pacman: %.1f %.1f\n", pac_X, pac_Y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%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    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ca <main+0xaa>
mov    -0xc(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xc(%rbp),%rax
lea    -0x70(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
lea    -0xc0(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x50>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12bb <main+0x19b>
movslq -0xc(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm0
subss  -0x14(%rbp),%xmm0
movslq -0xc(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm1
subss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc4(%rbp)
ff
movslq -0xc(%rbp),%rax
movss  -0xc0(%rbp,%rax,4),%xmm0
ff ff
subss  -0x18(%rbp),%xmm0
movslq -0xc(%rbp),%rax
movss  -0xc0(%rbp,%rax,4),%xmm1
ff ff
subss  -0x18(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc8(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0xc8(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xdd8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
movss  -0xc4(%rbp),%xmm0
ff
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc8(%rbp),%xmm0
ff
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d1 <main+0xb1>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xda1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
cmpl   $0x0,0xc(%rsp)
jle    1262 <main+0x142>
lea    0x34(%rsp),%r14
lea    0x84(%rsp),%r13
lea    0xea7(%rip),%r15
lea    0xebf(%rip),%r12
xor    %ebx,%ebx
nopl   (%rax)
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x4,%r14
add    $0x4,%r13
cmp    %rax,%rbx
jl     1180 <main+0x60>
test   %eax,%eax
xorps  %xmm0,%xmm0
jle    1262 <main+0x142>
xorps  %xmm1,%xmm1
mov    $0x1,%ebp
lea    0xe74(%rip),%r14
lea    0xe8c(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movaps %xmm1,%xmm3
movaps %xmm1,0x20(%rsp)
movss  0x34(%rsp,%rbx,4),%xmm1
movss  0x84(%rsp,%rbx,4),%xmm2
unpcklps %xmm1,%xmm2
subps  %xmm3,%xmm2
shufps $0x0,%xmm0,%xmm0
movaps %xmm2,%xmm1
divps  %xmm0,%xmm1
addps  %xmm2,%xmm1
movaps %xmm1,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r14,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
add    %ebp,%ebp
movaps 0x10(%rsp),%xmm0
addps  0x20(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movaps 0x10(%rsp),%xmm1
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     11e0 <main+0xc0>
cvtps2pd %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
lea    0xe05(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"Broi bidoni s nacepin: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Koordinati X i Y na bidon %d: \00"
@.str.3 = [6 x i8] c"%f %f\00"
@.str.4 = [31 x i8] c"Vector X, vector Y: %.1f %.1f\0A\00"
@.str.5 = [22 x i8] c"Masata na Pacman: %d\0A\00"
@.str.6 = [40 x i8] c"Kraini koordinati na Pacman: %.1f %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x float]
%3 = alloca [20 x float]
%4 = bitcast i32* %1 to i8*
%5 = bitcast [20 x float]* %2 to i8*
%6 = bitcast [20 x float]* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %54, label %13
11: ; preds = %13
%12 = icmp slt i32 %21, 1
br i1 %12, label %54, label %24
13: ; preds = %0, %13
%14 = phi i64 [ %20, %13 ], [ 1, %0 ]
%15 = trunc i64 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [20 x float], [20 x float]* %2, i64 0, i64 %14
%18 = getelementptr inbounds [20 x float], [20 x float]* %3, i64 0, i64 %14
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %17, float* %18)
%20 = add nuw nsw i64 %14, 1
%21 = load i32, i32* %1
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %14, %22
br i1 %23, label %13, label %11
24: ; preds = %11, %24
%25 = phi i64 [ %48, %24 ], [ 1, %11 ]
%26 = phi i32 [ %45, %24 ], [ 1, %11 ]
%27 = phi <2 x float> [ %46, %24 ], [ zeroinitializer, %11 ]
%28 = getelementptr inbounds [20 x float], [20 x float]* %2, i64 0, i64 %25
%29 = load float, float* %28
%30 = sitofp i32 %26 to float
%31 = getelementptr inbounds [20 x float], [20 x float]* %3, i64 0, i64 %25
%32 = load float, float* %31
%33 = insertelement <2 x float> poison, float %29, i64 0
%34 = insertelement <2 x float> %33, float %32, i64 1
%35 = fsub <2 x float> %34, %27
%36 = insertelement <2 x float> poison, float %30, i64 0
%37 = shufflevector <2 x float> %36, <2 x float> poison, <2 x i32> zeroinitializer
%38 = fdiv <2 x float> %35, %37
%39 = fadd <2 x float> %35, %38
%40 = extractelement <2 x float> %39, i64 0
%41 = fpext float %40 to double
%42 = extractelement <2 x float> %39, i64 1
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %41, double %43)
%45 = shl nsw i32 %26, 1
%46 = fadd <2 x float> %27, %39
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%48 = add nuw nsw i64 %25, 1
%49 = load i32, i32* %1
%50 = sext i32 %49 to i64
%51 = icmp slt i64 %25, %50
br i1 %51, label %24, label %52
52: ; preds = %24
%53 = fpext <2 x float> %46 to <2 x double>
br label %54
54: ; preds = %0, %52, %11
%55 = phi <2 x double> [ zeroinitializer, %11 ], [ %53, %52 ], [ zeroinitializer, %0 ]
%56 = extractelement <2 x double> %55, i64 0
%57 = extractelement <2 x double> %55, i64 1
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), double %56, double %57)
ret i32 0
}