#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*/ draw_circle(char *, int, int, int, int, int, char);
void draw_bullseye(char *pixelbuf, int image_width, int image_height,
                   int xoffset, int yoffset, int scaler) {
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(4.571 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(3.779 * scaler) + 1, '0');
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(2.988 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(2.196 * scaler) + 1, '0');
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(1.394 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height,
              (int)(14.5 * scaler) + xoffset, (int)(15 * scaler) + yoffset,
              (int)(0.602 * scaler) + 1, '0');
}


x86 assembly (clang, -O0):
<draw_bullseye>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xec4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xecb(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
call   1030 <draw_circle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe73(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe72(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
call   1030 <draw_circle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe22(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe19(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
call   1030 <draw_circle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xdd1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xdc0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
call   1030 <draw_circle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xd80(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xd67(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
call   1030 <draw_circle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xd2f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    -0x14(%rbp),%ecx
imul   $0xf,-0x1c(%rbp),%r8d
add    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xd06(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
call   1030 <draw_circle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_bullseye>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
cvtsi2sd %r9d,%xmm1
movsd  0xec9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
cvttsd2si %xmm0,%eax
add    %eax,%ebp
lea    (%r9,%r9,4),%eax
lea    (%rax,%rax,2),%eax
add    %eax,%ebx
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
movsd  0xe92(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
movsd  0xe69(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
movsd  0xe40(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
movsd  0xe17(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xde8(%rip),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <draw_circle@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_bullseye(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %12
%17 = sitofp i32 %16 to double
%18 = fmul double 1.450000e+01, %17
%19 = fptosi double %18 to i32
%20 = load i32, i32* %10
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %12
%23 = mul nsw i32 15, %22
%24 = load i32, i32* %11
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %12
%27 = sitofp i32 %26 to double
%28 = fmul double 4.571000e+00, %27
%29 = fptosi double %28 to i32
%30 = add nsw i32 %29, 1
%31 = call i32 @draw_circle(i8* %13, i32 %14, i32 %15, i32 %21, i32 %25, i32 %30, i8 signext 49)
%32 = load i8*, i8** %7
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = load i32, i32* %12
%36 = sitofp i32 %35 to double
%37 = fmul double 1.450000e+01, %36
%38 = fptosi double %37 to i32
%39 = load i32, i32* %10
%40 = add nsw i32 %38, %39
%41 = load i32, i32* %12
%42 = mul nsw i32 15, %41
%43 = load i32, i32* %11
%44 = add nsw i32 %42, %43
%45 = load i32, i32* %12
%46 = sitofp i32 %45 to double
%47 = fmul double 3.779000e+00, %46
%48 = fptosi double %47 to i32
%49 = add nsw i32 %48, 1
%50 = call i32 @draw_circle(i8* %32, i32 %33, i32 %34, i32 %40, i32 %44, i32 %49, i8 signext 48)
%51 = load i8*, i8** %7
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = load i32, i32* %12
%55 = sitofp i32 %54 to double
%56 = fmul double 1.450000e+01, %55
%57 = fptosi double %56 to i32
%58 = load i32, i32* %10
%59 = add nsw i32 %57, %58
%60 = load i32, i32* %12
%61 = mul nsw i32 15, %60
%62 = load i32, i32* %11
%63 = add nsw i32 %61, %62
%64 = load i32, i32* %12
%65 = sitofp i32 %64 to double
%66 = fmul double 2.988000e+00, %65
%67 = fptosi double %66 to i32
%68 = add nsw i32 %67, 1
%69 = call i32 @draw_circle(i8* %51, i32 %52, i32 %53, i32 %59, i32 %63, i32 %68, i8 signext 49)
%70 = load i8*, i8** %7
%71 = load i32, i32* %8
%72 = load i32, i32* %9
%73 = load i32, i32* %12
%74 = sitofp i32 %73 to double
%75 = fmul double 1.450000e+01, %74
%76 = fptosi double %75 to i32
%77 = load i32, i32* %10
%78 = add nsw i32 %76, %77
%79 = load i32, i32* %12
%80 = mul nsw i32 15, %79
%81 = load i32, i32* %11
%82 = add nsw i32 %80, %81
%83 = load i32, i32* %12
%84 = sitofp i32 %83 to double
%85 = fmul double 2.196000e+00, %84
%86 = fptosi double %85 to i32
%87 = add nsw i32 %86, 1
%88 = call i32 @draw_circle(i8* %70, i32 %71, i32 %72, i32 %78, i32 %82, i32 %87, i8 signext 48)
%89 = load i8*, i8** %7
%90 = load i32, i32* %8
%91 = load i32, i32* %9
%92 = load i32, i32* %12
%93 = sitofp i32 %92 to double
%94 = fmul double 1.450000e+01, %93
%95 = fptosi double %94 to i32
%96 = load i32, i32* %10
%97 = add nsw i32 %95, %96
%98 = load i32, i32* %12
%99 = mul nsw i32 15, %98
%100 = load i32, i32* %11
%101 = add nsw i32 %99, %100
%102 = load i32, i32* %12
%103 = sitofp i32 %102 to double
%104 = fmul double 1.394000e+00, %103
%105 = fptosi double %104 to i32
%106 = add nsw i32 %105, 1
%107 = call i32 @draw_circle(i8* %89, i32 %90, i32 %91, i32 %97, i32 %101, i32 %106, i8 signext 49)
%108 = load i8*, i8** %7
%109 = load i32, i32* %8
%110 = load i32, i32* %9
%111 = load i32, i32* %12
%112 = sitofp i32 %111 to double
%113 = fmul double 1.450000e+01, %112
%114 = fptosi double %113 to i32
%115 = load i32, i32* %10
%116 = add nsw i32 %114, %115
%117 = load i32, i32* %12
%118 = mul nsw i32 15, %117
%119 = load i32, i32* %11
%120 = add nsw i32 %118, %119
%121 = load i32, i32* %12
%122 = sitofp i32 %121 to double
%123 = fmul double 6.020000e-01, %122
%124 = fptosi double %123 to i32
%125 = add nsw i32 %124, 1
%126 = call i32 @draw_circle(i8* %108, i32 %109, i32 %110, i32 %116, i32 %120, i32 %125, i8 signext 48)
ret void
}

LLVM IR (-O2):
define void @draw_bullseye(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sitofp i32 %5 to double
%8 = fmul double %7, 1.450000e+01
%9 = fptosi double %8 to i32
%10 = add nsw i32 %9, %3
%11 = mul nsw i32 %5, 15
%12 = add nsw i32 %11, %4
%13 = fmul double %7, 4.571000e+00
%14 = fptosi double %13 to i32
%15 = add nsw i32 %14, 1
%16 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %15, i8 signext 49)
%17 = fmul double %7, 3.779000e+00
%18 = fptosi double %17 to i32
%19 = add nsw i32 %18, 1
%20 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %19, i8 signext 48)
%21 = fmul double %7, 2.988000e+00
%22 = fptosi double %21 to i32
%23 = add nsw i32 %22, 1
%24 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %23, i8 signext 49)
%25 = fmul double %7, 2.196000e+00
%26 = fptosi double %25 to i32
%27 = add nsw i32 %26, 1
%28 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %27, i8 signext 48)
%29 = fmul double %7, 1.394000e+00
%30 = fptosi double %29 to i32
%31 = add nsw i32 %30, 1
%32 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %31, i8 signext 49)
%33 = fmul double %7, 6.020000e-01
%34 = fptosi double %33 to i32
%35 = add nsw i32 %34, 1
%36 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %35, i8 signext 48)
ret void
}