#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 *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int quantity, i = 1;
  float percentage, price;
  scanf("%d", &quantity);
  scanf("%f", &price);
  scanf("%f", &percentage);
  percentage = (percentage / 100) * price;
  float total = 0;
  do {
    total = total + price;
    i++;
    if (i % 2 == 0) {
      price = price - percentage;
    }
  } while (i <= quantity);
  printf("%.2f", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe87(%rip),%xmm1
divss  %xmm1,%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ca <main+0xaa>
movss  -0x14(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11cf <main+0xaf>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    118f <main+0x6f>
movss  -0x18(%rbp),%xmm0
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xed7(%rip),%rdi
xor    %ebp,%ebp
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm1
divss  0xe92(%rip),%xmm1
movss  0xc(%rsp),%xmm2
mulss  %xmm2,%xmm1
movss  %xmm1,0x10(%rsp)
mov    0x14(%rsp),%eax
mov    $0x1,%ecx
cmp    $0x2,%eax
cmovl  %ecx,%eax
jge    1198 <main+0x78>
xorps  %xmm0,%xmm0
test   $0x1,%al
jne    11dd <main+0xbd>
jmp    11ef <main+0xcf>
mov    %eax,%edx
and    $0x7ffffffe,%edx
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addss  %xmm2,%xmm0
subss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
addss  %xmm2,%xmm0
mov    %ecx,%esi
add    $0xfffffffe,%ecx
add    %edx,%esi
add    $0xfffffffe,%esi
cmp    $0x1,%esi
jne    11b0 <main+0x90>
add    $0xffffffff,%ecx
and    $0x1,%ecx
mov    %ecx,%ebp
test   $0x1,%al
je     11ef <main+0xcf>
addss  %xmm2,%xmm0
test   %ebp,%ebp
jne    11ef <main+0xcf>
subss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = load float, float* %2
%11 = fdiv float %10, 1.000000e+02
%12 = load float, float* %3
%13 = fmul float %11, %12
store float %13, float* %2
%14 = load i32, i32* %1
%15 = call i32 @llvm.smax.i32(i32 %14, i32 1)
%16 = and i32 %15, 1
%17 = icmp slt i32 %14, 2
br i1 %17, label %34, label %18
18: ; preds = %0
%19 = and i32 %15, 2147483646
br label %20
20: ; preds = %20, %18
%21 = phi float [ %12, %18 ], [ %26, %20 ]
%22 = phi i32 [ 1, %18 ], [ %28, %20 ]
%23 = phi float [ 0.000000e+00, %18 ], [ %27, %20 ]
%24 = phi i32 [ 0, %18 ], [ %29, %20 ]
%25 = fadd float %23, %21
%26 = fsub float %21, %13
store float %26, float* %3
%27 = fadd float %25, %26
%28 = add nuw i32 %22, 2
%29 = add i32 %24, 2
%30 = icmp eq i32 %29, %19
br i1 %30, label %31, label %20
31: ; preds = %20
%32 = and i32 %22, 1
%33 = xor i32 %32, 1
br label %34
34: ; preds = %31, %0
%35 = phi float [ undef, %0 ], [ %27, %31 ]
%36 = phi float [ %12, %0 ], [ %26, %31 ]
%37 = phi i32 [ 0, %0 ], [ %33, %31 ]
%38 = phi float [ 0.000000e+00, %0 ], [ %27, %31 ]
%39 = icmp eq i32 %16, 0
br i1 %39, label %45, label %40
40: ; preds = %34
%41 = fadd float %38, %36
%42 = icmp eq i32 %37, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = fsub float %36, %13
store float %44, float* %3
br label %45
45: ; preds = %40, %43, %34
%46 = phi float [ %35, %34 ], [ %41, %43 ], [ %41, %40 ]
%47 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), float %46)
ret i32 0
}