#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 */
double cos(int);
int point_in_polygon(double, double, int *, int);
double sin(int);
double sqrt(double);
int circle_collide(double x, double y, double radius, int *vertices,
                   int no_of_points, double *dx, double *dy) {
  double px, py, dxx, dyy, vect_length;
  double average_x, average_y, start_x, start_y;
  double vector_dx, vector_dy;
  const int samples = 128;
  int i, hits = 1, collision = 0;
  *dx = 0;
  *dy = 0;
  while (hits > 0) {
    average_x = 0;
    average_y = 0;
    hits = 0;
    for (i = 0; i < samples; i++) {
      px = x + (radius * sin(i * 3.1415927 * 2 / samples));
      py = y + (radius * cos(i * 3.1415927 * 2 / samples));
      if (point_in_polygon(px, py, vertices, no_of_points) == 1) {
        average_x += px;
        average_y += py;
        hits++;
      }
    }
    if (hits > 0) {
      average_x /= hits;
      average_y /= hits;
      vector_dx = x - average_x;
      vector_dy = y - average_y;
      vect_length = sqrt(vector_dx * vector_dx + vector_dy * vector_dy);
      if (vect_length > 0) {
        dxx = vector_dx * radius / vect_length;
        dyy = vector_dy * radius / vect_length;
        start_x = x - dxx;
        start_y = y - dyy;
        for (i = 0; i < (int)radius; i++) {
          px = x - (dxx * i / radius);
          py = y - (dyy * i / radius);
          if (point_in_polygon(px, py, vertices, no_of_points) == 1) {
            dxx = px - start_x;
            dyy = py - start_y;
            x += dxx;
            y += dyy;
            *dx = *dx + dxx;
            *dy = *dy + dyy;
            break;
          }
        }
        if (i == (int)radius)
          hits = 0;
        collision = 1;
      } else {
        hits = 0;
      }
    }
  }
  return collision;
}


