#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 *, float *);
int main() {
  int w;
  float a;
  scanf("%d%f", &w, &a);
  if (w % 5 != 0)
    printf("%.2f", a);
  else {
    if (w + 0.5 > a)
      printf("%.2f", a);
    else
      printf("%.2f", a - w - 0.5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116d <main+0x4d>
movss  -0xc(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xba>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a7 <main+0x87>
movss  -0xc(%rbp),%xmm0
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    11d5 <main+0xb5>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3f(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xba>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
cmp    $0x33333333,%ecx
jb     1154 <main+0x34>
movss  (%rsp),%xmm0
jmp    1182 <main+0x62>
cvtsi2sd %eax,%xmm1
addsd  0xea0(%rip),%xmm1
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm2
ucomisd %xmm2,%xmm1
ja     1182 <main+0x62>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
addss  0xe86(%rip),%xmm0
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%f\00"
@.str.1 = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%5 = load i32, i32* %2
%6 = srem i32 %5, 5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %9)
br label %31
11: ; preds = %0
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fadd double %13, 5.000000e-01
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fcmp ogt double %14, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load float, float* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %19)
br label %30
21: ; preds = %11
%22 = load float, float* %3
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to float
%25 = fsub float %22, %24
%26 = fpext float %25 to double
%27 = fsub double %26, 5.000000e-01
%28 = fptrunc double %27 to float
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %28)
br label %30
30: ; preds = %21, %18
br label %31
31: ; preds = %30, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%f\00"
@.str.1 = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2)
%6 = load i32, i32* %1
%7 = srem i32 %6, 5
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = load float, float* %2
br label %21
11: ; preds = %0
%12 = sitofp i32 %6 to double
%13 = fadd double %12, 5.000000e-01
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fcmp ogt double %13, %15
br i1 %16, label %21, label %17
17: ; preds = %11
%18 = sitofp i32 %6 to float
%19 = fsub float %14, %18
%20 = fadd float %19, -5.000000e-01
br label %21
21: ; preds = %11, %17, %9
%22 = phi float [ %20, %17 ], [ %10, %9 ], [ %14, %11 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %22)
ret i32 0
}