#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 /*<<< orphan*/ atan2(float, float);
float exp(float);
float hypot(float, float);
float modulus(int /*<<< orphan*/, int);
int ori_to_bin(float, int);
void sift_accumulate_orientation_histogram(float x_key, float y_key,
                                           float sigma_key, const float *imX,
                                           const float *imY, int w, int h,
                                           int nbins, float lambda_ori,
                                           float *hist) {
  for (int i = 0; i < nbins; i++) {
    hist[i] = 0.0;
  }
  float R = 3 * lambda_ori * sigma_key;
  int siMin = ((0) < ((int)(x_key - R + 0.5)) ? ((int)(x_key - R + 0.5)) : (0));
  int sjMin = ((0) < ((int)(y_key - R + 0.5)) ? ((int)(y_key - R + 0.5)) : (0));
  int siMax =
      (((int)(x_key + R + 0.5)) < (h - 1) ? ((int)(x_key + R + 0.5)) : (h - 1));
  int sjMax =
      (((int)(y_key + R + 0.5)) < (w - 1) ? ((int)(y_key + R + 0.5)) : (w - 1));
  for (int si = siMin; si <= siMax; si++) {
    for (int sj = sjMin; sj <= sjMax; sj++) {
      float sX = (si - x_key) / sigma_key;
      float sY = (sj - y_key) / sigma_key;
      float dx = imX[si * w + sj];
      float dy = imY[si * w + sj];
      float ori = modulus(atan2(dy, dx), 2 * 3.14159265358979323846);
      float r2 = sX * sX + sY * sY;
      float M = hypot(dx, dy) * exp(-r2 / (2 * lambda_ori * lambda_ori));
      int gamma = ori_to_bin(ori, nbins);
      hist[gamma] += M;
    }
  }
}


