#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 M_PI;
int /*<<< orphan*/ assert(int);
int ddd(int);
int /*<<< orphan*/ printf(char *, ...);
double sin(int);
void print_sintable(const char *name, double scale) {
  double omega = M_PI / 16384;
  int used = 0;
  printf("constant %s : sinrom_t := (\n", name);
  for (int i = 0; i != 1024; ++i) {
    if (i & 3)
      printf(", ");
    else if (i)
      printf(",\n    ");
    else
      printf("    ");
    double c0 = sin((i * 8 + 1) * omega) * scale;
    double c1 = sin((i * 8 + 3) * omega) * scale;
    double c2 = sin((i * 8 + 5) * omega) * scale;
    double c3 = sin((i * 8 + 7) * omega) * scale;
    int v0 = c0 + 0.5;
    int v1 = c1 + 0.5;
    int v2 = c2 + 0.5;
    int v3 = c3 + 0.5;
    assert(c0 - v0 <= 0.5);
    assert(c1 - v1 <= 0.5);
    assert(c2 - v2 <= 0.5);
    assert(c3 - v3 <= 0.5);
    assert(v0 - c0 <= 0.5);
    assert(v1 - c1 <= 0.5);
    assert(v2 - c2 <= 0.5);
    assert(v3 - c3 <= 0.5);
    assert(v0 >= 0);
    assert(v3 < 16384);
    int delta1 = v1 - v0;
    int delta2 = v2 - v1;
    int delta3 = v3 - v2;
    assert(delta1 >= 0);
    assert(delta2 >= 0);
    assert(delta3 >= 0);
    assert(delta1 <= 2);
    assert(delta2 <= 2);
    assert(delta3 <= 2);
    int index = ddd(delta3 * 0100 + delta2 * 0010 + delta1);
    used |= 1 << index;
    printf("\"%i%i\"&x\"%04x\"", (index & 8) != 0, (index & 4) != 0,
           (index & 3) * 16384 + v0);
  }
  printf(");\n");
  printf("    -- Used bitmask: %0x\n", used);
}


