#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 draw;
  float balance;
  scanf("%d %f", &draw, &balance);
  if (draw % 5 == 0 && balance >= draw + 0.5)
    balance -= draw + 0.5;
  printf("%.2f", balance);
  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
jne    11a2 <main+0x82>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe93(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     11a2 <main+0x82>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe78(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
movss  (%rsp),%xmm0
cmp    $0x33333332,%ecx
ja     1178 <main+0x58>
cvtss2sd %xmm0,%xmm1
cvtsi2sd %eax,%xmm2
addsd  0xe9e(%rip),%xmm2
ucomisd %xmm2,%xmm1
jb     1178 <main+0x58>
subsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rsp)
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%5 = load i32, i32* %2
%6 = srem i32 %5, 5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %0
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fadd double %12, 5.000000e-01
%14 = fcmp oge double %10, %13
br i1 %14, label %15, label %23
15: ; preds = %8
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to double
%18 = fadd double %17, 5.000000e-01
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fsub double %20, %18
%22 = fptrunc double %21 to float
store float %22, float* %3
br label %23
23: ; preds = %15, %8, %0
%24 = load float, float* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 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 ([6 x i8], [6 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
%9 = load float, float* %2
br i1 %8, label %10, label %18
10: ; preds = %0
%11 = fpext float %9 to double
%12 = sitofp i32 %6 to double
%13 = fadd double %12, 5.000000e-01
%14 = fcmp ugt double %13, %11
br i1 %14, label %18, label %15
15: ; preds = %10
%16 = fsub double %11, %13
%17 = fptrunc double %16 to float
store float %17, float* %2
br label %18
18: ; preds = %0, %15, %10
%19 = phi float [ %17, %15 ], [ %9, %10 ], [ %9, %0 ]
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}