#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(double);
int /*<<< orphan*/ graph_fill_polygon(int *, int, int, int, int,
                                      int /*<<< orphan*/, unsigned char *,
                                      unsigned int, unsigned int);
int /*<<< orphan*/ graph_rotate_points(int *, int, double, double, double);
int /*<<< orphan*/ graph_scale_points(int *, int, double, double, double);
double sin(double);
double sqrt(double);
int /*<<< orphan*/ transfer_draw_finger_pivot(double, double, double, double,
                                              double, double, double,
                                              unsigned char *, unsigned int,
                                              unsigned int);
void transfer_draw_finger(unsigned int index, unsigned char right_hand,
                          double x, double y, double finger_x, double finger_y,
                          double finger_angle, double prev_x, double prev_y,
                          unsigned int finger_length, unsigned int finger_width,
                          double scale, double orientation, unsigned char *img,
                          unsigned int img_width, unsigned int img_height) {
  int points[2000], no_of_points;
  double dx = finger_x - prev_x;
  double dy = finger_y - prev_y;
  double spacing = sqrt(dx * dx + dy * dy) * 0.8;
  double spacing2 = spacing * 0.8;
  double pivot_radius = 10;
  double pivot_x0, pivot_y0;
  double pivot_x1, pivot_y1;
  pivot_x0 = x + finger_x;
  pivot_y0 = y + finger_y;
  points[0] = (int)(x + finger_x);
  points[1] = (int)(y + finger_y);
  points[2] = (int)(x + finger_x + (finger_length * sin(finger_angle)));
  points[3] = (int)(y + finger_y + (finger_length * cos(finger_angle)));
  if (right_hand == 0) {
    points[4] =
        points[2] + (int)(finger_width * sin(finger_angle + (3.1415927 * 0.5)));
    points[5] =
        points[3] + (int)(finger_width * cos(finger_angle + (3.1415927 * 0.5)));
  } else {
    points[4] =
        points[2] + (int)(finger_width * sin(finger_angle - (3.1415927 * 0.5)));
    points[5] =
        points[3] + (int)(finger_width * cos(finger_angle - (3.1415927 * 0.5)));
  }
  if (right_hand == 0) {
    points[6] = points[4] + (int)((finger_length - finger_width) *
                                  sin(finger_angle + (3.1415927)));
    points[7] = points[5] + (int)((finger_length - finger_width) *
                                  cos(finger_angle + (3.1415927)));
  } else {
    points[6] = points[4] + (int)((finger_length - finger_width) *
                                  sin(finger_angle - (3.1415927)));
    points[7] = points[5] + (int)((finger_length - finger_width) *
                                  cos(finger_angle - (3.1415927)));
  }
  if (right_hand == 0) {
    points[8] = points[6] + (int)((spacing - finger_width) *
                                  sin(finger_angle + (3.1415927 * 0.5)));
    points[9] = points[7] + (int)((spacing - finger_width) *
                                  cos(finger_angle + (3.1415927 * 0.5)));
  } else {
    points[8] = points[6] + (int)((spacing - finger_width) *
                                  sin(finger_angle - (3.1415927 * 0.5)));
    points[9] = points[7] + (int)((spacing - finger_width) *
                                  cos(finger_angle - (3.1415927 * 0.5)));
  }
  if (right_hand == 0) {
    points[10] =
        points[8] + (int)(finger_width * sin(finger_angle + (3.1415927)));
    points[11] =
        points[9] + (int)(finger_width * cos(finger_angle + (3.1415927)));
  } else {
    points[10] =
        points[8] + (int)(finger_width * sin(finger_angle - (3.1415927)));
    points[11] =
        points[9] + (int)(finger_width * cos(finger_angle - (3.1415927)));
  }
  if (right_hand == 0) {
    points[12] =
        points[10] + (int)(spacing2 * sin(finger_angle + (0.7 * 3.1415927)));
    points[13] =
        points[11] + (int)(spacing2 * cos(finger_angle + (0.7 * 3.1415927)));
  } else {
    points[12] =
        points[10] + (int)(spacing2 * sin(finger_angle - (0.7 * 3.1415927)));
    points[13] =
        points[11] + (int)(spacing2 * cos(finger_angle - (0.7 * 3.1415927)));
  }
  if (right_hand == 0) {
    points[14] =
        points[10] + (int)(spacing2 * sin(finger_angle + (0.8 * 3.1415927)));
    points[15] =
        points[11] + (int)(spacing2 * cos(finger_angle + (0.8 * 3.1415927)));
  } else {
    points[14] =
        points[10] + (int)(spacing2 * sin(finger_angle - (0.8 * 3.1415927)));
    points[15] =
        points[11] + (int)(spacing2 * cos(finger_angle - (0.8 * 3.1415927)));
  }
  pivot_x1 = points[12] + ((points[14] - points[12]) / 2);
  pivot_y1 = points[13] + ((points[15] - points[13]) / 2);
  no_of_points = 8;
  graph_scale_points(points, no_of_points, x, y, scale);
  graph_rotate_points(points, no_of_points, x, y, orientation);
  graph_fill_polygon(points, no_of_points, 139, 139, 139, 0, img, img_width,
                     img_height);
  transfer_draw_finger_pivot(x, y, pivot_x0, pivot_y0, pivot_radius, scale,
                             orientation, img, img_width, img_height);
  transfer_draw_finger_pivot(x, y, pivot_x1, pivot_y1, pivot_radius, scale,
                             orientation, img, img_width, img_height);
}


