#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 */
typedef int /*<<< orphan*/ uint16_t;
typedef float int8_t;

/* Variables and functions */
int /*<<< orphan*/ set_led_8_8_12(float, float, float, int);
void circle_shape(int8_t xi, int8_t yi, int8_t zi, float rsq_min, float rsq_max,
                  uint16_t intensity) {
  xi -= 8 / 2;
  yi -= 8 / 2;
  for (int8_t x = xi; x < 8 + xi; x++) {
    for (int8_t y = yi; y < 8 + yi; y++) {
      float sq = x * x + y * y;
      if (rsq_min < sq && sq < rsq_max) {
        set_led_8_8_12(x - xi, y - yi, zi, ((1 << 12) - 1));
      }
    }
  }
}


x86 assembly (clang, -O0):
<circle_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
mov    %edi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xebf(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xea9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  0xe8d(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    124c <circle_shape+0x13c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  0xe68(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1230 <circle_shape+0x120>
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x24(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1214 <circle_shape+0x104>
movss  -0x24(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1214 <circle_shape+0x104>
movss  -0x1c(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mov    $0xfff,%edi
call   1030 <set_led_8_8_12@plt>
jmp    1219 <circle_shape+0x109>
movss  0xde7(%rip),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    118f <circle_shape+0x7f>
jmp    1235 <circle_shape+0x125>
movss  0xdcb(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    116a <circle_shape+0x5a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_shape>:
sub    $0x28,%rsp
movss  %xmm4,0x20(%rsp)
movss  %xmm2,0x14(%rsp)
movss  0xed8(%rip),%xmm2
addss  %xmm2,%xmm0
movss  0xed0(%rip),%xmm4
addss  %xmm0,%xmm4
movss  %xmm0,0x4(%rsp)
movss  %xmm4,0x8(%rsp)
ucomiss %xmm0,%xmm4
jbe    1231 <circle_shape+0x121>
addss  %xmm2,%xmm1
movss  0xeab(%rip),%xmm2
movss  %xmm1,(%rsp)
addss  %xmm1,%xmm2
movss  0xe9e(%rip),%xmm4
movss  0x4(%rsp),%xmm5
movss  %xmm3,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
jmp    1193 <circle_shape+0x83>
xchg   %ax,%ax
addss  %xmm4,%xmm5
movss  0x8(%rsp),%xmm0
ucomiss %xmm5,%xmm0
jbe    1231 <circle_shape+0x121>
ucomiss (%rsp),%xmm2
jbe    1180 <circle_shape+0x70>
movaps %xmm5,%xmm0
subss  0x4(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  (%rsp),%xmm6
movss  %xmm5,0x1c(%rsp)
jmp    11c9 <circle_shape+0xb9>
cs nopw 0x0(%rax,%rax,1)
nop
addss  %xmm4,%xmm6
ucomiss %xmm6,%xmm2
jbe    1180 <circle_shape+0x70>
movaps %xmm6,%xmm1
mulss  %xmm6,%xmm1
movaps %xmm5,%xmm0
mulss  %xmm5,%xmm0
addss  %xmm1,%xmm0
ucomiss %xmm3,%xmm0
jbe    11c0 <circle_shape+0xb0>
movss  0x20(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c0 <circle_shape+0xb0>
movaps %xmm6,%xmm1
subss  (%rsp),%xmm1
movss  0x18(%rsp),%xmm0
movss  0x14(%rsp),%xmm2
mov    $0xfff,%edi
movss  %xmm6,0x24(%rsp)
call   1030 <set_led_8_8_12@plt>
movss  0x24(%rsp),%xmm6
movss  0x1c(%rsp),%xmm5
movss  0xde5(%rip),%xmm4
movss  0xc(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
jmp    11c0 <circle_shape+0xb0>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @circle_shape(float %0, float %1, float %2, float %3, float %4, i32 %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store i32 %5, i32* %12
%16 = load float, float* %7
%17 = fsub float %16, 4.000000e+00
store float %17, float* %7
%18 = load float, float* %8
%19 = fsub float %18, 4.000000e+00
store float %19, float* %8
%20 = load float, float* %7
store float %20, float* %13
br label %21
21: ; preds = %61, %6
%22 = load float, float* %13
%23 = load float, float* %7
%24 = fadd float 8.000000e+00, %23
%25 = fcmp olt float %22, %24
br i1 %25, label %26, label %64
26: ; preds = %21
%27 = load float, float* %8
store float %27, float* %14
br label %28
28: ; preds = %57, %26
%29 = load float, float* %14
%30 = load float, float* %8
%31 = fadd float 8.000000e+00, %30
%32 = fcmp olt float %29, %31
br i1 %32, label %33, label %60
33: ; preds = %28
%34 = load float, float* %13
%35 = load float, float* %13
%36 = load float, float* %14
%37 = load float, float* %14
%38 = fmul float %36, %37
%39 = call float @llvm.fmuladd.f32(float %34, float %35, float %38)
store float %39, float* %15
%40 = load float, float* %10
%41 = load float, float* %15
%42 = fcmp olt float %40, %41
br i1 %42, label %43, label %56
43: ; preds = %33
%44 = load float, float* %15
%45 = load float, float* %11
%46 = fcmp olt float %44, %45
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = load float, float* %13
%49 = load float, float* %7
%50 = fsub float %48, %49
%51 = load float, float* %14
%52 = load float, float* %8
%53 = fsub float %51, %52
%54 = load float, float* %9
%55 = call i32 @set_led_8_8_12(float %50, float %53, float %54, i32 4095)
br label %56
56: ; preds = %47, %43, %33
br label %57
57: ; preds = %56
%58 = load float, float* %14
%59 = fadd float %58, 1.000000e+00
store float %59, float* %14
br label %28
60: ; preds = %28
br label %61
61: ; preds = %60
%62 = load float, float* %13
%63 = fadd float %62, 1.000000e+00
store float %63, float* %13
br label %21
64: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @circle_shape(float %0, float %1, float %2, float %3, float %4, i32 %5) {
%7 = fadd float %0, -4.000000e+00
%8 = fadd float %1, -4.000000e+00
%9 = fadd float %7, 8.000000e+00
%10 = fcmp olt float %7, %9
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = fadd float %8, 8.000000e+00
%13 = fcmp olt float %8, %12
br label %14
14: ; preds = %11, %19
%15 = phi float [ %7, %11 ], [ %20, %19 ]
br i1 %13, label %16, label %19
16: ; preds = %14
%17 = fsub float %15, %7
br label %22
18: ; preds = %19, %6
ret void
19: ; preds = %32, %14
%20 = fadd float %15, 1.000000e+00
%21 = fcmp olt float %20, %9
br i1 %21, label %14, label %18
22: ; preds = %16, %32
%23 = phi float [ %8, %16 ], [ %33, %32 ]
%24 = fmul float %23, %23
%25 = tail call float @llvm.fmuladd.f32(float %15, float %15, float %24)
%26 = fcmp ogt float %25, %3
%27 = fcmp olt float %25, %4
%28 = and i1 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = fsub float %23, %8
%31 = tail call i32 @set_led_8_8_12(float %17, float %30, float %2, i32 4095)
br label %32
32: ; preds = %29, %22
%33 = fadd float %23, 1.000000e+00
%34 = fcmp olt float %33, %12
br i1 %34, label %22, label %19
}