int msplot(x, y, n)
double x, y;
int n;
{
  int ix, iy;
  ix = (int)((29.0 * x) + 5 + 0.5);
  iy = (int)((340.0 - (29.0 * (y))) + 0.5);
  if (n == -3) {
    moveTo(ix, iy);
  } else if (n == -2) {
    lineTo(ix, iy);
  } else if (n == 3) {
    moveTo(ix, iy);
  } else {
    lineTo(ix, iy);
  }
  return (1);
}


x86 assembly (clang, -O0):
<msplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe76(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffffd,-0x14(%rbp)
jne    11b1 <msplot+0x91>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <moveTo@plt>
jmp    1200 <msplot+0xe0>
cmpl   $0xfffffffe,-0x14(%rbp)
jne    11cd <msplot+0xad>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <lineTo@plt>
jmp    11fb <msplot+0xdb>
cmpl   $0x3,-0x14(%rbp)
jne    11e9 <msplot+0xc9>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <moveTo@plt>
jmp    11f6 <msplot+0xd6>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <lineTo@plt>
jmp    11fb <msplot+0xdb>
jmp    1200 <msplot+0xe0>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msplot>:
push   %rax
mov    %edi,%eax
mulsd  0xed5(%rip),%xmm0
addsd  0xed5(%rip),%xmm0
movsd  0xed5(%rip),%xmm2
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
mulsd  0xecd(%rip),%xmm1
addsd  0xecd(%rip),%xmm1
addsd  %xmm2,%xmm1
cvttsd2si %xmm1,%esi
cmp    $0x3,%eax
je     116a <msplot+0x4a>
cmp    $0xfffffffe,%eax
je     1173 <msplot+0x53>
cmp    $0xfffffffd,%eax
jne    1173 <msplot+0x53>
xor    %eax,%eax
call   1040 <moveTo@plt>
jmp    117a <msplot+0x5a>
xor    %eax,%eax
call   1030 <lineTo@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @msplot(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%9 = load double, double* %4
%10 = call double @llvm.fmuladd.f64(double 2.900000e+01, double %9, double 5.000000e+00)
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i32
store i32 %12, i32* %7
%13 = load double, double* %5
%14 = call double @llvm.fmuladd.f64(double -2.900000e+01, double %13, double 3.400000e+02)
%15 = fadd double %14, 5.000000e-01
%16 = fptosi double %15 to i32
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, -3
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %20, i32 %21)
br label %43
23: ; preds = %3
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, -2
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %27, i32 %28)
br label %42
30: ; preds = %23
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, 3
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %34, i32 %35)
br label %41
37: ; preds = %30
%38 = load i32, i32* %7
%39 = load i32, i32* %8
%40 = call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %38, i32 %39)
br label %41
41: ; preds = %37, %33
br label %42
42: ; preds = %41, %26
br label %43
43: ; preds = %42, %19
ret i32 1
}

LLVM IR (-O2):
define i32 @msplot(double %0, double %1, i32 %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double 2.900000e+01, double 5.000000e+00)
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
%7 = tail call double @llvm.fmuladd.f64(double %1, double -2.900000e+01, double 3.400000e+02)
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
switch i32 %2, label %16 [
i32 -3, label %10
i32 -2, label %12
i32 3, label %14
]
10: ; preds = %3
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %6, i32 %9)
br label %18
12: ; preds = %3
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %6, i32 %9)
br label %18
14: ; preds = %3
%15 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %6, i32 %9)
br label %18
16: ; preds = %3
%17 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %6, i32 %9)
br label %18
18: ; preds = %12, %16, %14, %10
ret i32 1
}