#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 cx,
                   int cy, int scaler) {
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (int)(4.571 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (int)(3.779 * scaler) + 1, '0');
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (int)(2.988 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (int)(2.196 * scaler) + 1, '0');
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (int)(1.394 * scaler) + 1, '1');
  draw_circle(pixelbuf, image_width, image_height, cx, cy,
              (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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xedd(%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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe9e(%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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe5f(%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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe20(%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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xde1(%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
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xda2(%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,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
cvtsi2sd %r9d,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
call   1030 <draw_circle@plt>
movsd  0xeaa(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_circle@plt>
movsd  0xe81(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_circle@plt>
movsd  0xe58(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_circle@plt>
movsd  0xe2f(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x31,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_circle@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xe00(%rip),%xmm0
cvttsd2si %xmm0,%r9d
add    $0x1,%r9d
movl   $0x30,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%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* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = sitofp i32 %18 to double
%20 = fmul double 4.571000e+00, %19
%21 = fptosi double %20 to i32
%22 = add nsw i32 %21, 1
%23 = call i32 @draw_circle(i8* %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %22, i8 signext 49)
%24 = load i8*, i8** %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = load i32, i32* %12
%30 = sitofp i32 %29 to double
%31 = fmul double 3.779000e+00, %30
%32 = fptosi double %31 to i32
%33 = add nsw i32 %32, 1
%34 = call i32 @draw_circle(i8* %24, i32 %25, i32 %26, i32 %27, i32 %28, i32 %33, i8 signext 48)
%35 = load i8*, i8** %7
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = load i32, i32* %10
%39 = load i32, i32* %11
%40 = load i32, i32* %12
%41 = sitofp i32 %40 to double
%42 = fmul double 2.988000e+00, %41
%43 = fptosi double %42 to i32
%44 = add nsw i32 %43, 1
%45 = call i32 @draw_circle(i8* %35, i32 %36, i32 %37, i32 %38, i32 %39, i32 %44, i8 signext 49)
%46 = load i8*, i8** %7
%47 = load i32, i32* %8
%48 = load i32, i32* %9
%49 = load i32, i32* %10
%50 = load i32, i32* %11
%51 = load i32, i32* %12
%52 = sitofp i32 %51 to double
%53 = fmul double 2.196000e+00, %52
%54 = fptosi double %53 to i32
%55 = add nsw i32 %54, 1
%56 = call i32 @draw_circle(i8* %46, i32 %47, i32 %48, i32 %49, i32 %50, i32 %55, i8 signext 48)
%57 = load i8*, i8** %7
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = load i32, i32* %10
%61 = load i32, i32* %11
%62 = load i32, i32* %12
%63 = sitofp i32 %62 to double
%64 = fmul double 1.394000e+00, %63
%65 = fptosi double %64 to i32
%66 = add nsw i32 %65, 1
%67 = call i32 @draw_circle(i8* %57, i32 %58, i32 %59, i32 %60, i32 %61, i32 %66, i8 signext 49)
%68 = load i8*, i8** %7
%69 = load i32, i32* %8
%70 = load i32, i32* %9
%71 = load i32, i32* %10
%72 = load i32, i32* %11
%73 = load i32, i32* %12
%74 = sitofp i32 %73 to double
%75 = fmul double 6.020000e-01, %74
%76 = fptosi double %75 to i32
%77 = add nsw i32 %76, 1
%78 = call i32 @draw_circle(i8* %68, i32 %69, i32 %70, i32 %71, i32 %72, i32 %77, 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, 4.571000e+00
%9 = fptosi double %8 to i32
%10 = add nsw i32 %9, 1
%11 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %10, i8 signext 49)
%12 = fmul double %7, 3.779000e+00
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, 1
%15 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %14, i8 signext 48)
%16 = fmul double %7, 2.988000e+00
%17 = fptosi double %16 to i32
%18 = add nsw i32 %17, 1
%19 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %18, i8 signext 49)
%20 = fmul double %7, 2.196000e+00
%21 = fptosi double %20 to i32
%22 = add nsw i32 %21, 1
%23 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %22, i8 signext 48)
%24 = fmul double %7, 1.394000e+00
%25 = fptosi double %24 to i32
%26 = add nsw i32 %25, 1
%27 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %26, i8 signext 49)
%28 = fmul double %7, 6.020000e-01
%29 = fptosi double %28 to i32
%30 = add nsw i32 %29, 1
%31 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %30, i8 signext 48)
ret void
}