#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 */
unsigned int next_e(unsigned int, double *, unsigned int, double);
unsigned int decide(double *points, unsigned int size, unsigned int k,
                    double e) {
  unsigned int i = 0, j;
  for (j = 0; j < k; j++) {
    i = next_e(i, points, size, e);
    if (i == size)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<decide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1183 <decide+0x73>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
call   1030 <next_e@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1170 <decide+0x60>
movl   $0x1,-0x4(%rbp)
jmp    118a <decide+0x7a>
jmp    1175 <decide+0x65>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1135 <decide+0x25>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decide>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
test   %edx,%edx
je     114b <decide+0x3b>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
mov    %r14,%rsi
mov    %ebp,%edx
movsd  0x8(%rsp),%xmm0
call   1030 <next_e@plt>
cmp    %ebp,%eax
je     114f <decide+0x3f>
add    $0xffffffff,%ebx
jne    1130 <decide+0x20>
xor    %eax,%eax
jmp    1154 <decide+0x44>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @decide(double* %0, i32 %1, i32 %2, double %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %12
12: ; preds = %27, %4
%13 = load i32, i32* %11
%14 = load i32, i32* %8
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %10
%18 = load double*, double** %6
%19 = load i32, i32* %7
%20 = load double, double* %9
%21 = call i32 @next_e(i32 %17, double* %18, i32 %19, double %20)
store i32 %21, i32* %10
%22 = load i32, i32* %10
%23 = load i32, i32* %7
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %16
store i32 1, i32* %5
br label %31
26: ; preds = %16
br label %27
27: ; preds = %26
%28 = load i32, i32* %11
%29 = add i32 %28, 1
store i32 %29, i32* %11
br label %12
30: ; preds = %12
store i32 0, i32* %5
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @decide(double* %0, i32 %1, i32 %2, double %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %14, label %8
6: ; preds = %8
%7 = icmp eq i32 %13, %2
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i32 [ %13, %6 ], [ 0, %4 ]
%10 = phi i32 [ %11, %6 ], [ 0, %4 ]
%11 = tail call i32 @next_e(i32 %10, double* %0, i32 %1, double %3)
%12 = icmp eq i32 %11, %1
%13 = add nuw i32 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %4
%15 = phi i32 [ 0, %4 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}