#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);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float z, a, otstnastol;
  int broi, mny, sum, i;
  int b[234], Kcena[234];
  scanf("%d/n", &broi);
  scanf("%d/n", &mny);
  scanf("%f/n", &otstnastol);
  a = broi / otstnastol;
  i = 0;
  sum = 0;
  z = mny * 0.02;
  while (a > 0) {
    b[i] = mny;
    Kcena[i] = otstnastol * b[i];
    sum += Kcena[i];
    mny = mny - z;
    i++;
    a--;
  }
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x780,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2ssl -0x14(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1225 <main+0x105>
mov    -0x18(%rbp),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x3d0(%rbp,%rax,4)
movss  -0x10(%rbp),%xmm0
movslq -0x20(%rbp),%rax
cvtsi2ssl -0x3d0(%rbp,%rax,4),%xmm1
ff ff
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x780(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x780(%rbp,%rax,4),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cvtsi2ssl -0x18(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movss  0xdf2(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    119f <main+0x7f>
mov    -0x1c(%rbp),%esi
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x780,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xede(%rip),%r14
xor    %ebx,%ebx
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cvtsi2ssl 0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jbe    11c9 <main+0xa9>
mov    0xc(%rsp),%eax
cvtsi2sd %eax,%xmm3
mulsd  0xe77(%rip),%xmm3
cvtsd2ss %xmm3,%xmm3
xor    %ebx,%ebx
movss  0xe71(%rip),%xmm4
nopw   0x0(%rax,%rax,1)
xorps  %xmm5,%xmm5
cvtsi2ss %eax,%xmm5
movaps %xmm1,%xmm6
mulss  %xmm5,%xmm6
cvttss2si %xmm6,%ecx
subss  %xmm3,%xmm5
cvttss2si %xmm5,%eax
add    %ecx,%ebx
addss  %xmm4,%xmm0
ucomiss %xmm2,%xmm0
ja     11a0 <main+0x80>
mov    %eax,0xc(%rsp)
lea    0xe46(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d/n\00"
@.str.1 = [5 x i8] c"%f/n\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [234 x i32]
%10 = alloca [234 x i32]
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %4)
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to float
%16 = load float, float* %4
%17 = fdiv float %15, %16
store float %17, float* %3
store i32 0, i32* %8
store i32 0, i32* %7
%18 = load i32, i32* %6
%19 = sitofp i32 %18 to double
%20 = fmul double %19, 2.000000e-02
%21 = fptrunc double %20 to float
store float %21, float* %2
br label %22
22: ; preds = %25, %0
%23 = load float, float* %3
%24 = fcmp ogt float %23, 0.000000e+00
br i1 %24, label %25, label %56
25: ; preds = %22
%26 = load i32, i32* %6
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [234 x i32], [234 x i32]* %9, i64 0, i64 %28
store i32 %26, i32* %29
%30 = load float, float* %4
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [234 x i32], [234 x i32]* %9, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = sitofp i32 %34 to float
%36 = fmul float %30, %35
%37 = fptosi float %36 to i32
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [234 x i32], [234 x i32]* %10, i64 0, i64 %39
store i32 %37, i32* %40
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [234 x i32], [234 x i32]* %10, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, %44
store i32 %46, i32* %7
%47 = load i32, i32* %6
%48 = sitofp i32 %47 to float
%49 = load float, float* %2
%50 = fsub float %48, %49
%51 = fptosi float %50 to i32
store i32 %51, i32* %6
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
%54 = load float, float* %3
%55 = fadd float %54, -1.000000e+00
store float %55, float* %3
br label %22
56: ; preds = %22
%57 = load i32, i32* %7
%58 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d/n\00"
@.str.1 = [5 x i8] c"%f/n\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i32
%4 = bitcast float* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %1)
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = load float, float* %1
%13 = fdiv float %11, %12
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fmul double %15, 2.000000e-02
%17 = fptrunc double %16 to float
%18 = fcmp ogt float %13, 0.000000e+00
br i1 %18, label %19, label %32
19: ; preds = %0, %19
%20 = phi i32 [ %26, %19 ], [ 0, %0 ]
%21 = phi float [ %29, %19 ], [ %13, %0 ]
%22 = phi i32 [ %28, %19 ], [ %14, %0 ]
%23 = sitofp i32 %22 to float
%24 = fmul float %12, %23
%25 = fptosi float %24 to i32
%26 = add nsw i32 %20, %25
%27 = fsub float %23, %17
%28 = fptosi float %27 to i32
%29 = fadd float %21, -1.000000e+00
%30 = fcmp ogt float %29, 0.000000e+00
br i1 %30, label %19, label %31
31: ; preds = %19
store i32 %28, i32* %3
br label %32
32: ; preds = %31, %0
%33 = phi i32 [ %26, %31 ], [ 0, %0 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %33)
ret i32 0
}