#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 pow(int, double);
int /*<<< orphan*/ printf(char *, ...);
void print_cb_table(void) {
  int i;
  printf("const int32_t cb_to_level[2048] = {");
  for (i = 0; i < 2048; i++) {
    if (i % 8 == 0)
      printf("\n   ");
    printf(" %d,", (int)(0x7fffffff * pow(10, -0.005 * i)));
  }
  printf("\n};\n\n");
}


x86 assembly (clang, -O0):
<print_cb_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x800,-0x4(%rbp)
jge    11a9 <print_cb_table+0x89>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116c <print_cb_table+0x4c>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
imul   $0x7fffffff,%eax,%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <print_cb_table+0x1d>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cb_table>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xedd(%rip),%r14
lea    0xedb(%rip),%rbx
xor    %ebp,%ebp
jmp    11b8 <print_cb_table+0x88>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x8(%rsp),%xmm0
mulsd  0xe82(%rip),%xmm0
mov    $0xa,%edi
call   1050 <pow@plt>
mov    %eax,%esi
shl    $0x1f,%esi
sub    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe61(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x1,%ebp
cmp    $0x800,%ebp
je     11ca <print_cb_table+0x9a>
test   $0x7,%bpl
jne    1170 <print_cb_table+0x40>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <print_cb_table+0x40>
lea    0xe6d(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"const int32_t cb_to_level[2048] = {\00"
@.str.1 = [5 x i8] c"\0A \00"
@.str.2 = [5 x i8] c" %d,\00"
@.str.3 = [6 x i8] c"\0A};\0A\0A\00"
define void @print_cb_table() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2048
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = load i32, i32* %1
%8 = srem i32 %7, 8
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* %1
%14 = sitofp i32 %13 to double
%15 = fmul double -5.000000e-03, %14
%16 = call i32 @pow(i32 10, double %15)
%17 = mul nsw i32 2147483647, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %3
22: ; preds = %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"const int32_t cb_to_level[2048] = {\00"
@.str.1 = [5 x i8] c"\0A \00"
@.str.2 = [5 x i8] c" %d,\00"
@str = [5 x i8] c"\0A};\0A\00"
define void @print_cb_table() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %8
%3 = phi i32 [ 0, %0 ], [ %14, %8 ]
%4 = and i32 %3, 7
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = sitofp i32 %3 to double
%10 = fmul double %9, -5.000000e-03
%11 = tail call i32 @pow(i32 10, double %10)
%12 = mul nsw i32 %11, 2147483647
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i32 %3, 1
%15 = icmp eq i32 %14, 2048
br i1 %15, label %16, label %2
16: ; preds = %8
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}