x86 assembly (clang, -O0):
<circle_collide>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movl   $0x80,-0x94(%rbp)
movl   $0x1,-0x9c(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
cmpl   $0x0,-0x9c(%rbp)
jle    1556 <circle_collide+0x416>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x80,-0x98(%rbp)
jge    1321 <circle_collide+0x1e1>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
cvtsi2sdl -0x98(%rbp),%xmm0
ff
movsd  0xe08(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xde0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
cvtsi2sdl -0x98(%rbp),%xmm0
ff
movsd  0xd99(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd85(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd71(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <point_in_polygon@plt>
cmp    $0x1,%eax
jne    1308 <circle_collide+0x1c8>
movsd  -0x40(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    130d <circle_collide+0x1cd>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11ce <circle_collide+0x8e>
cmpl   $0x0,-0x9c(%rbp)
jle    1551 <circle_collide+0x411>
cvtsi2sdl -0x9c(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0x9c(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1542 <circle_collide+0x402>
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cvttsd2si -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    1516 <circle_collide+0x3d6>
movsd  -0x8(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
cvtsi2sdl -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <point_in_polygon@plt>
cmp    $0x1,%eax
jne    14fd <circle_collide+0x3bd>
movsd  -0x40(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1516 <circle_collide+0x3d6>
jmp    1502 <circle_collide+0x3c2>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1418 <circle_collide+0x2d8>
mov    -0x98(%rbp),%eax
cvttsd2si -0x18(%rbp),%ecx
cmp    %ecx,%eax
jne    1533 <circle_collide+0x3f3>
movl   $0x0,-0x9c(%rbp)
movl   $0x1,-0xa0(%rbp)
jmp    154c <circle_collide+0x40c>
movl   $0x0,-0x9c(%rbp)
jmp    1551 <circle_collide+0x411>
jmp    119d <circle_collide+0x5d>
mov    -0xa0(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_collide>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %esi,%r13d
mov    %rdi,%rbx
mov    %rdx,0x68(%rsp)
movq   $0x0,(%rdx)
mov    %rcx,0x70(%rsp)
movq   $0x0,(%rcx)
cvttsd2si %xmm2,%r14d
unpcklpd %xmm0,%xmm1
unpcklpd %xmm2,%xmm2
movl   $0x0,0xc(%rsp)
movsd  0xe77(%rip),%xmm3
movsd  0xe77(%rip),%xmm4
movapd %xmm2,0x40(%rsp)
movapd %xmm1,0x20(%rsp)
xorps  %xmm5,%xmm5
mov    $0x80,%r12d
xor    %r15d,%r15d
xorpd  %xmm0,%xmm0
nopl   (%rax)
movsd  %xmm0,0x10(%rsp)
movaps %xmm5,0x50(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm0,%xmm0
mulsd  %xmm4,%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1030 <sin@plt>
movapd %xmm0,0x30(%rsp)
mov    %ebp,%edi
call   1050 <cos@plt>
movapd %xmm0,%xmm1
unpcklpd 0x30(%rsp),%xmm1
mulpd  0x40(%rsp),%xmm1
addpd  0x20(%rsp),%xmm1
movapd %xmm1,0x30(%rsp)
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mov    %rbx,%rdi
mov    %r13d,%esi
call   1040 <point_in_polygon@plt>
movapd 0x50(%rsp),%xmm5
movsd  0xdee(%rip),%xmm2
movdqa 0xdf6(%rip),%xmm1
movsd  0xdd6(%rip),%xmm4
movsd  0xdc6(%rip),%xmm3
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
movd   %ecx,%xmm0
pshufd $0x44,%xmm0,%xmm0
psllq  $0x3f,%xmm0
psrad  $0x1f,%xmm0
pshufd $0xf5,%xmm0,%xmm0
movdqa 0x30(%rsp),%xmm6
pand   %xmm0,%xmm6
pandn  %xmm1,%xmm0
por    %xmm6,%xmm0
addpd  %xmm0,%xmm5
movsd  0x10(%rsp),%xmm0
add    %ecx,%r15d
addsd  %xmm2,%xmm0
add    $0xffffffff,%r12d
jne    11b0 <circle_collide+0x70>
test   %r15d,%r15d
je     1403 <circle_collide+0x2c3>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm5
movapd 0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
subpd  %xmm5,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm0,0x10(%rsp)
unpckhpd %xmm0,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd 0xd48(%rip),%xmm0
jb     12e0 <circle_collide+0x1a0>
sqrtsd %xmm0,%xmm0
jmp    12fb <circle_collide+0x1bb>
nopl   0x0(%rax,%rax,1)
call   1060 <sqrt@plt>
movsd  0xd1b(%rip),%xmm4
movsd  0xd0b(%rip),%xmm3
movapd 0x20(%rsp),%xmm1
movapd 0x40(%rsp),%xmm2
ucomisd 0xd0f(%rip),%xmm0
jbe    1403 <circle_collide+0x2c3>
test   %r14d,%r14d
jle    1390 <circle_collide+0x250>
movapd 0x10(%rsp),%xmm3
mulpd  %xmm2,%xmm3
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm3
movapd %xmm1,%xmm0
movapd %xmm3,0x10(%rsp)
subpd  %xmm3,%xmm0
movapd %xmm0,0x30(%rsp)
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
unpcklpd %xmm0,%xmm0
mulpd  0x10(%rsp),%xmm0
divpd  %xmm2,%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
movapd %xmm1,0x50(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
call   1040 <point_in_polygon@plt>
cmp    $0x1,%eax
je     13a0 <circle_collide+0x260>
add    $0x1,%ebp
cmp    %ebp,%r14d
movapd 0x40(%rsp),%xmm2
movapd 0x20(%rsp),%xmm1
jne    1340 <circle_collide+0x200>
jmp    13fb <circle_collide+0x2bb>
nopl   (%rax)
xor    %ebp,%ebp
jmp    13e8 <circle_collide+0x2a8>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd 0x50(%rsp),%xmm2
subpd  0x30(%rsp),%xmm2
movapd 0x20(%rsp),%xmm1
addpd  %xmm2,%xmm1
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mov    0x68(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    0x70(%rsp),%rax
addsd  (%rax),%xmm2
movsd  %xmm2,(%rax)
movsd  0xc20(%rip),%xmm3
movsd  0xc20(%rip),%xmm4
movl   $0x1,0xc(%rsp)
cmp    %r14d,%ebp
jne    1197 <circle_collide+0x57>
jmp    1403 <circle_collide+0x2c3>
movl   $0x1,0xc(%rsp)
mov    0xc(%rsp),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @circle_collide(double %0, double %1, double %2, i32* %3, i32 %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32*
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store i32* %3, i32** %11
store i32 %4, i32* %12
store double* %5, double** %13
store double* %6, double** %14
store i32 128, i32* %26
store i32 1, i32* %28
store i32 0, i32* %29
%30 = load double*, double** %13
store double 0.000000e+00, double* %30
%31 = load double*, double** %14
store double 0.000000e+00, double* %31
br label %32
32: ; preds = %187, %7
%33 = load i32, i32* %28
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %188
35: ; preds = %32
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
store i32 0, i32* %28
store i32 0, i32* %27
br label %36
36: ; preds = %76, %35
%37 = load i32, i32* %27
%38 = icmp slt i32 %37, 128
br i1 %38, label %39, label %79
39: ; preds = %36
%40 = load double, double* %8
%41 = load double, double* %10
%42 = load i32, i32* %27
%43 = sitofp i32 %42 to double
%44 = fmul double %43, 0x400921FB5A7ED197
%45 = fmul double %44, 2.000000e+00
%46 = fdiv double %45, 1.280000e+02
%47 = fptosi double %46 to i32
%48 = call double @sin(i32 %47)
%49 = call double @llvm.fmuladd.f64(double %41, double %48, double %40)
store double %49, double* %15
%50 = load double, double* %9
%51 = load double, double* %10
%52 = load i32, i32* %27
%53 = sitofp i32 %52 to double
%54 = fmul double %53, 0x400921FB5A7ED197
%55 = fmul double %54, 2.000000e+00
%56 = fdiv double %55, 1.280000e+02
%57 = fptosi double %56 to i32
%58 = call double @cos(i32 %57)
%59 = call double @llvm.fmuladd.f64(double %51, double %58, double %50)
store double %59, double* %16
%60 = load double, double* %15
%61 = load double, double* %16
%62 = load i32*, i32** %11
%63 = load i32, i32* %12
%64 = call i32 @point_in_polygon(double %60, double %61, i32* %62, i32 %63)
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %75
66: ; preds = %39
%67 = load double, double* %15
%68 = load double, double* %20
%69 = fadd double %68, %67
store double %69, double* %20
%70 = load double, double* %16
%71 = load double, double* %21
%72 = fadd double %71, %70
store double %72, double* %21
%73 = load i32, i32* %28
%74 = add nsw i32 %73, 1
store i32 %74, i32* %28
br label %75
75: ; preds = %66, %39
br label %76
76: ; preds = %75
%77 = load i32, i32* %27
%78 = add nsw i32 %77, 1
store i32 %78, i32* %27
br label %36
79: ; preds = %36
%80 = load i32, i32* %28
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %187
82: ; preds = %79
%83 = load i32, i32* %28
%84 = sitofp i32 %83 to double
%85 = load double, double* %20
%86 = fdiv double %85, %84
store double %86, double* %20
%87 = load i32, i32* %28
%88 = sitofp i32 %87 to double
%89 = load double, double* %21
%90 = fdiv double %89, %88
store double %90, double* %21
%91 = load double, double* %8
%92 = load double, double* %20
%93 = fsub double %91, %92
store double %93, double* %24
%94 = load double, double* %9
%95 = load double, double* %21
%96 = fsub double %94, %95
store double %96, double* %25
%97 = load double, double* %24
%98 = load double, double* %24
%99 = load double, double* %25
%100 = load double, double* %25
%101 = fmul double %99, %100
%102 = call double @llvm.fmuladd.f64(double %97, double %98, double %101)
%103 = call double @sqrt(double %102)
store double %103, double* %19
%104 = load double, double* %19
%105 = fcmp ogt double %104, 0.000000e+00
br i1 %105, label %106, label %185
106: ; preds = %82
%107 = load double, double* %24
%108 = load double, double* %10
%109 = fmul double %107, %108
%110 = load double, double* %19
%111 = fdiv double %109, %110
store double %111, double* %17
%112 = load double, double* %25
%113 = load double, double* %10
%114 = fmul double %112, %113
%115 = load double, double* %19
%116 = fdiv double %114, %115
store double %116, double* %18
%117 = load double, double* %8
%118 = load double, double* %17
%119 = fsub double %117, %118
store double %119, double* %22
%120 = load double, double* %9
%121 = load double, double* %18
%122 = fsub double %120, %121
store double %122, double* %23
store i32 0, i32* %27
br label %123
123: ; preds = %175, %106
%124 = load i32, i32* %27
%125 = load double, double* %10
%126 = fptosi double %125 to i32
%127 = icmp slt i32 %124, %126
br i1 %127, label %128, label %178
128: ; preds = %123
%129 = load double, double* %8
%130 = load double, double* %17
%131 = load i32, i32* %27
%132 = sitofp i32 %131 to double
%133 = fmul double %130, %132
%134 = load double, double* %10
%135 = fdiv double %133, %134
%136 = fsub double %129, %135
store double %136, double* %15
%137 = load double, double* %9
%138 = load double, double* %18
%139 = load i32, i32* %27
%140 = sitofp i32 %139 to double
%141 = fmul double %138, %140
%142 = load double, double* %10
%143 = fdiv double %141, %142
%144 = fsub double %137, %143
store double %144, double* %16
%145 = load double, double* %15
%146 = load double, double* %16
%147 = load i32*, i32** %11
%148 = load i32, i32* %12
%149 = call i32 @point_in_polygon(double %145, double %146, i32* %147, i32 %148)
%150 = icmp eq i32 %149, 1
br i1 %150, label %151, label %174
151: ; preds = %128
%152 = load double, double* %15
%153 = load double, double* %22
%154 = fsub double %152, %153
store double %154, double* %17
%155 = load double, double* %16
%156 = load double, double* %23
%157 = fsub double %155, %156
store double %157, double* %18
%158 = load double, double* %17
%159 = load double, double* %8
%160 = fadd double %159, %158
store double %160, double* %8
%161 = load double, double* %18
%162 = load double, double* %9
%163 = fadd double %162, %161
store double %163, double* %9
%164 = load double*, double** %13
%165 = load double, double* %164
%166 = load double, double* %17
%167 = fadd double %165, %166
%168 = load double*, double** %13
store double %167, double* %168
%169 = load double*, double** %14
%170 = load double, double* %169
%171 = load double, double* %18
%172 = fadd double %170, %171
%173 = load double*, double** %14
store double %172, double* %173
br label %178
174: ; preds = %128
br label %175
175: ; preds = %174
%176 = load i32, i32* %27
%177 = add nsw i32 %176, 1
store i32 %177, i32* %27
br label %123
178: ; preds = %151, %123
%179 = load i32, i32* %27
%180 = load double, double* %10
%181 = fptosi double %180 to i32
%182 = icmp eq i32 %179, %181
br i1 %182, label %183, label %184
183: ; preds = %178
store i32 0, i32* %28
br label %184
184: ; preds = %183, %178
store i32 1, i32* %29
br label %186
185: ; preds = %82
store i32 0, i32* %28
br label %186
186: ; preds = %185, %184
br label %187
187: ; preds = %186, %79
br label %32
188: ; preds = %32
%189 = load i32, i32* %29
ret i32 %189
}

LLVM IR (-O2):
define i32 @circle_collide(double %0, double %1, double %2, i32* %3, i32 %4, double* nocapture %5, double* nocapture %6) {
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%8 = fptosi double %2 to i32
%9 = icmp sgt i32 %8, 0
%10 = insertelement <2 x double> poison, double %1, i64 0
%11 = insertelement <2 x double> %10, double %0, i64 1
%12 = insertelement <2 x double> poison, double %2, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = insertelement <2 x double> poison, double %2, i64 0
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
br label %16
16: ; preds = %89, %7
%17 = phi i32 [ 0, %7 ], [ 1, %89 ]
%18 = phi <2 x double> [ %11, %7 ], [ %91, %89 ]
br label %19
19: ; preds = %16, %19
%20 = phi i32 [ 0, %16 ], [ %42, %19 ]
%21 = phi i32 [ 0, %16 ], [ %43, %19 ]
%22 = phi <2 x double> [ zeroinitializer, %16 ], [ %40, %19 ]
%23 = sitofp i32 %21 to double
%24 = fmul double %23, 0x400921FB5A7ED197
%25 = fmul double %24, 2.000000e+00
%26 = fmul double %25, 7.812500e-03
%27 = fptosi double %26 to i32
%28 = tail call double @sin(i32 %27)
%29 = tail call double @cos(i32 %27)
%30 = insertelement <2 x double> poison, double %29, i64 0
%31 = insertelement <2 x double> %30, double %28, i64 1
%32 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> %31, <2 x double> %18)
%33 = extractelement <2 x double> %32, i64 0
%34 = extractelement <2 x double> %32, i64 1
%35 = tail call i32 @point_in_polygon(double %34, double %33, i32* %3, i32 %4)
%36 = icmp eq i32 %35, 1
%37 = insertelement <2 x i1> poison, i1 %36, i64 0
%38 = shufflevector <2 x i1> %37, <2 x i1> poison, <2 x i32> zeroinitializer
%39 = select <2 x i1> %38, <2 x double> %32, <2 x double> <double -0.000000e+00, double -0.000000e+00>
%40 = fadd <2 x double> %22, %39
%41 = zext i1 %36 to i32
%42 = add nuw nsw i32 %20, %41
%43 = add nuw nsw i32 %21, 1
%44 = icmp eq i32 %43, 128
br i1 %44, label %45, label %19
45: ; preds = %19
%46 = icmp eq i32 %42, 0
br i1 %46, label %93, label %47
47: ; preds = %45
%48 = sitofp i32 %42 to double
%49 = insertelement <2 x double> poison, double %48, i64 0
%50 = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> zeroinitializer
%51 = fdiv <2 x double> %40, %50
%52 = fsub <2 x double> %18, %51
%53 = fmul <2 x double> %52, %52
%54 = extractelement <2 x double> %53, i64 0
%55 = extractelement <2 x double> %52, i64 1
%56 = tail call double @llvm.fmuladd.f64(double %55, double %55, double %54)
%57 = tail call double @sqrt(double %56)
%58 = fcmp ogt double %57, 0.000000e+00
br i1 %58, label %59, label %93
59: ; preds = %47
%60 = fmul <2 x double> %52, %13
%61 = insertelement <2 x double> poison, double %57, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = fdiv <2 x double> %60, %62
%64 = fsub <2 x double> %18, %63
br i1 %9, label %65, label %89
65: ; preds = %59, %86
%66 = phi i32 [ %87, %86 ], [ 0, %59 ]
%67 = sitofp i32 %66 to double
%68 = insertelement <2 x double> poison, double %67, i64 0
%69 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> zeroinitializer
%70 = fmul <2 x double> %63, %69
%71 = fdiv <2 x double> %70, %13
%72 = fsub <2 x double> %18, %71
%73 = extractelement <2 x double> %72, i64 0
%74 = extractelement <2 x double> %72, i64 1
%75 = tail call i32 @point_in_polygon(double %74, double %73, i32* %3, i32 %4)
%76 = icmp eq i32 %75, 1
br i1 %76, label %77, label %86
77: ; preds = %65
%78 = fsub <2 x double> %72, %64
%79 = fadd <2 x double> %18, %78
%80 = load double, double* %5
%81 = extractelement <2 x double> %78, i64 1
%82 = fadd double %81, %80
store double %82, double* %5
%83 = load double, double* %6
%84 = extractelement <2 x double> %78, i64 0
%85 = fadd double %84, %83
store double %85, double* %6
br label %89
86: ; preds = %65
%87 = add nuw nsw i32 %66, 1
%88 = icmp eq i32 %87, %8
br i1 %88, label %93, label %65
89: ; preds = %59, %77
%90 = phi i32 [ %66, %77 ], [ 0, %59 ]
%91 = phi <2 x double> [ %79, %77 ], [ %18, %59 ]
%92 = icmp eq i32 %90, %8
br i1 %92, label %93, label %16
93: ; preds = %89, %47, %45, %86
%94 = phi i32 [ 1, %86 ], [ 1, %89 ], [ %17, %45 ], [ %17, %47 ]
ret i32 %94
}