#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float cos(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
float sin(float);
int print_points(float x, float y, float direction, FILE *fff) {
  float x1, y1, xdelta, ydelta, theta;
  theta =
      (direction * (3.141592653589793238462643383279502884197169399 / 180.0));
  x1 = sin(theta);
  y1 = cos(theta);
  xdelta = (y1) / 2;
  ydelta = (x1) / 2;
  fprintf(fff, "%f %f\n", x1 - xdelta, y1 + ydelta);
  fprintf(fff, "%f %f\n", x1 + xdelta, y1 - ydelta);
  fprintf(fff, "%f %f\n", -xdelta, +ydelta);
  fprintf(fff, "%f %f\n", xdelta, -ydelta);
  fprintf(fff, "%f %f\n", -x1 - xdelta, -y1 + ydelta);
  fprintf(fff, "%f %f\n", -x1 + xdelta, -y1 - ydelta);
  fprintf(fff, "\n");
  return 1;
}


x86 assembly (clang, -O0):
<print_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xe6c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe56(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
addss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe36(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
subss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe08(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdd7(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x28(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xda6(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
addss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd5e(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
subss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd16(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd09(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_points>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
cvtss2sd %xmm2,%xmm0
mulsd  0xeaa(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
call   1050 <sin@plt>
movaps %xmm0,0x20(%rsp)
movss  (%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm3
movaps %xmm0,0x30(%rsp)
movss  0xe85(%rip),%xmm2
movaps %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,0x10(%rsp)
movaps 0x20(%rsp),%xmm0
mulss  %xmm0,%xmm2
movaps %xmm2,(%rsp)
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addss  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
lea    0xe6a(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
movaps 0x20(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0x30(%rsp),%xmm1
subss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
movaps 0x10(%rsp),%xmm0
xorps  0xe17(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movaps (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps (%rsp),%xmm1
xorps  0xdea(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
movaps 0x20(%rsp),%xmm0
movaps 0xdcd(%rip),%xmm1
xorps  %xmm1,%xmm0
subss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0x30(%rsp),%xmm2
xorps  %xmm2,%xmm1
movaps %xmm1,0x40(%rsp)
movaps (%rsp),%xmm1
subss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
movaps 0x10(%rsp),%xmm0
subss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0x40(%rsp),%xmm1
subss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x1,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f %f\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @print_points(float %0, float %1, float %2, i32* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i32* %3, i32** %8
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = fmul double %15, 0x3F91DF46A2529D39
%17 = fptrunc double %16 to float
store float %17, float* %13
%18 = load float, float* %13
%19 = call float @sin(float %18)
store float %19, float* %9
%20 = load float, float* %13
%21 = call float @cos(float %20)
store float %21, float* %10
%22 = load float, float* %10
%23 = fdiv float %22, 2.000000e+00
store float %23, float* %11
%24 = load float, float* %9
%25 = fdiv float %24, 2.000000e+00
store float %25, float* %12
%26 = load i32*, i32** %8
%27 = load float, float* %9
%28 = load float, float* %11
%29 = fsub float %27, %28
%30 = fpext float %29 to double
%31 = load float, float* %10
%32 = load float, float* %12
%33 = fadd float %31, %32
%34 = fpext float %33 to double
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %30, double %34)
%36 = load i32*, i32** %8
%37 = load float, float* %9
%38 = load float, float* %11
%39 = fadd float %37, %38
%40 = fpext float %39 to double
%41 = load float, float* %10
%42 = load float, float* %12
%43 = fsub float %41, %42
%44 = fpext float %43 to double
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %40, double %44)
%46 = load i32*, i32** %8
%47 = load float, float* %11
%48 = fneg float %47
%49 = fpext float %48 to double
%50 = load float, float* %12
%51 = fpext float %50 to double
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %49, double %51)
%53 = load i32*, i32** %8
%54 = load float, float* %11
%55 = fpext float %54 to double
%56 = load float, float* %12
%57 = fneg float %56
%58 = fpext float %57 to double
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %55, double %58)
%60 = load i32*, i32** %8
%61 = load float, float* %9
%62 = fneg float %61
%63 = load float, float* %11
%64 = fsub float %62, %63
%65 = fpext float %64 to double
%66 = load float, float* %10
%67 = fneg float %66
%68 = load float, float* %12
%69 = fadd float %67, %68
%70 = fpext float %69 to double
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %65, double %70)
%72 = load i32*, i32** %8
%73 = load float, float* %9
%74 = fneg float %73
%75 = load float, float* %11
%76 = fadd float %74, %75
%77 = fpext float %76 to double
%78 = load float, float* %10
%79 = fneg float %78
%80 = load float, float* %12
%81 = fsub float %79, %80
%82 = fpext float %81 to double
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %77, double %82)
%84 = load i32*, i32** %8
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define i32 @print_points(float %0, float %1, float %2, i32* nocapture %3) {
%5 = fpext float %2 to double
%6 = fmul double %5, 0x3F91DF46A2529D39
%7 = fptrunc double %6 to float
%8 = tail call float @sin(float %7)
%9 = tail call float @cos(float %7)
%10 = fmul float %9, 5.000000e-01
%11 = fmul float %8, 5.000000e-01
%12 = fsub float %8, %10
%13 = fpext float %12 to double
%14 = fadd float %9, %11
%15 = fpext float %14 to double
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %13, double %15)
%17 = fadd float %8, %10
%18 = fpext float %17 to double
%19 = fsub float %9, %11
%20 = fpext float %19 to double
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %18, double %20)
%22 = fneg float %10
%23 = fpext float %22 to double
%24 = fpext float %11 to double
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %23, double %24)
%26 = fpext float %10 to double
%27 = fneg float %11
%28 = fpext float %27 to double
%29 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %26, double %28)
%30 = fneg float %8
%31 = fsub float %30, %10
%32 = fpext float %31 to double
%33 = fneg float %9
%34 = fsub float %11, %9
%35 = fpext float %34 to double
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %32, double %35)
%37 = fsub float %10, %8
%38 = fpext float %37 to double
%39 = fsub float %33, %11
%40 = fpext float %39 to double
%41 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %38, double %40)
%42 = tail call i32 @fputc(i32 10, i32* %3)
ret i32 1
}