x86 assembly (clang, -O0):
<print_sintable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    $0x4000,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x400,-0x20(%rbp)
je     150f <print_sintable+0x3cf>
mov    -0x20(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     11ba <print_sintable+0x7a>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ea <print_sintable+0xaa>
cmpl   $0x0,-0x20(%rbp)
je     11d7 <print_sintable+0x97>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e5 <print_sintable+0xa5>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ea <print_sintable+0xaa>
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
add    $0x3,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
add    $0x5,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
add    $0x7,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd7a(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x44(%rbp)
movsd  0xd66(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x48(%rbp)
movsd  0xd52(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4c(%rbp)
movsd  0xd3e(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xd1c(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x30(%rbp),%xmm1
cvtsi2sdl -0x48(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xcf5(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x38(%rbp),%xmm1
cvtsi2sdl -0x4c(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xcce(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdl -0x50(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xca7(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cvtsi2sdl -0x44(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xc84(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cvtsi2sdl -0x48(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  0xc61(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cvtsi2sdl -0x4c(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
movsd  0xc3e(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cvtsi2sdl -0x50(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xc1b(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x0,-0x44(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x4000,-0x50(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x48(%rbp),%eax
sub    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x4c(%rbp),%eax
sub    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x50(%rbp),%eax
sub    -0x4c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x54(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x0,-0x58(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x0,-0x5c(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x54(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x58(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2,-0x5c(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x5c(%rbp),%edi
shl    $0x6,%edi
mov    -0x58(%rbp),%eax
shl    $0x3,%eax
add    %eax,%edi
add    -0x54(%rbp),%edi
call   1030 <ddd@plt>
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x60(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x60(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edx
mov    -0x60(%rbp),%ecx
and    $0x3,%ecx
shl    $0xe,%ecx
add    -0x44(%rbp),%ecx
lea    0xb35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118b <print_sintable+0x4b>
lea    0xb28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xb1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sintable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
lea    0x3fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
movaps %xmm0,0x30(%rsp)
mov    %rdi,%rsi
sar    $0xe,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movdqa 0x30(%rsp),%xmm0
punpcklqdq %xmm0,%xmm0
movdqa %xmm0,0x30(%rsp)
mov    $0x7,%r13d
xor    %ebx,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
test   %r15d,%r15d
lea    0xe6e(%rip),%rdi
lea    0xe69(%rip),%rax
cmove  %rax,%rdi
test   $0x3,%r15b
lea    0xe55(%rip),%rax
cmovne %rax,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x6(%r13),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sin@plt>
lea    -0x4(%r13),%eax
cvtsi2sd %eax,%xmm1
movapd %xmm0,0x10(%rsp)
mulsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <sin@plt>
unpcklpd 0x10(%rsp),%xmm0
lea    -0x2(%r13),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulpd  0x30(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
mulsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <sin@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movapd %xmm0,0x10(%rsp)
mulsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <sin@plt>
unpcklpd 0x10(%rsp),%xmm0
mulpd  0x30(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
movapd 0x50(%rsp),%xmm4
movapd %xmm4,%xmm2
movapd 0xd71(%rip),%xmm1
addpd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
movapd %xmm2,0x90(%rsp)
movapd %xmm0,%xmm3
addpd  %xmm1,%xmm3
cvttpd2dq %xmm3,%xmm0
movapd %xmm0,0x40(%rsp)
pshufd $0x55,%xmm2,%xmm0
movd   %xmm0,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x88(%rsp)
mov    %eax,%ebp
mov    %eax,0x2c(%rsp)
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm0,0xb0(%rsp)
subsd  %xmm1,%xmm0
xor    %edi,%edi
movsd  0xd20(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
call   1060 <assert@plt>
movdqa 0x90(%rsp),%xmm0
movd   %xmm0,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x80(%rsp)
movapd 0x50(%rsp),%xmm0
subsd  %xmm1,%xmm0
xor    %edi,%edi
movsd  0xce2(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
call   1060 <assert@plt>
pshufd $0x55,0x40(%rsp),%xmm0
movdqa %xmm0,0x60(%rsp)
movd   %xmm0,%r14d
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
movsd  %xmm1,0x78(%rsp)
movapd 0x10(%rsp),%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm0,0xa0(%rsp)
subsd  %xmm1,%xmm0
xor    %edi,%edi
movsd  0xc94(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
call   1060 <assert@plt>
movdqa 0x40(%rsp),%xmm0
movd   %xmm0,%r12d
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
movsd  %xmm1,0x40(%rsp)
movapd 0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
xor    %edi,%edi
movsd  0xc5a(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
call   1060 <assert@plt>
movsd  0x88(%rsp),%xmm1
subsd  0xb0(%rsp),%xmm1
xor    %edi,%edi
movsd  0xc31(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %dil
call   1060 <assert@plt>
movsd  0x80(%rsp),%xmm1
subsd  0x50(%rsp),%xmm1
xor    %edi,%edi
movsd  0xc0b(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %dil
call   1060 <assert@plt>
movsd  0x78(%rsp),%xmm1
subsd  0xa0(%rsp),%xmm1
xor    %edi,%edi
movsd  0xbe5(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %dil
call   1060 <assert@plt>
movsd  0x40(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
xor    %edi,%edi
movsd  0xbc2(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %dil
call   1060 <assert@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
xor    %edi,%edi
cmp    $0x4000,%r12d
setl   %dil
call   1060 <assert@plt>
movdqa 0x90(%rsp),%xmm0
movdqa 0x60(%rsp),%xmm1
punpckldq %xmm0,%xmm1
psubd  %xmm0,%xmm1
movdqa %xmm1,0x60(%rsp)
sub    %r14d,%r12d
pshufd $0x55,%xmm1,%xmm0
movd   %xmm0,%ebp
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
mov    %ebx,%r14d
movdqa 0x60(%rsp),%xmm0
movd   %xmm0,%ebx
mov    %ebx,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
mov    %r12d,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%ebp
setl   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setl   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%r12d
setl   %dil
call   1060 <assert@plt>
shl    $0x6,%r12d
lea    0x0(%rbp,%rbx,8),%edi
mov    %r14d,%ebx
add    %r12d,%edi
call   1030 <ddd@plt>
bts    %eax,%ebx
mov    %eax,%esi
shr    $0x3,%esi
and    $0x1,%esi
mov    %eax,%edx
shr    $0x2,%edx
and    $0x1,%edx
shl    $0xe,%eax
movzwl %ax,%ecx
add    0x2c(%rsp),%ecx
lea    0xb09(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
add    $0x8,%r13d
cmp    $0x400,%r15d
jne    11c0 <print_sintable+0x70>
lea    0xb0f(%rip),%rdi
call   1040 <puts@plt>
lea    0xae9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [29 x i8] c"constant %s : sinrom_t := (\0A\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [7 x i8] c",\0A \00"
@.str.3 = [5 x i8] c" \00"
@.str.4 = [15 x i8] c"\22%i%i\22&x\22%04x\22\00"
@.str.5 = [4 x i8] c");\0A\00"
@.str.6 = [26 x i8] c" -- Used bitmask: %0x\0A\00"
define void @print_sintable(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i8* %0, i8** %3
store double %1, double* %4
%20 = load i32, i32* @M_PI
%21 = sdiv i32 %20, 16384
%22 = sitofp i32 %21 to double
store double %22, double* %5
store i32 0, i32* %6
%23 = load i8*, i8** %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %23)
store i32 0, i32* %7
br label %25
25: ; preds = %218, %2
%26 = load i32, i32* %7
%27 = icmp ne i32 %26, 1024
br i1 %27, label %28, label %221
28: ; preds = %25
%29 = load i32, i32* %7
%30 = and i32 %29, 3
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %42
34: ; preds = %28
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %41
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
br label %42
42: ; preds = %41, %32
%43 = load i32, i32* %7
%44 = mul nsw i32 %43, 8
%45 = add nsw i32 %44, 1
%46 = sitofp i32 %45 to double
%47 = load double, double* %5
%48 = fmul double %46, %47
%49 = fptosi double %48 to i32
%50 = call double @sin(i32 %49)
%51 = load double, double* %4
%52 = fmul double %50, %51
store double %52, double* %8
%53 = load i32, i32* %7
%54 = mul nsw i32 %53, 8
%55 = add nsw i32 %54, 3
%56 = sitofp i32 %55 to double
%57 = load double, double* %5
%58 = fmul double %56, %57
%59 = fptosi double %58 to i32
%60 = call double @sin(i32 %59)
%61 = load double, double* %4
%62 = fmul double %60, %61
store double %62, double* %9
%63 = load i32, i32* %7
%64 = mul nsw i32 %63, 8
%65 = add nsw i32 %64, 5
%66 = sitofp i32 %65 to double
%67 = load double, double* %5
%68 = fmul double %66, %67
%69 = fptosi double %68 to i32
%70 = call double @sin(i32 %69)
%71 = load double, double* %4
%72 = fmul double %70, %71
store double %72, double* %10
%73 = load i32, i32* %7
%74 = mul nsw i32 %73, 8
%75 = add nsw i32 %74, 7
%76 = sitofp i32 %75 to double
%77 = load double, double* %5
%78 = fmul double %76, %77
%79 = fptosi double %78 to i32
%80 = call double @sin(i32 %79)
%81 = load double, double* %4
%82 = fmul double %80, %81
store double %82, double* %11
%83 = load double, double* %8
%84 = fadd double %83, 5.000000e-01
%85 = fptosi double %84 to i32
store i32 %85, i32* %12
%86 = load double, double* %9
%87 = fadd double %86, 5.000000e-01
%88 = fptosi double %87 to i32
store i32 %88, i32* %13
%89 = load double, double* %10
%90 = fadd double %89, 5.000000e-01
%91 = fptosi double %90 to i32
store i32 %91, i32* %14
%92 = load double, double* %11
%93 = fadd double %92, 5.000000e-01
%94 = fptosi double %93 to i32
store i32 %94, i32* %15
%95 = load double, double* %8
%96 = load i32, i32* %12
%97 = sitofp i32 %96 to double
%98 = fsub double %95, %97
%99 = fcmp ole double %98, 5.000000e-01
%100 = zext i1 %99 to i32
%101 = call i32 @assert(i32 %100)
%102 = load double, double* %9
%103 = load i32, i32* %13
%104 = sitofp i32 %103 to double
%105 = fsub double %102, %104
%106 = fcmp ole double %105, 5.000000e-01
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
%109 = load double, double* %10
%110 = load i32, i32* %14
%111 = sitofp i32 %110 to double
%112 = fsub double %109, %111
%113 = fcmp ole double %112, 5.000000e-01
%114 = zext i1 %113 to i32
%115 = call i32 @assert(i32 %114)
%116 = load double, double* %11
%117 = load i32, i32* %15
%118 = sitofp i32 %117 to double
%119 = fsub double %116, %118
%120 = fcmp ole double %119, 5.000000e-01
%121 = zext i1 %120 to i32
%122 = call i32 @assert(i32 %121)
%123 = load i32, i32* %12
%124 = sitofp i32 %123 to double
%125 = load double, double* %8
%126 = fsub double %124, %125
%127 = fcmp ole double %126, 5.000000e-01
%128 = zext i1 %127 to i32
%129 = call i32 @assert(i32 %128)
%130 = load i32, i32* %13
%131 = sitofp i32 %130 to double
%132 = load double, double* %9
%133 = fsub double %131, %132
%134 = fcmp ole double %133, 5.000000e-01
%135 = zext i1 %134 to i32
%136 = call i32 @assert(i32 %135)
%137 = load i32, i32* %14
%138 = sitofp i32 %137 to double
%139 = load double, double* %10
%140 = fsub double %138, %139
%141 = fcmp ole double %140, 5.000000e-01
%142 = zext i1 %141 to i32
%143 = call i32 @assert(i32 %142)
%144 = load i32, i32* %15
%145 = sitofp i32 %144 to double
%146 = load double, double* %11
%147 = fsub double %145, %146
%148 = fcmp ole double %147, 5.000000e-01
%149 = zext i1 %148 to i32
%150 = call i32 @assert(i32 %149)
%151 = load i32, i32* %12
%152 = icmp sge i32 %151, 0
%153 = zext i1 %152 to i32
%154 = call i32 @assert(i32 %153)
%155 = load i32, i32* %15
%156 = icmp slt i32 %155, 16384
%157 = zext i1 %156 to i32
%158 = call i32 @assert(i32 %157)
%159 = load i32, i32* %13
%160 = load i32, i32* %12
%161 = sub nsw i32 %159, %160
store i32 %161, i32* %16
%162 = load i32, i32* %14
%163 = load i32, i32* %13
%164 = sub nsw i32 %162, %163
store i32 %164, i32* %17
%165 = load i32, i32* %15
%166 = load i32, i32* %14
%167 = sub nsw i32 %165, %166
store i32 %167, i32* %18
%168 = load i32, i32* %16
%169 = icmp sge i32 %168, 0
%170 = zext i1 %169 to i32
%171 = call i32 @assert(i32 %170)
%172 = load i32, i32* %17
%173 = icmp sge i32 %172, 0
%174 = zext i1 %173 to i32
%175 = call i32 @assert(i32 %174)
%176 = load i32, i32* %18
%177 = icmp sge i32 %176, 0
%178 = zext i1 %177 to i32
%179 = call i32 @assert(i32 %178)
%180 = load i32, i32* %16
%181 = icmp sle i32 %180, 2
%182 = zext i1 %181 to i32
%183 = call i32 @assert(i32 %182)
%184 = load i32, i32* %17
%185 = icmp sle i32 %184, 2
%186 = zext i1 %185 to i32
%187 = call i32 @assert(i32 %186)
%188 = load i32, i32* %18
%189 = icmp sle i32 %188, 2
%190 = zext i1 %189 to i32
%191 = call i32 @assert(i32 %190)
%192 = load i32, i32* %18
%193 = mul nsw i32 %192, 64
%194 = load i32, i32* %17
%195 = mul nsw i32 %194, 8
%196 = add nsw i32 %193, %195
%197 = load i32, i32* %16
%198 = add nsw i32 %196, %197
%199 = call i32 @ddd(i32 %198)
store i32 %199, i32* %19
%200 = load i32, i32* %19
%201 = shl i32 1, %200
%202 = load i32, i32* %6
%203 = or i32 %202, %201
store i32 %203, i32* %6
%204 = load i32, i32* %19
%205 = and i32 %204, 8
%206 = icmp ne i32 %205, 0
%207 = zext i1 %206 to i32
%208 = load i32, i32* %19
%209 = and i32 %208, 4
%210 = icmp ne i32 %209, 0
%211 = zext i1 %210 to i32
%212 = load i32, i32* %19
%213 = and i32 %212, 3
%214 = mul nsw i32 %213, 16384
%215 = load i32, i32* %12
%216 = add nsw i32 %214, %215
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %207, i32 %211, i32 %216)
br label %218
218: ; preds = %42
%219 = load i32, i32* %7
%220 = add nsw i32 %219, 1
store i32 %220, i32* %7
br label %25
221: ; preds = %25
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%223 = load i32, i32* %6
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %223)
ret void
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [29 x i8] c"constant %s : sinrom_t := (\0A\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [7 x i8] c",\0A \00"
@.str.3 = [5 x i8] c" \00"
@.str.4 = [15 x i8] c"\22%i%i\22&x\22%04x\22\00"
@.str.6 = [26 x i8] c" -- Used bitmask: %0x\0A\00"
@str = [3 x i8] c");\00"
define void @print_sintable(i8* %0, double %1) {
%3 = load i32, i32* @M_PI
%4 = sdiv i32 %3, 16384
%5 = sitofp i32 %4 to double
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = insertelement <2 x double> poison, double %1, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = insertelement <2 x double> poison, double %1, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
br label %14
11: ; preds = %14
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %133)
ret void
14: ; preds = %2, %14
%15 = phi i32 [ 0, %2 ], [ %133, %14 ]
%16 = phi i32 [ 0, %2 ], [ %142, %14 ]
%17 = and i32 %16, 3
%18 = icmp eq i32 %17, 0
%19 = icmp eq i32 %16, 0
%20 = select i1 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%21 = select i1 %18, i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %21)
%23 = shl nsw i32 %16, 3
%24 = or i32 %23, 1
%25 = sitofp i32 %24 to double
%26 = fmul double %5, %25
%27 = fptosi double %26 to i32
%28 = tail call double @sin(i32 %27)
%29 = or i32 %23, 3
%30 = sitofp i32 %29 to double
%31 = fmul double %5, %30
%32 = fptosi double %31 to i32
%33 = tail call double @sin(i32 %32)
%34 = insertelement <2 x double> poison, double %33, i64 0
%35 = insertelement <2 x double> %34, double %28, i64 1
%36 = fmul <2 x double> %35, %8
%37 = or i32 %23, 5
%38 = sitofp i32 %37 to double
%39 = fmul double %5, %38
%40 = fptosi double %39 to i32
%41 = tail call double @sin(i32 %40)
%42 = or i32 %23, 7
%43 = sitofp i32 %42 to double
%44 = fmul double %5, %43
%45 = fptosi double %44 to i32
%46 = tail call double @sin(i32 %45)
%47 = insertelement <2 x double> poison, double %46, i64 0
%48 = insertelement <2 x double> %47, double %41, i64 1
%49 = fmul <2 x double> %48, %10
%50 = fadd <2 x double> %36, <double 5.000000e-01, double 5.000000e-01>
%51 = fptosi <2 x double> %50 to <2 x i32>
%52 = fadd <2 x double> %49, <double 5.000000e-01, double 5.000000e-01>
%53 = fptosi <2 x double> %52 to <2 x i32>
%54 = extractelement <2 x i32> %51, i64 1
%55 = sitofp i32 %54 to double
%56 = extractelement <2 x double> %36, i64 1
%57 = fsub double %56, %55
%58 = fcmp ole double %57, 5.000000e-01
%59 = zext i1 %58 to i32
%60 = tail call i32 @assert(i32 %59)
%61 = extractelement <2 x i32> %51, i64 0
%62 = sitofp i32 %61 to double
%63 = extractelement <2 x double> %36, i64 0
%64 = fsub double %63, %62
%65 = fcmp ole double %64, 5.000000e-01
%66 = zext i1 %65 to i32
%67 = tail call i32 @assert(i32 %66)
%68 = extractelement <2 x i32> %53, i64 1
%69 = sitofp i32 %68 to double
%70 = extractelement <2 x double> %49, i64 1
%71 = fsub double %70, %69
%72 = fcmp ole double %71, 5.000000e-01
%73 = zext i1 %72 to i32
%74 = tail call i32 @assert(i32 %73)
%75 = extractelement <2 x i32> %53, i64 0
%76 = sitofp i32 %75 to double
%77 = extractelement <2 x double> %49, i64 0
%78 = fsub double %77, %76
%79 = fcmp ole double %78, 5.000000e-01
%80 = zext i1 %79 to i32
%81 = tail call i32 @assert(i32 %80)
%82 = fsub double %55, %56
%83 = fcmp ole double %82, 5.000000e-01
%84 = zext i1 %83 to i32
%85 = tail call i32 @assert(i32 %84)
%86 = fsub double %62, %63
%87 = fcmp ole double %86, 5.000000e-01
%88 = zext i1 %87 to i32
%89 = tail call i32 @assert(i32 %88)
%90 = fsub double %69, %70
%91 = fcmp ole double %90, 5.000000e-01
%92 = zext i1 %91 to i32
%93 = tail call i32 @assert(i32 %92)
%94 = fsub double %76, %77
%95 = fcmp ole double %94, 5.000000e-01
%96 = zext i1 %95 to i32
%97 = tail call i32 @assert(i32 %96)
%98 = xor i32 %54, -1
%99 = lshr i32 %98, 31
%100 = tail call i32 @assert(i32 %99)
%101 = icmp slt i32 %75, 16384
%102 = zext i1 %101 to i32
%103 = tail call i32 @assert(i32 %102)
%104 = shufflevector <2 x i32> %53, <2 x i32> %51, <2 x i32> <i32 1, i32 2>
%105 = sub nsw <2 x i32> %104, %51
%106 = sub nsw i32 %75, %68
%107 = extractelement <2 x i32> %105, i64 1
%108 = xor i32 %107, -1
%109 = lshr i32 %108, 31
%110 = tail call i32 @assert(i32 %109)
%111 = extractelement <2 x i32> %105, i64 0
%112 = xor i32 %111, -1
%113 = lshr i32 %112, 31
%114 = tail call i32 @assert(i32 %113)
%115 = xor i32 %106, -1
%116 = lshr i32 %115, 31
%117 = tail call i32 @assert(i32 %116)
%118 = icmp slt i32 %107, 3
%119 = zext i1 %118 to i32
%120 = tail call i32 @assert(i32 %119)
%121 = icmp slt i32 %111, 3
%122 = zext i1 %121 to i32
%123 = tail call i32 @assert(i32 %122)
%124 = icmp slt i32 %106, 3
%125 = zext i1 %124 to i32
%126 = tail call i32 @assert(i32 %125)
%127 = shl nsw i32 %106, 6
%128 = shl nsw i32 %111, 3
%129 = add i32 %128, %107
%130 = add i32 %129, %127
%131 = tail call i32 @ddd(i32 %130)
%132 = shl nuw i32 1, %131
%133 = or i32 %132, %15
%134 = lshr i32 %131, 3
%135 = and i32 %134, 1
%136 = lshr i32 %131, 2
%137 = and i32 %136, 1
%138 = shl i32 %131, 14
%139 = and i32 %138, 49152
%140 = add nsw i32 %139, %54
%141 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %135, i32 %137, i32 %140)
%142 = add nuw nsw i32 %16, 1
%143 = icmp eq i32 %142, 1024
br i1 %143, label %11, label %14
}