#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 move_to_front(int, int *, int *);
int /*<<< orphan*/ s_unit2(float *, float *, double);
int wedge(float halves[][2], int m, int next[], int prev[], float cw_vec[],
          float ccw_vec[], int *degen) {
  int i;
  float d_cw, d_ccw;
  int offensive;
  *degen = 0;
  for (i = 0; i != m; i = next[i]) {
    if (!s_unit2(halves[i], ccw_vec, 1.0e-7)) {
      cw_vec[0] = ccw_vec[1];
      cw_vec[1] = -ccw_vec[0];
      ccw_vec[0] = -cw_vec[0];
      ccw_vec[1] = -cw_vec[1];
      break;
    }
  }
  if (i == m)
    return (2);
  i = 0;
  while (i != m) {
    offensive = 0;
    d_cw = ((cw_vec)[0] * (halves[i])[0] + (cw_vec)[1] * (halves[i])[1]);
    d_ccw = ((ccw_vec)[0] * (halves[i])[0] + (ccw_vec)[1] * (halves[i])[1]);
    if (d_ccw >= 2 * 1.0e-7) {
      if (d_cw <= -2 * 1.0e-7) {
        cw_vec[0] = halves[i][1];
        cw_vec[1] = -halves[i][0];
        (void)s_unit2(cw_vec, cw_vec, 1.0e-7);
        offensive = 1;
      }
    } else if (d_cw >= 2 * 1.0e-7) {
      if (d_ccw <= -2 * 1.0e-7) {
        ccw_vec[0] = -halves[i][1];
        ccw_vec[1] = halves[i][0];
        (void)s_unit2(ccw_vec, ccw_vec, 1.0e-7);
        offensive = 1;
      }
    } else if (d_ccw <= -2 * 1.0e-7 && d_cw <= -2 * 1.0e-7) {
      return (0);
    } else if ((d_cw <= -2 * 1.0e-7) || (d_ccw <= -2 * 1.0e-7) ||
               (((cw_vec)[0] * (halves[i])[1] - (cw_vec)[1] * (halves[i])[0]) <
                0.0)) {
      if (d_cw <= -2 * 1.0e-7) {
        (void)s_unit2(ccw_vec, cw_vec, 1.0e-7);
      } else if (d_ccw <= -2 * 1.0e-7) {
        (void)s_unit2(cw_vec, ccw_vec, 1.0e-7);
      }
      *degen = 1;
      offensive = 1;
    }
    if (offensive)
      i = move_to_front(i, next, prev);
    i = next[i];
    if (*degen)
      break;
  }
  if (*degen) {
    while (i != m) {
      d_cw = ((cw_vec)[0] * (halves[i])[0] + (cw_vec)[1] * (halves[i])[1]);
      d_ccw = ((ccw_vec)[0] * (halves[i])[0] + (ccw_vec)[1] * (halves[i])[1]);
      if (d_cw < -2 * 1.0e-7) {
        if (d_ccw < -2 * 1.0e-7) {
          return (0);
        } else {
          cw_vec[0] = ccw_vec[0];
          cw_vec[1] = ccw_vec[1];
        }
      } else if (d_ccw < -2 * 1.0e-7) {
        ccw_vec[0] = cw_vec[0];
        ccw_vec[1] = cw_vec[1];
      }
      i = next[i];
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<wedge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1211 <wedge+0xf1>
mov    -0x10(%rbp),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x38(%rbp),%rsi
movsd  0xe85(%rip),%xmm0
call   1040 <s_unit2@plt>
cmp    $0x0,%eax
jne    11f9 <wedge+0xd9>
mov    -0x38(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    1211 <wedge+0xf1>
jmp    11fe <wedge+0xde>
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
jmp    1154 <wedge+0x34>
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1229 <wedge+0x109>
movl   $0x2,-0x4(%rbp)
jmp    16c5 <wedge+0x5a5>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     156b <wedge+0x44b>
movl   $0x0,-0x48(%rbp)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulss  0x4(%rax,%rcx,8),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm2
mov    -0x38(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulss  0x4(%rax,%rcx,8),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd42(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1345 <wedge+0x225>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd2f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1340 <wedge+0x220>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  0x4(%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movsd  0xccc(%rip),%xmm0
call   1040 <s_unit2@plt>
movl   $0x1,-0x48(%rbp)
jmp    1529 <wedge+0x409>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13d5 <wedge+0x2b5>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc9f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     13d0 <wedge+0x2b0>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  0x4(%rax,%rcx,8),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x38(%rbp),%rsi
movsd  0xc3c(%rip),%xmm0
call   1040 <s_unit2@plt>
movl   $0x1,-0x48(%rbp)
jmp    1524 <wedge+0x404>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc2a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1417 <wedge+0x2f7>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc0f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1417 <wedge+0x2f7>
movl   $0x0,-0x4(%rbp)
jmp    16c5 <wedge+0x5a5>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xbe8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    149f <wedge+0x37f>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xbcd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    149f <wedge+0x37f>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  0x4(%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulss  (%rax,%rcx,8),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    151a <wedge+0x3fa>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb60(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     14d4 <wedge+0x3b4>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movsd  0xb36(%rip),%xmm0
call   1040 <s_unit2@plt>
jmp    1509 <wedge+0x3e9>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb2b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1504 <wedge+0x3e4>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
movsd  0xb01(%rip),%xmm0
call   1040 <s_unit2@plt>
jmp    1509 <wedge+0x3e9>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x48(%rbp)
jmp    151f <wedge+0x3ff>
jmp    1524 <wedge+0x404>
jmp    1529 <wedge+0x409>
cmpl   $0x0,-0x48(%rbp)
je     1546 <wedge+0x426>
mov    -0x3c(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <move_to_front@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1566 <wedge+0x446>
jmp    156b <wedge+0x44b>
jmp    1230 <wedge+0x110>
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     16be <wedge+0x59e>
jmp    157d <wedge+0x45d>
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     16b9 <wedge+0x599>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulss  0x4(%rax,%rcx,8),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,8),%xmm2
mov    -0x38(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulss  0x4(%rax,%rcx,8),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa04(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1664 <wedge+0x544>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x9e9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    163d <wedge+0x51d>
movl   $0x0,-0x4(%rbp)
jmp    16c5 <wedge+0x5a5>
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    16a6 <wedge+0x586>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x99b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    16a1 <wedge+0x581>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,0x4(%rax)
jmp    16a6 <wedge+0x586>
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
jmp    157d <wedge+0x45d>
jmp    16be <wedge+0x59e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wedge>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    0x50(%rsp),%rax
movl   $0x0,(%rax)
mov    $0x2,%eax
test   %esi,%esi
je     142a <wedge+0x30a>
mov    %r9,%r15
mov    %r8,%r14
mov    %rdx,%r13
mov    %esi,%ebx
mov    %rdi,%r12
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %eax,%rbp
lea    (%r12,%rbp,8),%rdi
mov    %r15,%rsi
movsd  0xe8e(%rip),%xmm0
call   1040 <s_unit2@plt>
test   %eax,%eax
je     118e <wedge+0x6e>
mov    0x0(%r13,%rbp,4),%eax
cmp    %ebx,%eax
jne    1160 <wedge+0x40>
mov    $0x2,%eax
jmp    142a <wedge+0x30a>
mov    %r13,%rbp
lea    0x4(%r15),%rax
mov    %rax,0x8(%rsp)
movss  0x4(%r15),%xmm0
movss  %xmm0,(%r14)
movss  (%r15),%xmm1
movaps 0xe6f(%rip),%xmm2
xorps  %xmm2,%xmm1
lea    0x4(%r14),%rax
mov    %rax,(%rsp)
movss  %xmm1,0x4(%r14)
xorps  %xmm2,%xmm0
movss  %xmm0,(%r15)
movss  0x4(%r14),%xmm0
xorps  %xmm2,%xmm0
movss  %xmm0,0x4(%r15)
xor    %r13d,%r13d
movsd  0xe24(%rip),%xmm7
movsd  0xe23(%rip),%xmm8
jmp    1233 <wedge+0x113>
nop
movsd  0xe08(%rip),%xmm0
call   1040 <s_unit2@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    0x10(%rsp),%rdx
call   1030 <move_to_front@plt>
cltq
movsd  0xdf8(%rip),%xmm8
movsd  0xde8(%rip),%xmm7
mov    0x0(%rbp,%rax,4),%r13d
mov    0x50(%rsp),%rax
cmpl   $0x0,(%rax)
jne    1378 <wedge+0x258>
mov    $0x1,%eax
cmp    %ebx,%r13d
je     142a <wedge+0x30a>
movss  (%r14),%xmm1
movss  0x4(%r14),%xmm3
movslq %r13d,%rax
movss  (%r12,%rax,8),%xmm2
movss  0x4(%r12,%rax,8),%xmm0
movaps %xmm3,%xmm4
mulss  %xmm0,%xmm4
movaps %xmm1,%xmm5
mulss  %xmm2,%xmm5
addss  %xmm4,%xmm5
movss  0x4(%r15),%xmm4
mulss  %xmm0,%xmm4
movss  (%r15),%xmm6
mulss  %xmm2,%xmm6
addss  %xmm4,%xmm6
xorps  %xmm4,%xmm4
cvtss2sd %xmm6,%xmm4
ucomisd %xmm7,%xmm4
cvtss2sd %xmm5,%xmm5
jae    12f0 <wedge+0x1d0>
ucomisd %xmm7,%xmm5
jae    1320 <wedge+0x200>
ucomisd %xmm4,%xmm8
jb     12b2 <wedge+0x192>
ucomisd %xmm5,%xmm8
jae    1428 <wedge+0x308>
ucomisd %xmm5,%xmm8
jae    12d8 <wedge+0x1b8>
ucomisd %xmm4,%xmm8
jae    12d8 <wedge+0x1b8>
mulss  %xmm3,%xmm2
mulss  %xmm0,%xmm1
subss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jbe    1220 <wedge+0x100>
ucomisd %xmm5,%xmm8
jb     134e <wedge+0x22e>
mov    %r15,%rdi
mov    %r14,%rsi
jmp    135b <wedge+0x23b>
nopw   0x0(%rax,%rax,1)
ucomisd %xmm5,%xmm8
jb     1220 <wedge+0x100>
movss  %xmm0,(%r14)
movss  (%r12,%rax,8),%xmm0
xorps  0xd13(%rip),%xmm0
movss  %xmm0,0x4(%r14)
mov    %r14,%rdi
mov    %r14,%rsi
jmp    11f0 <wedge+0xd0>
xchg   %ax,%ax
ucomisd %xmm4,%xmm8
jb     1220 <wedge+0x100>
xorps  0xcee(%rip),%xmm0
movss  %xmm0,(%r15)
movss  (%r12,%rax,8),%xmm0
movss  %xmm0,0x4(%r15)
mov    %r15,%rdi
mov    %r15,%rsi
jmp    11f0 <wedge+0xd0>
ucomisd %xmm4,%xmm8
jb     1368 <wedge+0x248>
mov    %r14,%rdi
mov    %r15,%rsi
movsd  0xc9d(%rip),%xmm0
call   1040 <s_unit2@plt>
mov    0x50(%rsp),%rax
movl   $0x1,(%rax)
jmp    11fd <wedge+0xdd>
mov    %ebx,%eax
jmp    138c <wedge+0x26c>
nopl   0x0(%rax)
movss  (%rcx),%xmm0
movss  %xmm0,(%rdx)
mov    (%rsi,%rax,4),%r13d
cmp    %ebx,%r13d
je     1421 <wedge+0x301>
movss  (%r14),%xmm0
movslq %r13d,%rax
movss  (%r12,%rax,8),%xmm2
movss  0x4(%r12,%rax,8),%xmm3
movss  0x4(%r14),%xmm1
mulss  %xmm3,%xmm1
movaps %xmm0,%xmm4
mulss  %xmm2,%xmm4
addss  %xmm1,%xmm4
movss  (%r15),%xmm1
mulss  0x4(%r15),%xmm3
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm4,%xmm3
ucomisd %xmm3,%xmm8
cvtss2sd %xmm2,%xmm2
jbe    1400 <wedge+0x2e0>
ucomisd %xmm2,%xmm8
ja     1428 <wedge+0x308>
mov    %rbp,%rsi
movss  %xmm1,(%r14)
mov    0x8(%rsp),%rcx
mov    (%rsp),%rdx
jmp    1380 <wedge+0x260>
xchg   %ax,%ax
ucomisd %xmm2,%xmm8
mov    %rbp,%rsi
jbe    1388 <wedge+0x268>
movss  %xmm0,(%r15)
mov    (%rsp),%rcx
mov    0x8(%rsp),%rdx
jmp    1380 <wedge+0x260>
mov    $0x1,%eax
jmp    142a <wedge+0x30a>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wedge([2 x float]* %0, i32 %1, i32* %2, i32* %3, float* %4, float* %5, i32* %6) {
%8 = alloca i32
%9 = alloca [2 x float]*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca float*
%14 = alloca float*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca float
%18 = alloca float
%19 = alloca i32
store [2 x float]* %0, [2 x float]** %9
store i32 %1, i32* %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store float* %4, float** %13
store float* %5, float** %14
store i32* %6, i32** %15
%20 = load i32*, i32** %15
store i32 0, i32* %20
store i32 0, i32* %16
br label %21
21: ; preds = %59, %7
%22 = load i32, i32* %16
%23 = load i32, i32* %10
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %65
25: ; preds = %21
%26 = load [2 x float]*, [2 x float]** %9
%27 = load i32, i32* %16
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [2 x float], [2 x float]* %26, i64 %28
%30 = getelementptr inbounds [2 x float], [2 x float]* %29, i64 0, i64 0
%31 = load float*, float** %14
%32 = call i32 @s_unit2(float* %30, float* %31, double 0x3E7AD7F29ABCAF48)
%33 = icmp ne i32 %32, 0
br i1 %33, label %58, label %34
34: ; preds = %25
%35 = load float*, float** %14
%36 = getelementptr inbounds float, float* %35, i64 1
%37 = load float, float* %36
%38 = load float*, float** %13
%39 = getelementptr inbounds float, float* %38, i64 0
store float %37, float* %39
%40 = load float*, float** %14
%41 = getelementptr inbounds float, float* %40, i64 0
%42 = load float, float* %41
%43 = fneg float %42
%44 = load float*, float** %13
%45 = getelementptr inbounds float, float* %44, i64 1
store float %43, float* %45
%46 = load float*, float** %13
%47 = getelementptr inbounds float, float* %46, i64 0
%48 = load float, float* %47
%49 = fneg float %48
%50 = load float*, float** %14
%51 = getelementptr inbounds float, float* %50, i64 0
store float %49, float* %51
%52 = load float*, float** %13
%53 = getelementptr inbounds float, float* %52, i64 1
%54 = load float, float* %53
%55 = fneg float %54
%56 = load float*, float** %14
%57 = getelementptr inbounds float, float* %56, i64 1
store float %55, float* %57
br label %65
58: ; preds = %25
br label %59
59: ; preds = %58
%60 = load i32*, i32** %11
%61 = load i32, i32* %16
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
store i32 %64, i32* %16
br label %21
65: ; preds = %34, %21
%66 = load i32, i32* %16
%67 = load i32, i32* %10
%68 = icmp eq i32 %66, %67
br i1 %68, label %69, label %70
69: ; preds = %65
store i32 2, i32* %8
br label %351
70: ; preds = %65
store i32 0, i32* %16
br label %71
71: ; preds = %256, %70
%72 = load i32, i32* %16
%73 = load i32, i32* %10
%74 = icmp ne i32 %72, %73
br i1 %74, label %75, label %257
75: ; preds = %71
store i32 0, i32* %19
%76 = load float*, float** %13
%77 = getelementptr inbounds float, float* %76, i64 0
%78 = load float, float* %77
%79 = load [2 x float]*, [2 x float]** %9
%80 = load i32, i32* %16
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [2 x float], [2 x float]* %79, i64 %81
%83 = getelementptr inbounds [2 x float], [2 x float]* %82, i64 0, i64 0
%84 = load float, float* %83
%85 = load float*, float** %13
%86 = getelementptr inbounds float, float* %85, i64 1
%87 = load float, float* %86
%88 = load [2 x float]*, [2 x float]** %9
%89 = load i32, i32* %16
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [2 x float], [2 x float]* %88, i64 %90
%92 = getelementptr inbounds [2 x float], [2 x float]* %91, i64 0, i64 1
%93 = load float, float* %92
%94 = fmul float %87, %93
%95 = call float @llvm.fmuladd.f32(float %78, float %84, float %94)
store float %95, float* %17
%96 = load float*, float** %14
%97 = getelementptr inbounds float, float* %96, i64 0
%98 = load float, float* %97
%99 = load [2 x float]*, [2 x float]** %9
%100 = load i32, i32* %16
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [2 x float], [2 x float]* %99, i64 %101
%103 = getelementptr inbounds [2 x float], [2 x float]* %102, i64 0, i64 0
%104 = load float, float* %103
%105 = load float*, float** %14
%106 = getelementptr inbounds float, float* %105, i64 1
%107 = load float, float* %106
%108 = load [2 x float]*, [2 x float]** %9
%109 = load i32, i32* %16
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [2 x float], [2 x float]* %108, i64 %110
%112 = getelementptr inbounds [2 x float], [2 x float]* %111, i64 0, i64 1
%113 = load float, float* %112
%114 = fmul float %107, %113
%115 = call float @llvm.fmuladd.f32(float %98, float %104, float %114)
store float %115, float* %18
%116 = load float, float* %18
%117 = fpext float %116 to double
%118 = fcmp oge double %117, 2.000000e-07
br i1 %118, label %119, label %145
119: ; preds = %75
%120 = load float, float* %17
%121 = fpext float %120 to double
%122 = fcmp ole double %121, -2.000000e-07
br i1 %122, label %123, label %144
123: ; preds = %119
%124 = load [2 x float]*, [2 x float]** %9
%125 = load i32, i32* %16
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [2 x float], [2 x float]* %124, i64 %126
%128 = getelementptr inbounds [2 x float], [2 x float]* %127, i64 0, i64 1
%129 = load float, float* %128
%130 = load float*, float** %13
%131 = getelementptr inbounds float, float* %130, i64 0
store float %129, float* %131
%132 = load [2 x float]*, [2 x float]** %9
%133 = load i32, i32* %16
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [2 x float], [2 x float]* %132, i64 %134
%136 = getelementptr inbounds [2 x float], [2 x float]* %135, i64 0, i64 0
%137 = load float, float* %136
%138 = fneg float %137
%139 = load float*, float** %13
%140 = getelementptr inbounds float, float* %139, i64 1
store float %138, float* %140
%141 = load float*, float** %13
%142 = load float*, float** %13
%143 = call i32 @s_unit2(float* %141, float* %142, double 0x3E7AD7F29ABCAF48)
store i32 1, i32* %19
br label %144
144: ; preds = %123, %119
br label %238
145: ; preds = %75
%146 = load float, float* %17
%147 = fpext float %146 to double
%148 = fcmp oge double %147, 2.000000e-07
br i1 %148, label %149, label %175
149: ; preds = %145
%150 = load float, float* %18
%151 = fpext float %150 to double
%152 = fcmp ole double %151, -2.000000e-07
br i1 %152, label %153, label %174
153: ; preds = %149
%154 = load [2 x float]*, [2 x float]** %9
%155 = load i32, i32* %16
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [2 x float], [2 x float]* %154, i64 %156
%158 = getelementptr inbounds [2 x float], [2 x float]* %157, i64 0, i64 1
%159 = load float, float* %158
%160 = fneg float %159
%161 = load float*, float** %14
%162 = getelementptr inbounds float, float* %161, i64 0
store float %160, float* %162
%163 = load [2 x float]*, [2 x float]** %9
%164 = load i32, i32* %16
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [2 x float], [2 x float]* %163, i64 %165
%167 = getelementptr inbounds [2 x float], [2 x float]* %166, i64 0, i64 0
%168 = load float, float* %167
%169 = load float*, float** %14
%170 = getelementptr inbounds float, float* %169, i64 1
store float %168, float* %170
%171 = load float*, float** %14
%172 = load float*, float** %14
%173 = call i32 @s_unit2(float* %171, float* %172, double 0x3E7AD7F29ABCAF48)
store i32 1, i32* %19
br label %174
174: ; preds = %153, %149
br label %237
175: ; preds = %145
%176 = load float, float* %18
%177 = fpext float %176 to double
%178 = fcmp ole double %177, -2.000000e-07
br i1 %178, label %179, label %184
179: ; preds = %175
%180 = load float, float* %17
%181 = fpext float %180 to double
%182 = fcmp ole double %181, -2.000000e-07
br i1 %182, label %183, label %184
183: ; preds = %179
store i32 0, i32* %8
br label %351
184: ; preds = %179, %175
%185 = load float, float* %17
%186 = fpext float %185 to double
%187 = fcmp ole double %186, -2.000000e-07
br i1 %187, label %216, label %188
188: ; preds = %184
%189 = load float, float* %18
%190 = fpext float %189 to double
%191 = fcmp ole double %190, -2.000000e-07
br i1 %191, label %216, label %192
192: ; preds = %188
%193 = load float*, float** %13
%194 = getelementptr inbounds float, float* %193, i64 0
%195 = load float, float* %194
%196 = load [2 x float]*, [2 x float]** %9
%197 = load i32, i32* %16
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [2 x float], [2 x float]* %196, i64 %198
%200 = getelementptr inbounds [2 x float], [2 x float]* %199, i64 0, i64 1
%201 = load float, float* %200
%202 = load float*, float** %13
%203 = getelementptr inbounds float, float* %202, i64 1
%204 = load float, float* %203
%205 = load [2 x float]*, [2 x float]** %9
%206 = load i32, i32* %16
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [2 x float], [2 x float]* %205, i64 %207
%209 = getelementptr inbounds [2 x float], [2 x float]* %208, i64 0, i64 0
%210 = load float, float* %209
%211 = fmul float %204, %210
%212 = fneg float %211
%213 = call float @llvm.fmuladd.f32(float %195, float %201, float %212)
%214 = fpext float %213 to double
%215 = fcmp olt double %214, 0.000000e+00
br i1 %215, label %216, label %235
216: ; preds = %192, %188, %184
%217 = load float, float* %17
%218 = fpext float %217 to double
%219 = fcmp ole double %218, -2.000000e-07
br i1 %219, label %220, label %224
220: ; preds = %216
%221 = load float*, float** %14
%222 = load float*, float** %13
%223 = call i32 @s_unit2(float* %221, float* %222, double 0x3E7AD7F29ABCAF48)
br label %233
224: ; preds = %216
%225 = load float, float* %18
%226 = fpext float %225 to double
%227 = fcmp ole double %226, -2.000000e-07
br i1 %227, label %228, label %232
228: ; preds = %224
%229 = load float*, float** %13
%230 = load float*, float** %14
%231 = call i32 @s_unit2(float* %229, float* %230, double 0x3E7AD7F29ABCAF48)
br label %232
232: ; preds = %228, %224
br label %233
233: ; preds = %232, %220
%234 = load i32*, i32** %15
store i32 1, i32* %234
store i32 1, i32* %19
br label %235
235: ; preds = %233, %192
br label %236
236: ; preds = %235
br label %237
237: ; preds = %236, %174
br label %238
238: ; preds = %237, %144
%239 = load i32, i32* %19
%240 = icmp ne i32 %239, 0
br i1 %240, label %241, label %246
241: ; preds = %238
%242 = load i32, i32* %16
%243 = load i32*, i32** %11
%244 = load i32*, i32** %12
%245 = call i32 @move_to_front(i32 %242, i32* %243, i32* %244)
store i32 %245, i32* %16
br label %246
246: ; preds = %241, %238
%247 = load i32*, i32** %11
%248 = load i32, i32* %16
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i32, i32* %247, i64 %249
%251 = load i32, i32* %250
store i32 %251, i32* %16
%252 = load i32*, i32** %15
%253 = load i32, i32* %252
%254 = icmp ne i32 %253, 0
br i1 %254, label %255, label %256
255: ; preds = %246
br label %257
256: ; preds = %246
br label %71
257: ; preds = %255, %71
%258 = load i32*, i32** %15
%259 = load i32, i32* %258
%260 = icmp ne i32 %259, 0
br i1 %260, label %261, label %350
261: ; preds = %257
br label %262
262: ; preds = %343, %261
%263 = load i32, i32* %16
%264 = load i32, i32* %10
%265 = icmp ne i32 %263, %264
br i1 %265, label %266, label %349
266: ; preds = %262
%267 = load float*, float** %13
%268 = getelementptr inbounds float, float* %267, i64 0
%269 = load float, float* %268
%270 = load [2 x float]*, [2 x float]** %9
%271 = load i32, i32* %16
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds [2 x float], [2 x float]* %270, i64 %272
%274 = getelementptr inbounds [2 x float], [2 x float]* %273, i64 0, i64 0
%275 = load float, float* %274
%276 = load float*, float** %13
%277 = getelementptr inbounds float, float* %276, i64 1
%278 = load float, float* %277
%279 = load [2 x float]*, [2 x float]** %9
%280 = load i32, i32* %16
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds [2 x float], [2 x float]* %279, i64 %281
%283 = getelementptr inbounds [2 x float], [2 x float]* %282, i64 0, i64 1
%284 = load float, float* %283
%285 = fmul float %278, %284
%286 = call float @llvm.fmuladd.f32(float %269, float %275, float %285)
store float %286, float* %17
%287 = load float*, float** %14
%288 = getelementptr inbounds float, float* %287, i64 0
%289 = load float, float* %288
%290 = load [2 x float]*, [2 x float]** %9
%291 = load i32, i32* %16
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds [2 x float], [2 x float]* %290, i64 %292
%294 = getelementptr inbounds [2 x float], [2 x float]* %293, i64 0, i64 0
%295 = load float, float* %294
%296 = load float*, float** %14
%297 = getelementptr inbounds float, float* %296, i64 1
%298 = load float, float* %297
%299 = load [2 x float]*, [2 x float]** %9
%300 = load i32, i32* %16
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds [2 x float], [2 x float]* %299, i64 %301
%303 = getelementptr inbounds [2 x float], [2 x float]* %302, i64 0, i64 1
%304 = load float, float* %303
%305 = fmul float %298, %304
%306 = call float @llvm.fmuladd.f32(float %289, float %295, float %305)
store float %306, float* %18
%307 = load float, float* %17
%308 = fpext float %307 to double
%309 = fcmp olt double %308, -2.000000e-07
br i1 %309, label %310, label %327
310: ; preds = %266
%311 = load float, float* %18
%312 = fpext float %311 to double
%313 = fcmp olt double %312, -2.000000e-07
br i1 %313, label %314, label %315
314: ; preds = %310
store i32 0, i32* %8
br label %351
315: ; preds = %310
%316 = load float*, float** %14
%317 = getelementptr inbounds float, float* %316, i64 0
%318 = load float, float* %317
%319 = load float*, float** %13
%320 = getelementptr inbounds float, float* %319, i64 0
store float %318, float* %320
%321 = load float*, float** %14
%322 = getelementptr inbounds float, float* %321, i64 1
%323 = load float, float* %322
%324 = load float*, float** %13
%325 = getelementptr inbounds float, float* %324, i64 1
store float %323, float* %325
br label %326
326: ; preds = %315
br label %343
327: ; preds = %266
%328 = load float, float* %18
%329 = fpext float %328 to double
%330 = fcmp olt double %329, -2.000000e-07
br i1 %330, label %331, label %342
331: ; preds = %327
%332 = load float*, float** %13
%333 = getelementptr inbounds float, float* %332, i64 0
%334 = load float, float* %333
%335 = load float*, float** %14
%336 = getelementptr inbounds float, float* %335, i64 0
store float %334, float* %336
%337 = load float*, float** %13
%338 = getelementptr inbounds float, float* %337, i64 1
%339 = load float, float* %338
%340 = load float*, float** %14
%341 = getelementptr inbounds float, float* %340, i64 1
store float %339, float* %341
br label %342
342: ; preds = %331, %327
br label %343
343: ; preds = %342, %326
%344 = load i32*, i32** %11
%345 = load i32, i32* %16
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds i32, i32* %344, i64 %346
%348 = load i32, i32* %347
store i32 %348, i32* %16
br label %262
349: ; preds = %262
br label %350
350: ; preds = %349, %257
store i32 1, i32* %8
br label %351
351: ; preds = %350, %314, %183, %69
%352 = load i32, i32* %8
ret i32 %352
}

LLVM IR (-O2):
define i32 @wedge([2 x float]* %0, i32 %1, i32* %2, i32* %3, float* %4, float* %5, i32* nocapture %6) {
store i32 0, i32* %6
%8 = icmp eq i32 %1, 0
br i1 %8, label %124, label %9
9: ; preds = %7, %15
%10 = phi i32 [ %17, %15 ], [ 0, %7 ]
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 %11, i64 0
%13 = tail call i32 @s_unit2(float* %12, float* %5, double 0x3E7AD7F29ABCAF48)
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %9
%16 = getelementptr inbounds i32, i32* %2, i64 %11
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, %1
br i1 %18, label %124, label %9
19: ; preds = %9
%20 = getelementptr inbounds float, float* %5, i64 1
%21 = load float, float* %20
store float %21, float* %4
%22 = load float, float* %5
%23 = fneg float %22
%24 = getelementptr inbounds float, float* %4, i64 1
store float %23, float* %24
%25 = fneg float %21
store float %25, float* %5
%26 = load float, float* %24
%27 = fneg float %26
store float %27, float* %20
br label %28
28: ; preds = %19, %85
%29 = phi i32 [ %88, %85 ], [ 0, %19 ]
%30 = icmp eq i32 %29, %1
br i1 %30, label %124, label %31
31: ; preds = %28
%32 = load float, float* %4
%33 = sext i32 %29 to i64
%34 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 %33, i64 0
%35 = load float, float* %34
%36 = load float, float* %24
%37 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 %33, i64 1
%38 = load float, float* %37
%39 = fmul float %36, %38
%40 = tail call float @llvm.fmuladd.f32(float %32, float %35, float %39)
%41 = load float, float* %5
%42 = load float, float* %20
%43 = fmul float %38, %42
%44 = tail call float @llvm.fmuladd.f32(float %41, float %35, float %43)
%45 = fpext float %44 to double
%46 = fcmp ult double %45, 2.000000e-07
%47 = fpext float %40 to double
br i1 %46, label %54, label %48
48: ; preds = %31
%49 = fcmp ugt double %47, -2.000000e-07
br i1 %49, label %85, label %50
50: ; preds = %48
store float %38, float* %4
%51 = load float, float* %34
%52 = fneg float %51
store float %52, float* %24
%53 = tail call i32 @s_unit2(float* %4, float* %4, double 0x3E7AD7F29ABCAF48)
br label %82
54: ; preds = %31
%55 = fcmp ult double %47, 2.000000e-07
br i1 %55, label %62, label %56
56: ; preds = %54
%57 = fcmp ugt double %45, -2.000000e-07
br i1 %57, label %85, label %58
58: ; preds = %56
%59 = fneg float %38
store float %59, float* %5
%60 = load float, float* %34
store float %60, float* %20
%61 = tail call i32 @s_unit2(float* %5, float* %5, double 0x3E7AD7F29ABCAF48)
br label %82
62: ; preds = %54
%63 = fcmp ole double %45, -2.000000e-07
%64 = xor i1 %63, true
%65 = fcmp ugt double %47, -2.000000e-07
%66 = select i1 %64, i1 true, i1 %65
br i1 %66, label %67, label %124
67: ; preds = %62
%68 = fcmp ole double %47, -2.000000e-07
%69 = select i1 %68, i1 true, i1 %63
br i1 %69, label %75, label %70
70: ; preds = %67
%71 = fneg float %36
%72 = fmul float %35, %71
%73 = tail call float @llvm.fmuladd.f32(float %32, float %38, float %72)
%74 = fcmp olt float %73, 0.000000e+00
br i1 %74, label %75, label %85
75: ; preds = %67, %70
br i1 %68, label %76, label %78
76: ; preds = %75
%77 = tail call i32 @s_unit2(float* %5, float* %4, double 0x3E7AD7F29ABCAF48)
br label %81
78: ; preds = %75
br i1 %63, label %79, label %81
79: ; preds = %78
%80 = tail call i32 @s_unit2(float* %4, float* %5, double 0x3E7AD7F29ABCAF48)
br label %81
81: ; preds = %78, %79, %76
store i32 1, i32* %6
br label %82
82: ; preds = %50, %81, %58
%83 = tail call i32 @move_to_front(i32 %29, i32* %2, i32* %3)
%84 = sext i32 %83 to i64
br label %85
85: ; preds = %48, %70, %56, %82
%86 = phi i64 [ %33, %48 ], [ %33, %70 ], [ %33, %56 ], [ %84, %82 ]
%87 = getelementptr inbounds i32, i32* %2, i64 %86
%88 = load i32, i32* %87
%89 = load i32, i32* %6
%90 = icmp eq i32 %89, 0
br i1 %90, label %28, label %91
91: ; preds = %85
%92 = icmp eq i32 %88, %1
br i1 %92, label %124, label %93
93: ; preds = %91, %120
%94 = phi i32 [ %122, %120 ], [ %88, %91 ]
%95 = load float, float* %4
%96 = sext i32 %94 to i64
%97 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 %96, i64 0
%98 = load float, float* %97
%99 = load float, float* %24
%100 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 %96, i64 1
%101 = load float, float* %100
%102 = fmul float %99, %101
%103 = tail call float @llvm.fmuladd.f32(float %95, float %98, float %102)
%104 = load float, float* %5
%105 = load float, float* %20
%106 = fmul float %101, %105
%107 = tail call float @llvm.fmuladd.f32(float %104, float %98, float %106)
%108 = fpext float %103 to double
%109 = fcmp olt double %108, -2.000000e-07
%110 = fpext float %107 to double
%111 = fcmp olt double %110, -2.000000e-07
br i1 %109, label %112, label %114
112: ; preds = %93
br i1 %111, label %124, label %113
113: ; preds = %112
store float %104, float* %4
br label %116
114: ; preds = %93
br i1 %111, label %115, label %120
115: ; preds = %114
store float %95, float* %5
br label %116
116: ; preds = %113, %115
%117 = phi float* [ %24, %115 ], [ %20, %113 ]
%118 = phi float* [ %20, %115 ], [ %24, %113 ]
%119 = load float, float* %117
store float %119, float* %118
br label %120
120: ; preds = %116, %114
%121 = getelementptr inbounds i32, i32* %2, i64 %96
%122 = load i32, i32* %121
%123 = icmp eq i32 %122, %1
br i1 %123, label %124, label %93
124: ; preds = %15, %28, %62, %112, %120, %7, %91
%125 = phi i32 [ 1, %91 ], [ 2, %7 ], [ 0, %112 ], [ 1, %120 ], [ 1, %28 ], [ 0, %62 ], [ 2, %15 ]
ret i32 %125
}