#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 */
float multiply(float, int);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main(void) {
  float a, b;
  char aSign, bSign;
  float result;
  scanf("%f %f", &a, &b);
  if (b == 0) {
    return 1;
  }
  if (a < 0) {
    aSign = '-';
    a = -a;
  } else {
    aSign = '+';
  }
  if (b < 0) {
    bSign = '-';
    b = -b;
  } else {
    bSign = '+';
  }
  for (int i = 0;; i++) {
    if (multiply(b, i) > a) {
      result = i - 1;
      break;
    }
  }
  if (aSign != bSign) {
    result = -result;
  }
  printf("%.0f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1176 <main+0x46>
jp     1176 <main+0x46>
movl   $0x1,-0x4(%rbp)
jmp    125c <main+0x12c>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11a3 <main+0x73>
movb   $0x2d,-0xd(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11a7 <main+0x77>
movb   $0x2b,-0xd(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11d4 <main+0xa4>
movb   $0x2d,-0xe(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11d8 <main+0xa8>
movb   $0x2b,-0xe(%rbp)
movl   $0x0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%edi
call   1030 <multiply@plt>
ucomiss -0x8(%rbp),%xmm0
jbe    120a <main+0xda>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    121d <main+0xed>
jmp    120f <main+0xdf>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11df <main+0xaf>
movsbl -0xd(%rbp),%eax
movsbl -0xe(%rbp),%ecx
cmp    %ecx,%eax
je     1244 <main+0x114>
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xdb6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mov    $0x1,%eax
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    1167 <main+0x37>
jnp    1209 <main+0xd9>
movss  0x8(%rsp),%xmm1
mov    $0x2b,%r14d
ucomiss %xmm1,%xmm2
mov    $0x2b,%ebp
jbe    118f <main+0x5f>
xorps  0xe7c(%rip),%xmm1
movss  %xmm1,0x8(%rsp)
mov    $0x2d,%ebp
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    11aa <main+0x7a>
xorps  0xe62(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0x2d,%r14d
xor    %edi,%edi
call   1030 <multiply@plt>
mov    $0xffffffff,%ebx
ucomiss 0x8(%rsp),%xmm0
ja     11e8 <main+0xb8>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x2(%rbx),%edi
movss  0xc(%rsp),%xmm0
call   1030 <multiply@plt>
add    $0x1,%ebx
ucomiss 0x8(%rsp),%xmm0
jbe    11d0 <main+0xa0>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
cmp    %r14d,%ebp
je     11fb <main+0xcb>
xorps  0xe05(%rip),%xmm0
lea    0xe14(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %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), float* %1, float* %2)
%6 = load float, float* %2
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %38, label %8
8: ; preds = %0
%9 = load float, float* %1
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = fneg float %9
store float %12, float* %1
br label %13
13: ; preds = %8, %11
%14 = phi i32 [ 45, %11 ], [ 43, %8 ]
%15 = fcmp olt float %6, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = fneg float %6
store float %17, float* %2
br label %18
18: ; preds = %13, %16
%19 = phi float [ %17, %16 ], [ %6, %13 ]
%20 = phi i32 [ 45, %16 ], [ 43, %13 ]
%21 = call float @multiply(float %19, i32 0)
%22 = load float, float* %1
%23 = fcmp ogt float %21, %22
br i1 %23, label %31, label %24
24: ; preds = %18, %24
%25 = phi i32 [ %26, %24 ], [ 0, %18 ]
%26 = add nuw nsw i32 %25, 1
%27 = load float, float* %2
%28 = call float @multiply(float %27, i32 %26)
%29 = load float, float* %1
%30 = fcmp ogt float %28, %29
br i1 %30, label %31, label %24
31: ; preds = %24, %18
%32 = phi i32 [ -1, %18 ], [ %25, %24 ]
%33 = sitofp i32 %32 to float
%34 = icmp eq i32 %14, %20
%35 = fneg float %33
%36 = select i1 %34, float %33, float %35
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %36)
br label %38
38: ; preds = %0, %31
%39 = phi i32 [ 0, %31 ], [ 1, %0 ]
ret i32 %39
}