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


x86 assembly (clang, -O0):
<mplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xec3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x5,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffffd,-0x14(%rbp)
jne    119c <mplot+0x6c>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <moveTo@plt>
jmp    1205 <mplot+0xd5>
cmpl   $0xfffffffe,-0x14(%rbp)
jne    11c5 <mplot+0x95>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <lineTo@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1050 <pointAt@plt>
jmp    1200 <mplot+0xd0>
cmpl   $0x3,-0x14(%rbp)
jne    11e1 <mplot+0xb1>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <moveTo@plt>
jmp    11fb <mplot+0xcb>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <lineTo@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1050 <pointAt@plt>
jmp    1200 <mplot+0xd0>
jmp    1205 <mplot+0xd5>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mplot>:
push   %rbp
push   %rbx
push   %rax
mulsd  0xec5(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mulsd  0xec1(%rip),%xmm1
addsd  0xec1(%rip),%xmm1
add    $0x5,%ebx
cvttsd2si %xmm1,%ebp
cmp    $0x3,%edi
je     1165 <mplot+0x35>
cmp    $0xfffffffe,%edi
je     1172 <mplot+0x42>
cmp    $0xfffffffd,%edi
jne    1172 <mplot+0x42>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <moveTo@plt>
jmp    1188 <mplot+0x58>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <lineTo@plt>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <pointAt@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mplot(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 = fmul double 2.900000e+01, %9
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, 5
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 = fptosi double %14 to i32
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, -3
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %19, i32 %20)
br label %48
22: ; preds = %3
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, -2
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %26, i32 %27)
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pointAt to i32 (i32, i32, ...)*)(i32 %29, i32 %30)
br label %47
32: ; preds = %22
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %36, i32 %37)
br label %46
39: ; preds = %32
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = call i32 (i32, i32, ...) bitcast (i32 (...)* @lineTo to i32 (i32, i32, ...)*)(i32 %40, i32 %41)
%43 = load i32, i32* %7
%44 = load i32, i32* %8
%45 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pointAt to i32 (i32, i32, ...)*)(i32 %43, i32 %44)
br label %46
46: ; preds = %39, %35
br label %47
47: ; preds = %46, %25
br label %48
48: ; preds = %47, %18
ret i32 1
}

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