#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 */
double fabs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, unsigned long, ...);
int /*<<< orphan*/ sin(double);
int do_t_values(void) {
  int i;
  for (i = 1; i <= 64; ++i) {
    unsigned long v = (unsigned long)(4294967296.0 * fabs(sin((double)i)));
    if (v >> 31) {
      printf("#define T%d /* 0x%08lx */ (T_MASK ^ 0x%08lx)\n", i, v,
             (unsigned long)(unsigned int)(~v));
    } else {
      printf("#define T%d    0x%08lx\n", i, v);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_t_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jg     11f0 <do_t_values+0xc0>
cvtsi2sdl -0x4(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xe8b(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1f,%rax
cmp    $0x0,%rax
je     11c8 <do_t_values+0x98>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <do_t_values+0xad>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <do_t_values+0xb2>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <do_t_values+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_t_values>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%ebx
movsd  0xeb6(%rip),%xmm0
mov    $0x80000000,%r12d
lea    0xeef(%rip),%r14
lea    0x7fffffff(%r12),%r13
7f
lea    0xeb2(%rip),%r15
jmp    1192 <do_t_values+0x62>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe76(%rip),%xmm0
add    $0x1,%ebx
cmp    $0x41,%ebx
je     11e3 <do_t_values+0xb3>
movsd  %xmm0,0x8(%rsp)
call   1050 <sin@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
mulsd  0xe5c(%rip),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
subsd  0xe54(%rip),%xmm0
cvttsd2si %xmm0,%rdx
sar    $0x3f,%rcx
and    %rcx,%rdx
or     %rax,%rdx
cmp    %r12,%rdx
jb     1170 <do_t_values+0x40>
mov    %edx,%ecx
xor    %r13,%rcx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    117c <do_t_values+0x4c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"#define T%d /* 0x%08lx */ (T_MASK ^ 0x%08lx)\0A\00"
@.str.1 = [24 x i8] c"#define T%d 0x%08lx\0A\00"
define i32 @do_t_values() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
br label %3
3: ; preds = %29, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 64
br i1 %5, label %6, label %32
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to double
%9 = call i32 @sin(double %8)
%10 = call double @fabs(i32 %9)
%11 = fmul double 0x41F0000000000000, %10
%12 = fptoui double %11 to i64
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 31
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %6
%17 = load i32, i32* %1
%18 = load i64, i64* %2
%19 = load i64, i64* %2
%20 = xor i64 %19, -1
%21 = trunc i64 %20 to i32
%22 = zext i32 %21 to i64
%23 = call i32 (i8*, i32, i64, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %17, i64 %18, i64 %22)
br label %28
24: ; preds = %6
%25 = load i32, i32* %1
%26 = load i64, i64* %2
%27 = call i32 (i8*, i32, i64, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %25, i64 %26)
br label %28
28: ; preds = %24, %16
br label %29
29: ; preds = %28
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %3
32: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"#define T%d /* 0x%08lx */ (T_MASK ^ 0x%08lx)\0A\00"
@.str.1 = [24 x i8] c"#define T%d 0x%08lx\0A\00"
define i32 @do_t_values() {
br label %1
1: ; preds = %0, %15
%2 = phi i32 [ 1, %0 ], [ %16, %15 ]
%3 = sitofp i32 %2 to double
%4 = tail call i32 @sin(double %3)
%5 = tail call double @fabs(i32 %4)
%6 = fmul double %5, 0x41F0000000000000
%7 = fptoui double %6 to i64
%8 = icmp ult i64 %7, 2147483648
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = and i64 %7, 4294967295
%11 = xor i64 %10, 4294967295
%12 = tail call i32 (i8*, i32, i64, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %2, i64 %7, i64 %11)
br label %15
13: ; preds = %1
%14 = tail call i32 (i8*, i32, i64, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %2, i64 %7)
br label %15
15: ; preds = %13, %9
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 65
br i1 %17, label %18, label %1
18: ; preds = %15
ret i32 0
}