x86 assembly (clang, -O0):
<sift_accumulate_orientation_histogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
movss  %xmm3,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11b6 <sift_accumulate_orientation_histogram+0x66>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    118c <sift_accumulate_orientation_histogram+0x3c>
movss  0xe4a(%rip),%xmm0
mulss  -0x30(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jge    121b <sift_accumulate_orientation_histogram+0xcb>
movss  -0x4(%rbp),%xmm0
subss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x7c(%rbp)
jmp    1225 <sift_accumulate_orientation_histogram+0xd5>
xor    %eax,%eax
mov    %eax,-0x7c(%rbp)
jmp    1225 <sift_accumulate_orientation_histogram+0xd5>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x44(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jge    1279 <sift_accumulate_orientation_histogram+0x129>
movss  -0x8(%rbp),%xmm0
subss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd97(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x80(%rbp)
jmp    1283 <sift_accumulate_orientation_histogram+0x133>
xor    %eax,%eax
mov    %eax,-0x80(%rbp)
jmp    1283 <sift_accumulate_orientation_histogram+0x133>
mov    -0x80(%rbp),%eax
mov    %eax,-0x48(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd61(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12de <sift_accumulate_orientation_histogram+0x18e>
movss  -0x4(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd35(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x84(%rbp)
jmp    12ea <sift_accumulate_orientation_histogram+0x19a>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcf7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1348 <sift_accumulate_orientation_histogram+0x1f8>
movss  -0x8(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xccb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x88(%rbp)
jmp    1354 <sift_accumulate_orientation_histogram+0x204>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     14c0 <sift_accumulate_orientation_histogram+0x370>
mov    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x50(%rbp),%eax
jg     14ad <sift_accumulate_orientation_histogram+0x35d>
cvtsi2ssl -0x54(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
cvtsi2ssl -0x58(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x64(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x68(%rbp),%xmm0
movss  -0x64(%rbp),%xmm1
call   1030 <atan2@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <modulus@plt>
movss  %xmm0,-0x6c(%rbp)
movss  -0x5c(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm2
movss  -0x60(%rbp),%xmm1
mulss  -0x60(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x64(%rbp),%xmm0
movss  -0x68(%rbp),%xmm1
call   1050 <hypot@plt>
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x70(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xbbb(%rip),%xmm1
mulss  -0x30(%rbp),%xmm1
mulss  -0x30(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movss  -0x8c(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x6c(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
call   1070 <ori_to_bin@plt>
mov    %eax,-0x78(%rbp)
movss  -0x74(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x78(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1375 <sift_accumulate_orientation_histogram+0x225>
jmp    14b2 <sift_accumulate_orientation_histogram+0x362>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1363 <sift_accumulate_orientation_histogram+0x213>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sift_accumulate_orientation_histogram>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%rbx
mov    %r8d,%ebp
mov    %ecx,%r14d
mov    %edx,%r13d
mov    %rsi,%r15
mov    %rdi,%r12
movaps %xmm0,0x60(%rsp)
test   %r8d,%r8d
movss  %xmm2,0x14(%rsp)
movaps %xmm1,0x70(%rsp)
jle    11bf <sift_accumulate_orientation_histogram+0x5f>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
movss  %xmm3,0xc(%rsp)
call   1050 <memset@plt>
movss  0xc(%rsp),%xmm3
movaps 0x70(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0xe39(%rip),%xmm0
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
movaps %xmm1,%xmm4
movaps 0x60(%rsp),%xmm6
unpcklps %xmm6,%xmm4
movaps %xmm0,%xmm5
shufps $0x0,%xmm0,%xmm5
subps  %xmm5,%xmm4
cvtps2pd %xmm4,%xmm4
addpd  0xe21(%rip),%xmm4
cvttpd2dq %xmm4,%xmm5
pshufd $0x50,%xmm5,%xmm4
pxor   %xmm7,%xmm7
pcmpgtd %xmm7,%xmm4
movmskpd %xmm4,%ecx
pshufd $0x55,%xmm5,%xmm4
movd   %xmm4,%eax
xor    %edx,%edx
test   $0x2,%cl
cmove  %edx,%eax
movd   %xmm5,%esi
test   $0x1,%cl
cmove  %edx,%esi
mov    %esi,0x10(%rsp)
movaps %xmm0,%xmm4
addss  %xmm6,%xmm4
cvtss2sd %xmm4,%xmm4
movsd  0xdfa(%rip),%xmm5
addsd  %xmm5,%xmm4
cvttsd2si %xmm4,%ecx
add    $0xffffffff,%r14d
cmp    %ecx,%r14d
cmovg  %ecx,%r14d
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm5,%xmm0
cvttsd2si %xmm0,%ecx
lea    -0x1(%r13),%edx
cmp    %ecx,%edx
cmovg  %ecx,%edx
mov    %rdx,0x38(%rsp)
mov    %r14,0x18(%rsp)
cmp    %r14d,%eax
jle    1283 <sift_accumulate_orientation_histogram+0x123>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movaps %xmm3,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm3,%xmm0
movss  %xmm0,0x2c(%rsp)
mov    0x10(%rsp),%ecx
mov    %rcx,0x50(%rsp)
mov    0x38(%rsp),%rcx
mov    %r13,%rdx
lea    0x1(%rcx),%r13d
mov    %eax,%ecx
movslq %edx,%rdx
mov    0x18(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x18(%rsp)
mov    %rdx,%rax
mov    %rcx,0x20(%rsp)
imul   %rcx,%rax
lea    (%r12,%rax,4),%r12
shl    $0x2,%rdx
mov    %rdx,0x58(%rsp)
lea    (%r15,%rax,4),%r15
jmp    1307 <sift_accumulate_orientation_histogram+0x1a7>
nopw   0x0(%rax,%rax,1)
mov    0x20(%rsp),%rcx
add    $0x1,%rcx
mov    0x58(%rsp),%rax
add    %rax,%r12
add    %rax,%r15
mov    %rcx,%rax
mov    %rcx,0x20(%rsp)
cmp    0x18(%rsp),%rcx
je     1271 <sift_accumulate_orientation_histogram+0x111>
mov    0x38(%rsp),%rax
cmp    %eax,0x10(%rsp)
jg     12e0 <sift_accumulate_orientation_histogram+0x180>
xorps  %xmm0,%xmm0
cvtsi2ssl 0x20(%rsp),%xmm0
subss  0x60(%rsp),%xmm0
divss  %xmm2,%xmm0
movss  %xmm0,0x30(%rsp)
mov    0x50(%rsp),%r14
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
subss  %xmm1,%xmm0
divss  %xmm2,%xmm0
movss  %xmm0,0x40(%rsp)
movss  (%r12,%r14,4),%xmm1
movss  %xmm1,0x34(%rsp)
movss  (%r15,%r14,4),%xmm0
movss  %xmm0,0x8(%rsp)
call   1030 <atan2@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <modulus@plt>
movss  %xmm0,0xc(%rsp)
movss  0x40(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  0x30(%rsp),%xmm1
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
xorps  0xc8c(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movss  0x34(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1060 <hypot@plt>
movss  %xmm0,0x8(%rsp)
movaps 0x40(%rsp),%xmm0
divss  0x2c(%rsp),%xmm0
call   1070 <exp@plt>
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
mov    %ebp,%edi
call   1080 <ori_to_bin@plt>
movaps 0x70(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
cltq
movss  0x8(%rsp),%xmm0
addss  (%rbx,%rax,4),%xmm0
movss  %xmm0,(%rbx,%rax,4)
add    $0x1,%r14
cmp    %r14,%r13
jne    1330 <sift_accumulate_orientation_histogram+0x1d0>
jmp    12e0 <sift_accumulate_orientation_histogram+0x180>

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

LLVM IR (-O2):
define void @sift_accumulate_orientation_histogram(float %0, float %1, float %2, float* nocapture %3, float* nocapture %4, i32 %5, i32 %6, i32 %7, float %8, float* nocapture %9) {
%11 = icmp sgt i32 %7, 0
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = bitcast float* %9 to i8*
%14 = zext i32 %7 to i64
%15 = shl nuw nsw i64 %14, 2
br label %16
16: ; preds = %12, %10
%17 = fmul float %8, 3.000000e+00
%18 = fmul float %17, %2
%19 = insertelement <2 x float> poison, float %1, i64 0
%20 = insertelement <2 x float> %19, float %0, i64 1
%21 = insertelement <2 x float> poison, float %18, i64 0
%22 = shufflevector <2 x float> %21, <2 x float> poison, <2 x i32> zeroinitializer
%23 = fsub <2 x float> %20, %22
%24 = fpext <2 x float> %23 to <2 x double>
%25 = fadd <2 x double> %24, <double 5.000000e-01, double 5.000000e-01>
%26 = fptosi <2 x double> %25 to <2 x i32>
%27 = icmp sgt <2 x i32> %26, zeroinitializer
%28 = extractelement <2 x i1> %27, i64 1
%29 = extractelement <2 x i32> %26, i64 1
%30 = select i1 %28, i32 %29, i32 0
%31 = extractelement <2 x i1> %27, i64 0
%32 = extractelement <2 x i32> %26, i64 0
%33 = select i1 %31, i32 %32, i32 0
%34 = fadd float %18, %0
%35 = fpext float %34 to double
%36 = fadd double %35, 5.000000e-01
%37 = fptosi double %36 to i32
%38 = add nsw i32 %6, -1
%39 = icmp sgt i32 %38, %37
%40 = select i1 %39, i32 %37, i32 %38
%41 = fadd float %18, %1
%42 = fpext float %41 to double
%43 = fadd double %42, 5.000000e-01
%44 = fptosi double %43 to i32
%45 = add nsw i32 %5, -1
%46 = icmp sgt i32 %45, %44
%47 = select i1 %46, i32 %44, i32 %45
%48 = icmp sgt i32 %30, %40
br i1 %48, label %68, label %49
49: ; preds = %16
%50 = icmp sgt i32 %33, %47
%51 = fmul float %8, 2.000000e+00
%52 = fmul float %51, %8
%53 = zext i32 %33 to i64
%54 = add nsw i32 %47, 1
%55 = zext i32 %30 to i64
%56 = sext i32 %5 to i64
%57 = add nsw i32 %40, 1
%58 = zext i32 %57 to i64
%59 = zext i32 %54 to i64
br label %60
60: ; preds = %49, %69
%61 = phi i64 [ %55, %49 ], [ %70, %69 ]
br i1 %50, label %69, label %62
62: ; preds = %60
%63 = trunc i64 %61 to i32
%64 = sitofp i32 %63 to float
%65 = fsub float %64, %0
%66 = fdiv float %65, %2
%67 = mul nsw i64 %61, %56
br label %72
68: ; preds = %69, %16
ret void
69: ; preds = %72, %60
%70 = add nuw nsw i64 %61, 1
%71 = icmp eq i64 %70, %58
br i1 %71, label %68, label %60
72: ; preds = %62, %72
%73 = phi i64 [ %53, %62 ], [ %97, %72 ]
%74 = trunc i64 %73 to i32
%75 = sitofp i32 %74 to float
%76 = fsub float %75, %1
%77 = fdiv float %76, %2
%78 = add nsw i64 %73, %67
%79 = getelementptr inbounds float, float* %3, i64 %78
%80 = load float, float* %79
%81 = getelementptr inbounds float, float* %4, i64 %78
%82 = load float, float* %81
%83 = tail call i32 @atan2(float %82, float %80)
%84 = tail call float @modulus(i32 %83, i32 6)
%85 = fmul float %77, %77
%86 = tail call float @llvm.fmuladd.f32(float %66, float %66, float %85)
%87 = tail call float @hypot(float %80, float %82)
%88 = fneg float %86
%89 = fdiv float %88, %52
%90 = tail call float @exp(float %89)
%91 = fmul float %87, %90
%92 = tail call i32 @ori_to_bin(float %84, i32 %7)
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds float, float* %9, i64 %93
%95 = load float, float* %94
%96 = fadd float %91, %95
store float %96, float* %94
%97 = add nuw nsw i64 %73, 1
%98 = icmp eq i64 %97, %59
br i1 %98, label %69, label %72
}