x86 assembly (clang, -O0):
<transfer_draw_finger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x21b0,%rsp
mov    %sil,%al
mov    0x18(%rbp),%esi
movsd  0x10(%rbp),%xmm8
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
mov    %edx,-0x44(%rbp)
mov    %ecx,-0x48(%rbp)
movsd  %xmm7,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9d,-0x5c(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fb0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fb8(%rbp)
ff
movsd  -0x1fb0(%rbp),%xmm0
ff
movsd  -0x1fb8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movsd  0xde8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fc0(%rbp)
ff
movsd  -0x1fc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fc8(%rbp)
ff
movabs $0x4024000000000000,%rax
mov    %rax,-0x1fd0(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fd8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1fe0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1fa0(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1f9c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2010(%rbp)
ff
mov    -0x44(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2008(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x2010(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x2008(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1f98(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2000(%rbp)
ff
mov    -0x44(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x1ff8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x2000(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x1ff8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1f94(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1403 <transfer_draw_finger+0x293>
mov    -0x1f98(%rbp),%eax
mov    %eax,-0x202c(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2028(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xc83(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x202c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2028(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f90(%rbp)
mov    -0x1f94(%rbp),%eax
mov    %eax,-0x201c(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2018(%rbp)
ff
movsd  0xc35(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x201c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2018(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f8c(%rbp)
jmp    14a9 <transfer_draw_finger+0x339>
mov    -0x1f98(%rbp),%eax
mov    %eax,-0x204c(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2048(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xbe4(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x204c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2048(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f90(%rbp)
mov    -0x1f94(%rbp),%eax
mov    %eax,-0x203c(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2038(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xb89(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x203c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2038(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f8c(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1567 <transfer_draw_finger+0x3f7>
mov    -0x1f90(%rbp),%eax
mov    %eax,-0x206c(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2068(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xb34(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x206c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2068(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f88(%rbp)
mov    -0x1f8c(%rbp),%eax
mov    %eax,-0x205c(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2058(%rbp)
ff
movsd  0xae1(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x205c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2058(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f84(%rbp)
jmp    1617 <transfer_draw_finger+0x4a7>
mov    -0x1f90(%rbp),%eax
mov    %eax,-0x208c(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2088(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xa8b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x208c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2088(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f88(%rbp)
mov    -0x1f8c(%rbp),%eax
mov    %eax,-0x207c(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2078(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xa2b(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x207c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2078(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f84(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    16e3 <transfer_draw_finger+0x573>
mov    -0x1f88(%rbp),%eax
mov    %eax,-0x20ac(%rbp)
movsd  -0x1fc0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20a8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x9af(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x20ac(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20a8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f80(%rbp)
mov    -0x1f84(%rbp),%eax
mov    %eax,-0x209c(%rbp)
movsd  -0x1fc0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x2098(%rbp)
ff
movsd  0x955(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x209c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2098(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f7c(%rbp)
jmp    17a1 <transfer_draw_finger+0x631>
mov    -0x1f88(%rbp),%eax
mov    %eax,-0x20cc(%rbp)
movsd  -0x1fc0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20c8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x8f8(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x20cc(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20c8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f80(%rbp)
mov    -0x1f84(%rbp),%eax
mov    %eax,-0x20bc(%rbp)
movsd  -0x1fc0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20b8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x891(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x20bc(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20b8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f7c(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1855 <transfer_draw_finger+0x6e5>
mov    -0x1f80(%rbp),%eax
mov    %eax,-0x20ec(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20e8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x841(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x20ec(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20e8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f78(%rbp)
mov    -0x1f7c(%rbp),%eax
mov    %eax,-0x20dc(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20d8(%rbp)
ff
movsd  0x7f3(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x20dc(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20d8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f74(%rbp)
jmp    18fb <transfer_draw_finger+0x78b>
mov    -0x1f80(%rbp),%eax
mov    %eax,-0x210c(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x2108(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x7a2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x210c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f78(%rbp)
mov    -0x1f7c(%rbp),%eax
mov    %eax,-0x20fc(%rbp)
mov    -0x48(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20f8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x747(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x20fc(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x20f8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f74(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    19ab <transfer_draw_finger+0x83b>
mov    -0x1f78(%rbp),%eax
mov    %eax,-0x212c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2128(%rbp)
ff
movsd  0x6fc(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x212c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2128(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f70(%rbp)
mov    -0x1f74(%rbp),%eax
mov    %eax,-0x211c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2118(%rbp)
ff
movsd  0x6ad(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x211c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f6c(%rbp)
jmp    1a51 <transfer_draw_finger+0x8e1>
mov    -0x1f78(%rbp),%eax
mov    %eax,-0x214c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2148(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x654(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x214c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2148(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f70(%rbp)
mov    -0x1f74(%rbp),%eax
mov    %eax,-0x213c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2138(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x601(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x213c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2138(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f6c(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1b01 <transfer_draw_finger+0x991>
mov    -0x1f78(%rbp),%eax
mov    %eax,-0x216c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2168(%rbp)
ff
movsd  0x5ae(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x216c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f68(%rbp)
mov    -0x1f74(%rbp),%eax
mov    %eax,-0x215c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2158(%rbp)
ff
movsd  0x55f(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x215c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2158(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f64(%rbp)
jmp    1ba7 <transfer_draw_finger+0xa37>
mov    -0x1f78(%rbp),%eax
mov    %eax,-0x218c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2188(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x506(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x218c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2188(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f68(%rbp)
mov    -0x1f74(%rbp),%eax
mov    %eax,-0x217c(%rbp)
movsd  -0x1fc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2178(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0x4b3(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
mov    -0x217c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x2178(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x1f64(%rbp)
mov    -0x1f70(%rbp),%eax
mov    %eax,-0x2194(%rbp)
mov    -0x1f68(%rbp),%eax
sub    -0x1f70(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2194(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x1fe8(%rbp)
ff
mov    -0x1f6c(%rbp),%eax
mov    %eax,-0x2190(%rbp)
mov    -0x1f64(%rbp),%eax
sub    -0x1f6c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2190(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x1ff0(%rbp)
ff
movl   $0x8,-0x1fa4(%rbp)
lea    -0x1fa0(%rbp),%rdi
mov    -0x1fa4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
call   1030 <graph_scale_points@plt>
lea    -0x1fa0(%rbp),%rdi
mov    -0x1fa4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0x10(%rbp),%xmm2
call   1080 <graph_rotate_points@plt>
lea    -0x1fa0(%rbp),%rdi
mov    -0x1fa4(%rbp),%esi
mov    -0x58(%rbp),%r11
mov    -0x5c(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    $0x8b,%r8d
xor    %r9d,%r9d
mov    %r8d,%edx
mov    %r8d,%ecx
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <graph_fill_polygon@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x1fd8(%rbp),%xmm2
ff
movsd  -0x1fe0(%rbp),%xmm3
ff
movsd  -0x1fd0(%rbp),%xmm4
ff
movsd  -0x50(%rbp),%xmm5
movsd  0x10(%rbp),%xmm6
mov    -0x58(%rbp),%rdi
mov    -0x5c(%rbp),%esi
mov    0x18(%rbp),%edx
call   1060 <transfer_draw_finger_pivot@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x1fe8(%rbp),%xmm2
ff
movsd  -0x1ff0(%rbp),%xmm3
ff
movsd  -0x1fd0(%rbp),%xmm4
ff
movsd  -0x50(%rbp),%xmm5
movsd  0x10(%rbp),%xmm6
mov    -0x58(%rbp),%rdi
mov    -0x5c(%rbp),%esi
mov    0x18(%rbp),%edx
call   1060 <transfer_draw_finger_pivot@plt>
add    $0x21b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_draw_finger>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2008,%rsp
mov    %r9d,%r14d
mov    %r8,%r12
movsd  %xmm7,0x68(%rsp)
mov    %ecx,%r13d
mov    %edx,%ebx
movsd  %xmm4,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %esi,%ebp
movsd  %xmm2,0x40(%rsp)
movapd %xmm2,%xmm0
subsd  %xmm5,%xmm0
movsd  %xmm3,0x48(%rsp)
movapd %xmm3,%xmm1
subsd  %xmm6,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11de <transfer_draw_finger+0x6e>
sqrtsd %xmm0,%xmm0
jmp    11e3 <transfer_draw_finger+0x73>
call   1090 <sqrt@plt>
movsd  0xe15(%rip),%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm0,0x30(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,0xb0(%rsp)
movsd  0x40(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
cvttsd2si %xmm0,%eax
movsd  0x48(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
mov    %eax,0xc0(%rsp)
cvttsd2si %xmm0,%eax
mov    %eax,0xc4(%rsp)
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x50(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movapd %xmm0,0x80(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,0x70(%rsp)
xor    %r15d,%r15d
test   %bpl,%bpl
mov    %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd %xmm0,0x90(%rsp)
sete   %r15b
lea    0xd6f(%rip),%rax
movsd  (%rax,%r15,8),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0xa0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0x90(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movapd 0x80(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
cvttpd2dq %xmm2,%xmm0
movapd 0x70(%rsp),%xmm2
mulsd  0x50(%rsp),%xmm2
addsd  0x48(%rsp),%xmm2
movapd 0xa0(%rsp),%xmm3
mulsd  %xmm1,%xmm3
unpcklpd %xmm2,%xmm3
cvttpd2dq %xmm3,%xmm2
movapd %xmm0,%xmm1
unpcklpd %xmm2,%xmm1
paddd  %xmm0,%xmm2
movdqa %xmm2,0x80(%rsp)
shufps $0x4c,%xmm2,%xmm1
sub    %r13d,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
movapd %xmm0,0x70(%rsp)
movups %xmm1,0xc8(%rsp)
lea    0xcd6(%rip),%rax
movsd  (%rax,%r15,8),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0xa0(%rsp)
movsd  0x50(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0xa0(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x70(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
paddd  0x80(%rsp),%xmm0
movdqa %xmm0,0x80(%rsp)
movd   %xmm0,0xd8(%rsp)
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,0xdc(%rsp)
movapd 0x30(%rsp),%xmm0
subsd  0x90(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,0x70(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x70(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm0
paddd  0x80(%rsp),%xmm0
movdqa %xmm0,0x30(%rsp)
movd   %xmm0,0xe0(%rsp)
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,0xe4(%rsp)
movsd  0x50(%rsp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x50(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x90(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
paddd  0x30(%rsp),%xmm0
pshufd $0x44,%xmm0,%xmm1
movdqa %xmm1,0x30(%rsp)
pshufd $0x55,%xmm0,%xmm1
movd   %xmm0,0xe8(%rsp)
movd   %xmm1,0xec(%rsp)
lea    0xb98(%rip),%rax
movsd  (%rax,%r15,8),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0x90(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,0x20(%rsp)
lea    0xb71(%rip),%rax
movsd  0x8(%rsp),%xmm0
addsd  (%rax,%r15,8),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0xb0(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x90(%rsp),%xmm2
unpcklpd 0x20(%rsp),%xmm2
movapd 0x50(%rsp),%xmm3
unpcklpd %xmm0,%xmm3
mulpd  %xmm1,%xmm3
mulpd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm0
cvttpd2dq %xmm3,%xmm1
unpcklpd %xmm1,%xmm0
paddd  0x30(%rsp),%xmm0
movd   %xmm0,%eax
pshufd $0xee,%xmm0,%xmm1
psubd  %xmm0,%xmm1
movd   %xmm1,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
add    %eax,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movsd  %xmm1,0x8(%rsp)
movdqa %xmm0,0xf0(%rsp)
pshufd $0x55,%xmm0,%xmm1
movd   %xmm1,%eax
pshufd $0xff,%xmm0,%xmm0
movd   %xmm0,%ecx
sub    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
add    %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x68(%rsp),%xmm2
call   1030 <graph_scale_points@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x2040(%rsp),%xmm2
call   1080 <graph_rotate_points@plt>
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x8b,%edx
mov    $0x8b,%ecx
mov    $0x8b,%r8d
xor    %r9d,%r9d
mov    0x2050(%rsp),%ebx
push   %rbx
push   %r14
push   %r12
call   1050 <graph_fill_polygon@plt>
add    $0x20,%rsp
movsd  0x9ee(%rip),%xmm4
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  0x48(%rsp),%xmm3
movsd  0x68(%rsp),%xmm5
movsd  0x2040(%rsp),%xmm6
mov    %r12,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1060 <transfer_draw_finger_pivot@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x99a(%rip),%xmm4
movsd  0x68(%rsp),%xmm5
movsd  0x2040(%rsp),%xmm6
mov    %r12,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1060 <transfer_draw_finger_pivot@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @transfer_draw_finger(i32 %0, i8 zeroext %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, i32 %9, i32 %10, double %11, double %12, i8* %13, i32 %14, i32 %15) {
%17 = alloca i32
%18 = alloca i8
%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 double
%29 = alloca double
%30 = alloca i8*
%31 = alloca i32
%32 = alloca i32
%33 = alloca [2000 x i32]
%34 = alloca i32
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
store i32 %0, i32* %17
store i8 %1, i8* %18
store double %2, double* %19
store double %3, double* %20
store double %4, double* %21
store double %5, double* %22
store double %6, double* %23
store double %7, double* %24
store double %8, double* %25
store i32 %9, i32* %26
store i32 %10, i32* %27
store double %11, double* %28
store double %12, double* %29
store i8* %13, i8** %30
store i32 %14, i32* %31
store i32 %15, i32* %32
%44 = load double, double* %21
%45 = load double, double* %24
%46 = fsub double %44, %45
store double %46, double* %35
%47 = load double, double* %22
%48 = load double, double* %25
%49 = fsub double %47, %48
store double %49, double* %36
%50 = load double, double* %35
%51 = load double, double* %35
%52 = load double, double* %36
%53 = load double, double* %36
%54 = fmul double %52, %53
%55 = call double @llvm.fmuladd.f64(double %50, double %51, double %54)
%56 = call double @sqrt(double %55)
%57 = fmul double %56, 8.000000e-01
store double %57, double* %37
%58 = load double, double* %37
%59 = fmul double %58, 8.000000e-01
store double %59, double* %38
store double 1.000000e+01, double* %39
%60 = load double, double* %19
%61 = load double, double* %21
%62 = fadd double %60, %61
store double %62, double* %40
%63 = load double, double* %20
%64 = load double, double* %22
%65 = fadd double %63, %64
store double %65, double* %41
%66 = load double, double* %19
%67 = load double, double* %21
%68 = fadd double %66, %67
%69 = fptosi double %68 to i32
%70 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 0
store i32 %69, i32* %70
%71 = load double, double* %20
%72 = load double, double* %22
%73 = fadd double %71, %72
%74 = fptosi double %73 to i32
%75 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 1
store i32 %74, i32* %75
%76 = load double, double* %19
%77 = load double, double* %21
%78 = fadd double %76, %77
%79 = load i32, i32* %26
%80 = uitofp i32 %79 to double
%81 = load double, double* %23
%82 = call double @sin(double %81)
%83 = call double @llvm.fmuladd.f64(double %80, double %82, double %78)
%84 = fptosi double %83 to i32
%85 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 2
store i32 %84, i32* %85
%86 = load double, double* %20
%87 = load double, double* %22
%88 = fadd double %86, %87
%89 = load i32, i32* %26
%90 = uitofp i32 %89 to double
%91 = load double, double* %23
%92 = call double @cos(double %91)
%93 = call double @llvm.fmuladd.f64(double %90, double %92, double %88)
%94 = fptosi double %93 to i32
%95 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 3
store i32 %94, i32* %95
%96 = load i8, i8* %18
%97 = zext i8 %96 to i32
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %122
99: ; preds = %16
%100 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 2
%101 = load i32, i32* %100
%102 = load i32, i32* %27
%103 = uitofp i32 %102 to double
%104 = load double, double* %23
%105 = fadd double %104, 0x3FF921FB5A7ED197
%106 = call double @sin(double %105)
%107 = fmul double %103, %106
%108 = fptosi double %107 to i32
%109 = add nsw i32 %101, %108
%110 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 4
store i32 %109, i32* %110
%111 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 3
%112 = load i32, i32* %111
%113 = load i32, i32* %27
%114 = uitofp i32 %113 to double
%115 = load double, double* %23
%116 = fadd double %115, 0x3FF921FB5A7ED197
%117 = call double @cos(double %116)
%118 = fmul double %114, %117
%119 = fptosi double %118 to i32
%120 = add nsw i32 %112, %119
%121 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 5
store i32 %120, i32* %121
br label %145
122: ; preds = %16
%123 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 2
%124 = load i32, i32* %123
%125 = load i32, i32* %27
%126 = uitofp i32 %125 to double
%127 = load double, double* %23
%128 = fsub double %127, 0x3FF921FB5A7ED197
%129 = call double @sin(double %128)
%130 = fmul double %126, %129
%131 = fptosi double %130 to i32
%132 = add nsw i32 %124, %131
%133 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 4
store i32 %132, i32* %133
%134 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 3
%135 = load i32, i32* %134
%136 = load i32, i32* %27
%137 = uitofp i32 %136 to double
%138 = load double, double* %23
%139 = fsub double %138, 0x3FF921FB5A7ED197
%140 = call double @cos(double %139)
%141 = fmul double %137, %140
%142 = fptosi double %141 to i32
%143 = add nsw i32 %135, %142
%144 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 5
store i32 %143, i32* %144
br label %145
145: ; preds = %122, %99
%146 = load i8, i8* %18
%147 = zext i8 %146 to i32
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %176
149: ; preds = %145
%150 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 4
%151 = load i32, i32* %150
%152 = load i32, i32* %26
%153 = load i32, i32* %27
%154 = sub i32 %152, %153
%155 = uitofp i32 %154 to double
%156 = load double, double* %23
%157 = fadd double %156, 0x400921FB5A7ED197
%158 = call double @sin(double %157)
%159 = fmul double %155, %158
%160 = fptosi double %159 to i32
%161 = add nsw i32 %151, %160
%162 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 6
store i32 %161, i32* %162
%163 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 5
%164 = load i32, i32* %163
%165 = load i32, i32* %26
%166 = load i32, i32* %27
%167 = sub i32 %165, %166
%168 = uitofp i32 %167 to double
%169 = load double, double* %23
%170 = fadd double %169, 0x400921FB5A7ED197
%171 = call double @cos(double %170)
%172 = fmul double %168, %171
%173 = fptosi double %172 to i32
%174 = add nsw i32 %164, %173
%175 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 7
store i32 %174, i32* %175
br label %203
176: ; preds = %145
%177 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 4
%178 = load i32, i32* %177
%179 = load i32, i32* %26
%180 = load i32, i32* %27
%181 = sub i32 %179, %180
%182 = uitofp i32 %181 to double
%183 = load double, double* %23
%184 = fsub double %183, 0x400921FB5A7ED197
%185 = call double @sin(double %184)
%186 = fmul double %182, %185
%187 = fptosi double %186 to i32
%188 = add nsw i32 %178, %187
%189 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 6
store i32 %188, i32* %189
%190 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 5
%191 = load i32, i32* %190
%192 = load i32, i32* %26
%193 = load i32, i32* %27
%194 = sub i32 %192, %193
%195 = uitofp i32 %194 to double
%196 = load double, double* %23
%197 = fsub double %196, 0x400921FB5A7ED197
%198 = call double @cos(double %197)
%199 = fmul double %195, %198
%200 = fptosi double %199 to i32
%201 = add nsw i32 %191, %200
%202 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 7
store i32 %201, i32* %202
br label %203
203: ; preds = %176, %149
%204 = load i8, i8* %18
%205 = zext i8 %204 to i32
%206 = icmp eq i32 %205, 0
br i1 %206, label %207, label %234
207: ; preds = %203
%208 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 6
%209 = load i32, i32* %208
%210 = load double, double* %37
%211 = load i32, i32* %27
%212 = uitofp i32 %211 to double
%213 = fsub double %210, %212
%214 = load double, double* %23
%215 = fadd double %214, 0x3FF921FB5A7ED197
%216 = call double @sin(double %215)
%217 = fmul double %213, %216
%218 = fptosi double %217 to i32
%219 = add nsw i32 %209, %218
%220 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 8
store i32 %219, i32* %220
%221 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 7
%222 = load i32, i32* %221
%223 = load double, double* %37
%224 = load i32, i32* %27
%225 = uitofp i32 %224 to double
%226 = fsub double %223, %225
%227 = load double, double* %23
%228 = fadd double %227, 0x3FF921FB5A7ED197
%229 = call double @cos(double %228)
%230 = fmul double %226, %229
%231 = fptosi double %230 to i32
%232 = add nsw i32 %222, %231
%233 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 9
store i32 %232, i32* %233
br label %261
234: ; preds = %203
%235 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 6
%236 = load i32, i32* %235
%237 = load double, double* %37
%238 = load i32, i32* %27
%239 = uitofp i32 %238 to double
%240 = fsub double %237, %239
%241 = load double, double* %23
%242 = fsub double %241, 0x3FF921FB5A7ED197
%243 = call double @sin(double %242)
%244 = fmul double %240, %243
%245 = fptosi double %244 to i32
%246 = add nsw i32 %236, %245
%247 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 8
store i32 %246, i32* %247
%248 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 7
%249 = load i32, i32* %248
%250 = load double, double* %37
%251 = load i32, i32* %27
%252 = uitofp i32 %251 to double
%253 = fsub double %250, %252
%254 = load double, double* %23
%255 = fsub double %254, 0x3FF921FB5A7ED197
%256 = call double @cos(double %255)
%257 = fmul double %253, %256
%258 = fptosi double %257 to i32
%259 = add nsw i32 %249, %258
%260 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 9
store i32 %259, i32* %260
br label %261
261: ; preds = %234, %207
%262 = load i8, i8* %18
%263 = zext i8 %262 to i32
%264 = icmp eq i32 %263, 0
br i1 %264, label %265, label %288
265: ; preds = %261
%266 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 8
%267 = load i32, i32* %266
%268 = load i32, i32* %27
%269 = uitofp i32 %268 to double
%270 = load double, double* %23
%271 = fadd double %270, 0x400921FB5A7ED197
%272 = call double @sin(double %271)
%273 = fmul double %269, %272
%274 = fptosi double %273 to i32
%275 = add nsw i32 %267, %274
%276 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
store i32 %275, i32* %276
%277 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 9
%278 = load i32, i32* %277
%279 = load i32, i32* %27
%280 = uitofp i32 %279 to double
%281 = load double, double* %23
%282 = fadd double %281, 0x400921FB5A7ED197
%283 = call double @cos(double %282)
%284 = fmul double %280, %283
%285 = fptosi double %284 to i32
%286 = add nsw i32 %278, %285
%287 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
store i32 %286, i32* %287
br label %311
288: ; preds = %261
%289 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 8
%290 = load i32, i32* %289
%291 = load i32, i32* %27
%292 = uitofp i32 %291 to double
%293 = load double, double* %23
%294 = fsub double %293, 0x400921FB5A7ED197
%295 = call double @sin(double %294)
%296 = fmul double %292, %295
%297 = fptosi double %296 to i32
%298 = add nsw i32 %290, %297
%299 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
store i32 %298, i32* %299
%300 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 9
%301 = load i32, i32* %300
%302 = load i32, i32* %27
%303 = uitofp i32 %302 to double
%304 = load double, double* %23
%305 = fsub double %304, 0x400921FB5A7ED197
%306 = call double @cos(double %305)
%307 = fmul double %303, %306
%308 = fptosi double %307 to i32
%309 = add nsw i32 %301, %308
%310 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
store i32 %309, i32* %310
br label %311
311: ; preds = %288, %265
%312 = load i8, i8* %18
%313 = zext i8 %312 to i32
%314 = icmp eq i32 %313, 0
br i1 %314, label %315, label %336
315: ; preds = %311
%316 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
%317 = load i32, i32* %316
%318 = load double, double* %38
%319 = load double, double* %23
%320 = fadd double %319, 0x400197C98C2592B6
%321 = call double @sin(double %320)
%322 = fmul double %318, %321
%323 = fptosi double %322 to i32
%324 = add nsw i32 %317, %323
%325 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 12
store i32 %324, i32* %325
%326 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
%327 = load i32, i32* %326
%328 = load double, double* %38
%329 = load double, double* %23
%330 = fadd double %329, 0x400197C98C2592B6
%331 = call double @cos(double %330)
%332 = fmul double %328, %331
%333 = fptosi double %332 to i32
%334 = add nsw i32 %327, %333
%335 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 13
store i32 %334, i32* %335
br label %357
336: ; preds = %311
%337 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
%338 = load i32, i32* %337
%339 = load double, double* %38
%340 = load double, double* %23
%341 = fsub double %340, 0x400197C98C2592B6
%342 = call double @sin(double %341)
%343 = fmul double %339, %342
%344 = fptosi double %343 to i32
%345 = add nsw i32 %338, %344
%346 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 12
store i32 %345, i32* %346
%347 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
%348 = load i32, i32* %347
%349 = load double, double* %38
%350 = load double, double* %23
%351 = fsub double %350, 0x400197C98C2592B6
%352 = call double @cos(double %351)
%353 = fmul double %349, %352
%354 = fptosi double %353 to i32
%355 = add nsw i32 %348, %354
%356 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 13
store i32 %355, i32* %356
br label %357
357: ; preds = %336, %315
%358 = load i8, i8* %18
%359 = zext i8 %358 to i32
%360 = icmp eq i32 %359, 0
br i1 %360, label %361, label %382
361: ; preds = %357
%362 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
%363 = load i32, i32* %362
%364 = load double, double* %38
%365 = load double, double* %23
%366 = fadd double %365, 0x40041B2F7B98A7AC
%367 = call double @sin(double %366)
%368 = fmul double %364, %367
%369 = fptosi double %368 to i32
%370 = add nsw i32 %363, %369
%371 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 14
store i32 %370, i32* %371
%372 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
%373 = load i32, i32* %372
%374 = load double, double* %38
%375 = load double, double* %23
%376 = fadd double %375, 0x40041B2F7B98A7AC
%377 = call double @cos(double %376)
%378 = fmul double %374, %377
%379 = fptosi double %378 to i32
%380 = add nsw i32 %373, %379
%381 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 15
store i32 %380, i32* %381
br label %403
382: ; preds = %357
%383 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 10
%384 = load i32, i32* %383
%385 = load double, double* %38
%386 = load double, double* %23
%387 = fsub double %386, 0x40041B2F7B98A7AC
%388 = call double @sin(double %387)
%389 = fmul double %385, %388
%390 = fptosi double %389 to i32
%391 = add nsw i32 %384, %390
%392 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 14
store i32 %391, i32* %392
%393 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 11
%394 = load i32, i32* %393
%395 = load double, double* %38
%396 = load double, double* %23
%397 = fsub double %396, 0x40041B2F7B98A7AC
%398 = call double @cos(double %397)
%399 = fmul double %395, %398
%400 = fptosi double %399 to i32
%401 = add nsw i32 %394, %400
%402 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 15
store i32 %401, i32* %402
br label %403
403: ; preds = %382, %361
%404 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 12
%405 = load i32, i32* %404
%406 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 14
%407 = load i32, i32* %406
%408 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 12
%409 = load i32, i32* %408
%410 = sub nsw i32 %407, %409
%411 = sdiv i32 %410, 2
%412 = add nsw i32 %405, %411
%413 = sitofp i32 %412 to double
store double %413, double* %42
%414 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 13
%415 = load i32, i32* %414
%416 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 15
%417 = load i32, i32* %416
%418 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 13
%419 = load i32, i32* %418
%420 = sub nsw i32 %417, %419
%421 = sdiv i32 %420, 2
%422 = add nsw i32 %415, %421
%423 = sitofp i32 %422 to double
store double %423, double* %43
store i32 8, i32* %34
%424 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 0
%425 = load i32, i32* %34
%426 = load double, double* %19
%427 = load double, double* %20
%428 = load double, double* %28
%429 = call i32 @graph_scale_points(i32* %424, i32 %425, double %426, double %427, double %428)
%430 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 0
%431 = load i32, i32* %34
%432 = load double, double* %19
%433 = load double, double* %20
%434 = load double, double* %29
%435 = call i32 @graph_rotate_points(i32* %430, i32 %431, double %432, double %433, double %434)
%436 = getelementptr inbounds [2000 x i32], [2000 x i32]* %33, i64 0, i64 0
%437 = load i32, i32* %34
%438 = load i8*, i8** %30
%439 = load i32, i32* %31
%440 = load i32, i32* %32
%441 = call i32 @graph_fill_polygon(i32* %436, i32 %437, i32 139, i32 139, i32 139, i32 0, i8* %438, i32 %439, i32 %440)
%442 = load double, double* %19
%443 = load double, double* %20
%444 = load double, double* %40
%445 = load double, double* %41
%446 = load double, double* %39
%447 = load double, double* %28
%448 = load double, double* %29
%449 = load i8*, i8** %30
%450 = load i32, i32* %31
%451 = load i32, i32* %32
%452 = call i32 @transfer_draw_finger_pivot(double %442, double %443, double %444, double %445, double %446, double %447, double %448, i8* %449, i32 %450, i32 %451)
%453 = load double, double* %19
%454 = load double, double* %20
%455 = load double, double* %42
%456 = load double, double* %43
%457 = load double, double* %39
%458 = load double, double* %28
%459 = load double, double* %29
%460 = load i8*, i8** %30
%461 = load i32, i32* %31
%462 = load i32, i32* %32
%463 = call i32 @transfer_draw_finger_pivot(double %453, double %454, double %455, double %456, double %457, double %458, double %459, i8* %460, i32 %461, i32 %462)
ret void
}

LLVM IR (-O2):
define void @transfer_draw_finger(i32 %0, i8 zeroext %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, i32 %9, i32 %10, double %11, double %12, i8* %13, i32 %14, i32 %15) {
%17 = alloca [2000 x i32]
%18 = bitcast [2000 x i32]* %17 to i8*
%19 = fsub double %4, %7
%20 = fsub double %5, %8
%21 = fmul double %20, %20
%22 = tail call double @llvm.fmuladd.f64(double %19, double %19, double %21)
%23 = tail call double @sqrt(double %22)
%24 = fmul double %23, 8.000000e-01
%25 = fmul double %24, 8.000000e-01
%26 = fadd double %2, %4
%27 = fadd double %3, %5
%28 = fptosi double %26 to i32
%29 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 0
store i32 %28, i32* %29
%30 = fptosi double %27 to i32
%31 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 1
store i32 %30, i32* %31
%32 = uitofp i32 %9 to double
%33 = tail call double @sin(double %6)
%34 = tail call double @llvm.fmuladd.f64(double %32, double %33, double %26)
%35 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 2
%36 = tail call double @cos(double %6)
%37 = icmp eq i8 %1, 0
%38 = uitofp i32 %10 to double
%39 = select i1 %37, double 0x3FF921FB5A7ED197, double 0xBFF921FB5A7ED197
%40 = fadd double %39, %6
%41 = tail call double @sin(double %40)
%42 = tail call double @cos(double %40)
%43 = fmul double %42, %38
%44 = insertelement <2 x double> poison, double %34, i64 0
%45 = insertelement <2 x double> %44, double %43, i64 1
%46 = fptosi <2 x double> %45 to <2 x i32>
%47 = extractelement <2 x i32> %46, i64 0
store i32 %47, i32* %35
%48 = tail call double @llvm.fmuladd.f64(double %32, double %36, double %27)
%49 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 3
%50 = fmul double %41, %38
%51 = insertelement <2 x double> poison, double %50, i64 0
%52 = insertelement <2 x double> %51, double %48, i64 1
%53 = fptosi <2 x double> %52 to <2 x i32>
%54 = extractelement <2 x i32> %53, i64 1
store i32 %54, i32* %49
%55 = select i1 %37, double 0x400921FB5A7ED197, double 0xC00921FB5A7ED197
%56 = select i1 %37, double 0x400197C98C2592B6, double 0xC00197C98C2592B6
%57 = select i1 %37, double 0x40041B2F7B98A7AC, double 0xC0041B2F7B98A7AC
%58 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 4
%59 = add nsw <2 x i32> %53, %46
%60 = extractelement <2 x i32> %59, i64 0
store i32 %60, i32* %58
%61 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 5
%62 = extractelement <2 x i32> %59, i64 1
store i32 %62, i32* %61
%63 = sub i32 %9, %10
%64 = uitofp i32 %63 to double
%65 = fadd double %55, %6
%66 = tail call double @sin(double %65)
%67 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 6
%68 = tail call double @cos(double %65)
%69 = insertelement <2 x double> poison, double %66, i64 0
%70 = insertelement <2 x double> %69, double %68, i64 1
%71 = insertelement <2 x double> poison, double %64, i64 0
%72 = shufflevector <2 x double> %71, <2 x double> poison, <2 x i32> zeroinitializer
%73 = fmul <2 x double> %70, %72
%74 = fptosi <2 x double> %73 to <2 x i32>
%75 = add nsw <2 x i32> %59, %74
%76 = extractelement <2 x i32> %75, i64 0
store i32 %76, i32* %67
%77 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 7
%78 = extractelement <2 x i32> %75, i64 1
store i32 %78, i32* %77
%79 = fsub double %24, %38
%80 = tail call double @sin(double %40)
%81 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 8
%82 = tail call double @cos(double %40)
%83 = insertelement <2 x double> poison, double %79, i64 0
%84 = shufflevector <2 x double> %83, <2 x double> poison, <2 x i32> zeroinitializer
%85 = insertelement <2 x double> poison, double %80, i64 0
%86 = insertelement <2 x double> %85, double %82, i64 1
%87 = fmul <2 x double> %84, %86
%88 = fptosi <2 x double> %87 to <2 x i32>
%89 = add nsw <2 x i32> %75, %88
%90 = extractelement <2 x i32> %89, i64 0
store i32 %90, i32* %81
%91 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 9
%92 = extractelement <2 x i32> %89, i64 1
store i32 %92, i32* %91
%93 = tail call double @sin(double %65)
%94 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 10
%95 = tail call double @cos(double %65)
%96 = insertelement <2 x double> poison, double %93, i64 0
%97 = insertelement <2 x double> %96, double %95, i64 1
%98 = insertelement <2 x double> poison, double %38, i64 0
%99 = shufflevector <2 x double> %98, <2 x double> poison, <2 x i32> zeroinitializer
%100 = fmul <2 x double> %97, %99
%101 = fptosi <2 x double> %100 to <2 x i32>
%102 = add nsw <2 x i32> %89, %101
%103 = shufflevector <2 x i32> %102, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
%104 = extractelement <2 x i32> %102, i64 0
store i32 %104, i32* %94
%105 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 11
%106 = extractelement <2 x i32> %102, i64 1
store i32 %106, i32* %105
%107 = fadd double %56, %6
%108 = tail call double @sin(double %107)
%109 = getelementptr inbounds [2000 x i32], [2000 x i32]* %17, i64 0, i64 12
%110 = tail call double @cos(double %107)
%111 = fadd double %57, %6
%112 = tail call double @sin(double %111)
%113 = tail call double @cos(double %111)
%114 = insertelement <4 x double> poison, double %25, i64 0
%115 = shufflevector <4 x double> %114, <4 x double> poison, <4 x i32> zeroinitializer
%116 = insertelement <4 x double> poison, double %108, i64 0
%117 = insertelement <4 x double> %116, double %110, i64 1
%118 = insertelement <4 x double> %117, double %112, i64 2
%119 = insertelement <4 x double> %118, double %113, i64 3
%120 = fmul <4 x double> %115, %119
%121 = fptosi <4 x double> %120 to <4 x i32>
%122 = add nsw <4 x i32> %103, %121
%123 = bitcast i32* %109 to <4 x i32>*
store <4 x i32> %122, <4 x i32>* %123
%124 = extractelement <4 x i32> %122, i64 0
%125 = shufflevector <4 x i32> %122, <4 x i32> poison, <4 x i32> <i32 2, i32 undef, i32 undef, i32 undef>
%126 = sub nsw <4 x i32> %125, %122
%127 = extractelement <4 x i32> %126, i64 0
%128 = sdiv i32 %127, 2
%129 = add nsw i32 %128, %124
%130 = sitofp i32 %129 to double
%131 = extractelement <4 x i32> %122, i64 1
%132 = extractelement <4 x i32> %122, i64 3
%133 = sub nsw i32 %132, %131
%134 = sdiv i32 %133, 2
%135 = add nsw i32 %134, %131
%136 = sitofp i32 %135 to double
%137 = call i32 @graph_scale_points(i32* %29, i32 8, double %2, double %3, double %11)
%138 = call i32 @graph_rotate_points(i32* %29, i32 8, double %2, double %3, double %12)
%139 = call i32 @graph_fill_polygon(i32* %29, i32 8, i32 139, i32 139, i32 139, i32 0, i8* %13, i32 %14, i32 %15)
%140 = call i32 @transfer_draw_finger_pivot(double %2, double %3, double %26, double %27, double 1.000000e+01, double %11, double %12, i8* %13, i32 %14, i32 %15)
%141 = call i32 @transfer_draw_finger_pivot(double %2, double %3, double %130, double %136, double 1.000000e+01, double %11, double %12, i8* %13, i32 %14, i32 %15)
ret void
}