#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 */
scalar_t__ abs(float);
scalar_t__ rand();
void nbco_or(float *xb, float *yb, float xs, float ys, float me) {
  float k, xp, yp;
  xp = *xb;
  yp = *yb;
  for (;;) {
    k = (float)rand() / (float)me;
    *xb += k;
    *yb += k;
    if (abs(*xb - xs) < abs(xp - xs) && abs(*yb - ys) < abs(yp - ys))
      break;
  }
}


x86 assembly (clang, -O0):
<nbco_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x14(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,-0x30(%rbp)
movss  -0x24(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jge    1200 <nbco_or+0xe0>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x18(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,-0x38(%rbp)
movss  -0x28(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
jge    1200 <nbco_or+0xe0>
jmp    1205 <nbco_or+0xe5>
jmp    1159 <nbco_or+0x39>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbco_or>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movss  %xmm2,0x1c(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
movss  (%rdi),%xmm2
movss  (%rsi),%xmm3
movss  %xmm0,0x18(%rsp)
subss  %xmm0,%xmm2
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
subss  %xmm1,%xmm3
movss  %xmm3,0xc(%rsp)
nopl   (%rax)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0x1c(%rsp),%xmm0
movss  (%r15),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%r15)
addss  (%r14),%xmm0
movss  %xmm0,(%r14)
movss  (%r15),%xmm0
subss  0x18(%rsp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rbx
movss  0x14(%rsp),%xmm0
call   1030 <abs@plt>
cmp    %rax,%rbx
jge    1160 <nbco_or+0x40>
movss  (%r14),%xmm0
subss  0x10(%rsp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <abs@plt>
cmp    %rax,%rbx
jge    1160 <nbco_or+0x40>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @nbco_or(float* %0, float* %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%14 = load float*, float** %6
%15 = load float, float* %14
store float %15, float* %12
%16 = load float*, float** %7
%17 = load float, float* %16
store float %17, float* %13
br label %18
18: ; preds = %53, %5
%19 = call i64 (...) @rand()
%20 = sitofp i64 %19 to float
%21 = load float, float* %10
%22 = fdiv float %20, %21
store float %22, float* %11
%23 = load float, float* %11
%24 = load float*, float** %6
%25 = load float, float* %24
%26 = fadd float %25, %23
store float %26, float* %24
%27 = load float, float* %11
%28 = load float*, float** %7
%29 = load float, float* %28
%30 = fadd float %29, %27
store float %30, float* %28
%31 = load float*, float** %6
%32 = load float, float* %31
%33 = load float, float* %8
%34 = fsub float %32, %33
%35 = call i64 @abs(float %34)
%36 = load float, float* %12
%37 = load float, float* %8
%38 = fsub float %36, %37
%39 = call i64 @abs(float %38)
%40 = icmp slt i64 %35, %39
br i1 %40, label %41, label %53
41: ; preds = %18
%42 = load float*, float** %7
%43 = load float, float* %42
%44 = load float, float* %9
%45 = fsub float %43, %44
%46 = call i64 @abs(float %45)
%47 = load float, float* %13
%48 = load float, float* %9
%49 = fsub float %47, %48
%50 = call i64 @abs(float %49)
%51 = icmp slt i64 %46, %50
br i1 %51, label %52, label %53
52: ; preds = %41
br label %54
53: ; preds = %41, %18
br label %18
54: ; preds = %52
ret void
}

LLVM IR (-O2):
define void @nbco_or(float* nocapture %0, float* nocapture %1, float %2, float %3, float %4) {
%6 = load float, float* %0
%7 = load float, float* %1
%8 = fsub float %6, %2
%9 = fsub float %7, %3
br label %10
10: ; preds = %29, %5
%11 = tail call i64 (...) @rand()
%12 = sitofp i64 %11 to float
%13 = fdiv float %12, %4
%14 = load float, float* %0
%15 = fadd float %14, %13
store float %15, float* %0
%16 = load float, float* %1
%17 = fadd float %13, %16
store float %17, float* %1
%18 = load float, float* %0
%19 = fsub float %18, %2
%20 = tail call i64 @abs(float %19)
%21 = tail call i64 @abs(float %8)
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %29
23: ; preds = %10
%24 = load float, float* %1
%25 = fsub float %24, %3
%26 = tail call i64 @abs(float %25)
%27 = tail call i64 @abs(float %9)
%28 = icmp slt i64 %26, %27
br i1 %28, label %30, label %29
29: ; preds = %23, %10
br label %10
30: ; preds = %23
ret void
}