#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*/ printf(char *, ...);
void pv_output_on_circle(int step, const char *name, float max, float buf[]) {
  int k;
  const int size = 35;
  int ka[] = {2727, 2728, 2736, 2744, 2753, 2999, 3057, 3270, 3362,
              3550, 3658, 4117, 4243, 4685, 4827, 4972, 5116, 5260,
              5404, 5548, 5692, 5835, 5981, 6419, 6549, 7002, 7118,
              7298, 7398, 7601, 7671, 7905, 7912, 7920, 7928};
  printf("%d: %s=", step, name);
  for (k = 0; k < size; k++) {
    int val = (int)(10.0 / max) * buf[ka[k]];
    if (val < 0)
      printf("-");
    else
      printf("%1d", val);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<pv_output_on_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x23,-0x28(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x8c,%edx
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xf34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x23,-0x24(%rbp)
jge    1203 <pv_output_on_circle+0xe3>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movslq -0xc0(%rbp,%rcx,4),%rcx
ff
mulss  (%rax,%rcx,4),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc4(%rbp)
cmpl   $0x0,-0xc4(%rbp)
jge    11dc <pv_output_on_circle+0xbc>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f0 <pv_output_on_circle+0xd0>
mov    -0xc4(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f5 <pv_output_on_circle+0xd5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1176 <pv_output_on_circle+0x56>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv_output_on_circle>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r12
movss  %xmm0,(%rsp)
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xf5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xea3(%rip),%r15
lea    0xf30(%rip),%r14
xor    %ebx,%ebx
jmp    1197 <pv_output_on_circle+0x77>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0x8c,%rbx
je     11ba <pv_output_on_circle+0x9a>
movslq (%rbx,%r15,1),%rax
movss  (%r12,%rax,4),%xmm0
mulss  (%rsp),%xmm0
cvttss2si %xmm0,%esi
test   %esi,%esi
jns    1180 <pv_output_on_circle+0x60>
mov    $0x2d,%edi
call   1030 <putchar@plt>
jmp    118a <pv_output_on_circle+0x6a>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__const.pv_output_on_circle.ka = [35 x i32] [i32 2727, i32 2728, i32 2736, i32 2744, i32 2753, i32 2999, i32 3057, i32 3270, i32 3362, i32 3550, i32 3658, i32 4117, i32 4243, i32 4685, i32 4827, i32 4972, i32 5116, i32 5260, i32 5404, i32 5548, i32 5692, i32 5835, i32 5981, i32 6419, i32 6549, i32 7002, i32 7118, i32 7298, i32 7398, i32 7601, i32 7671, i32 7905, i32 7912, i32 7920, i32 7928]
@.str = [8 x i8] c"%d: %s=\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [4 x i8] c"%1d\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @pv_output_on_circle(i32 %0, i8* %1, float %2, float* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca float
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [35 x i32]
%12 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store float %2, float* %7
store float* %3, float** %8
store i32 35, i32* %10
%13 = bitcast [35 x i32]* %11 to i8*
%14 = load i32, i32* %5
%15 = load i8*, i8** %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15)
store i32 0, i32* %9
br label %17
17: ; preds = %44, %4
%18 = load i32, i32* %9
%19 = icmp slt i32 %18, 35
br i1 %19, label %20, label %47
20: ; preds = %17
%21 = load float, float* %7
%22 = fpext float %21 to double
%23 = fdiv double 1.000000e+01, %22
%24 = fptosi double %23 to i32
%25 = sitofp i32 %24 to float
%26 = load float*, float** %8
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [35 x i32], [35 x i32]* %11, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %26, i64 %31
%33 = load float, float* %32
%34 = fmul float %25, %33
%35 = fptosi float %34 to i32
store i32 %35, i32* %12
%36 = load i32, i32* %12
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %20
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
40: ; preds = %20
%41 = load i32, i32* %12
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %38
br label %44
44: ; preds = %43
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
br label %17
47: ; preds = %17
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.pv_output_on_circle.ka = [35 x i32] [i32 2727, i32 2728, i32 2736, i32 2744, i32 2753, i32 2999, i32 3057, i32 3270, i32 3362, i32 3550, i32 3658, i32 4117, i32 4243, i32 4685, i32 4827, i32 4972, i32 5116, i32 5260, i32 5404, i32 5548, i32 5692, i32 5835, i32 5981, i32 6419, i32 6549, i32 7002, i32 7118, i32 7298, i32 7398, i32 7601, i32 7671, i32 7905, i32 7912, i32 7920, i32 7928]
@.str = [8 x i8] c"%d: %s=\00"
@.str.2 = [4 x i8] c"%1d\00"
define void @pv_output_on_circle(i32 %0, i8* %1, float %2, float* nocapture %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = fpext float %2 to double
%7 = fdiv double 1.000000e+01, %6
%8 = fptosi double %7 to i32
%9 = sitofp i32 %8 to float
br label %10
10: ; preds = %4, %24
%11 = phi i64 [ 0, %4 ], [ %25, %24 ]
%12 = getelementptr inbounds [35 x i32], [35 x i32]* @__const.pv_output_on_circle.ka, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %3, i64 %14
%16 = load float, float* %15
%17 = fmul float %16, %9
%18 = fptosi float %17 to i32
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = tail call i32 @putchar(i32 45)
br label %24
22: ; preds = %10
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %24
24: ; preds = %22, %20
%25 = add nuw nsw i64 %11, 1
%26 = icmp eq i64 %25, 35
br i1 %26, label %27, label %10
27: ; preds = %24
%28 = tail call i32 @putchar(i32 10)
ret void
}