#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 cos(double);
double sin(double);
char saobox(double xcen, double ycen, double xwid, double ywid, double rot,
            double xcol, double ycol) {
  double x, y, xprime, yprime, xmin, xmax, ymin, ymax, theta;
  theta = (rot / 180.0) * 3.1415926535897932385;
  xprime = xcol - xcen;
  yprime = ycol - ycen;
  x = xprime * cos(theta) + yprime * sin(theta);
  y = -xprime * sin(theta) + yprime * cos(theta);
  xmin = -0.5 * xwid;
  xmax = 0.5 * xwid;
  ymin = -0.5 * ywid;
  ymax = 0.5 * ywid;
  if ((x >= xmin) && (x <= xmax) && (y >= ymin) && (y <= ymax))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<saobox>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1040 <cos@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1030 <sin@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1030 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1040 <cos@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd88(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd6e(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd64(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xd4a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     1311 <saobox+0x1f1>
movsd  -0x48(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1311 <saobox+0x1f1>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jb     1311 <saobox+0x1f1>
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1311 <saobox+0x1f1>
movb   $0x1,-0x1(%rbp)
jmp    1315 <saobox+0x1f5>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saobox>:
sub    $0x38,%rsp
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
divsd  0xec8(%rip),%xmm4
mulsd  0xec8(%rip),%xmm4
movsd  %xmm4,(%rsp)
subsd  %xmm0,%xmm5
movsd  %xmm5,0x18(%rsp)
subsd  %xmm1,%xmm6
movsd  %xmm6,0x10(%rsp)
movapd %xmm4,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe4a(%rip),%xmm1
movsd  0x28(%rsp),%xmm5
movapd %xmm5,%xmm2
mulsd  %xmm1,%xmm2
movsd  0x30(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movsd  0xe32(%rip),%xmm3
movsd  0x8(%rsp),%xmm6
ucomisd %xmm2,%xmm6
setae  %al
movapd %xmm5,%xmm2
mulsd  %xmm3,%xmm2
ucomisd %xmm6,%xmm2
mulsd  %xmm3,%xmm4
setae  %cl
ucomisd %xmm1,%xmm0
setae  %dl
and    %al,%cl
ucomisd %xmm0,%xmm4
setae  %al
and    %dl,%al
and    %cl,%al
add    $0x38,%rsp
ret

LLVM IR (-O0):
define signext i8 @saobox(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca i8
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
%25 = load double, double* %13
%26 = fdiv double %25, 1.800000e+02
%27 = fmul double %26, 0x400921FB54442D18
store double %27, double* %24
%28 = load double, double* %14
%29 = load double, double* %9
%30 = fsub double %28, %29
store double %30, double* %18
%31 = load double, double* %15
%32 = load double, double* %10
%33 = fsub double %31, %32
store double %33, double* %19
%34 = load double, double* %18
%35 = load double, double* %24
%36 = call double @cos(double %35)
%37 = load double, double* %19
%38 = load double, double* %24
%39 = call double @sin(double %38)
%40 = fmul double %37, %39
%41 = call double @llvm.fmuladd.f64(double %34, double %36, double %40)
store double %41, double* %16
%42 = load double, double* %18
%43 = fneg double %42
%44 = load double, double* %24
%45 = call double @sin(double %44)
%46 = load double, double* %19
%47 = load double, double* %24
%48 = call double @cos(double %47)
%49 = fmul double %46, %48
%50 = call double @llvm.fmuladd.f64(double %43, double %45, double %49)
store double %50, double* %17
%51 = load double, double* %11
%52 = fmul double -5.000000e-01, %51
store double %52, double* %20
%53 = load double, double* %11
%54 = fmul double 5.000000e-01, %53
store double %54, double* %21
%55 = load double, double* %12
%56 = fmul double -5.000000e-01, %55
store double %56, double* %22
%57 = load double, double* %12
%58 = fmul double 5.000000e-01, %57
store double %58, double* %23
%59 = load double, double* %16
%60 = load double, double* %20
%61 = fcmp oge double %59, %60
br i1 %61, label %62, label %75
62: ; preds = %7
%63 = load double, double* %16
%64 = load double, double* %21
%65 = fcmp ole double %63, %64
br i1 %65, label %66, label %75
66: ; preds = %62
%67 = load double, double* %17
%68 = load double, double* %22
%69 = fcmp oge double %67, %68
br i1 %69, label %70, label %75
70: ; preds = %66
%71 = load double, double* %17
%72 = load double, double* %23
%73 = fcmp ole double %71, %72
br i1 %73, label %74, label %75
74: ; preds = %70
store i8 1, i8* %8
br label %76
75: ; preds = %70, %66, %62, %7
store i8 0, i8* %8
br label %76
76: ; preds = %75, %74
%77 = load i8, i8* %8
ret i8 %77
}

LLVM IR (-O2):
define signext i8 @saobox(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fdiv double %4, 1.800000e+02
%9 = fmul double %8, 0x400921FB54442D18
%10 = fsub double %5, %0
%11 = fsub double %6, %1
%12 = tail call double @cos(double %9)
%13 = tail call double @sin(double %9)
%14 = fmul double %11, %13
%15 = tail call double @llvm.fmuladd.f64(double %10, double %12, double %14)
%16 = fneg double %10
%17 = tail call double @sin(double %9)
%18 = tail call double @cos(double %9)
%19 = fmul double %11, %18
%20 = tail call double @llvm.fmuladd.f64(double %16, double %17, double %19)
%21 = fmul double %2, -5.000000e-01
%22 = fmul double %3, -5.000000e-01
%23 = fmul double %3, 5.000000e-01
%24 = fcmp oge double %15, %21
%25 = fmul double %2, 5.000000e-01
%26 = fcmp ole double %15, %25
%27 = fcmp oge double %20, %22
%28 = and i1 %24, %26
%29 = select i1 %28, i1 %27, i1 false
%30 = fcmp ole double %20, %23
%31 = select i1 %29, i1 %30, i1 false
%32 = zext i1 %31 to i8
ret i8 %32
}