#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 *, unsigned int);
float sinf(float);
int main(int argc, char *argv[]) {
  union {
    float f;
    unsigned int i;
  } u;
  int i;
  for (i = 0; i < 2048; i++) {
    u.f = sinf((3.14159265358f * (float)i) / (2.0f * 2048));
    printf("%08x\n", u.i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x800,-0x1c(%rbp)
jge    118e <main+0x6e>
cvtsi2ssl -0x1c(%rbp),%xmm1
movss  0xead(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xe9d(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xedc(%rip),%rbx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mulss  0xec1(%rip),%xmm0
mulss  0xebd(%rip),%xmm0
call   1030 <sinf@plt>
movd   %xmm0,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x800,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { float }
@.str = [6 x i8] c"%08x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %union.anon
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 2048
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to float
%14 = fmul float 0x400921FB60000000, %13
%15 = fdiv float %14, 4.096000e+03
%16 = call float @sinf(float %15)
%17 = bitcast %union.anon* %6 to float*
store float %16, float* %17
%18 = bitcast %union.anon* %6 to i32*
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %11
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = sitofp i32 %4 to float
%6 = fmul float %5, 0x400921FB60000000
%7 = fmul float %6, 0x3F30000000000000
%8 = tail call float @sinf(float %7)
%9 = bitcast float %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %11, 2048
br i1 %12, label %13, label %3
13: ; preds = %3
ret i32 0
}