#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*/ clear();
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ drawpoly();
int /*<<< orphan*/ drawpolyf();
int /*<<< orphan*/ gexit();
int /*<<< orphan*/ hboxtext(double, double, double, double, char *);
int /*<<< orphan*/ hfont(char *);
int /*<<< orphan*/ ortho(double, double, double, double, double, double);
int /*<<< orphan*/ qdevice(int);
int qread(short *);
int /*<<< orphan*/ rot(double, char);
int /*<<< orphan*/ unqdevice(int);
int /*<<< orphan*/ vinit(char *);
int /*<<< orphan*/ winopen(char *);
main() {
  short val;
  vinit("mswin");
  winopen("poly");
  unqdevice(262);
  qdevice(257);
  while (qread(&val) != 261)
    ;
  color(0);
  clear();
  ortho(-10.0, 10.0, -10.0, 10.0, 10.0, -10.0);
  color(3);
  hfont("futura.m");
  hboxtext(-8.0, -4.0, 4.0, 0.5, "Polygon from poly()/ polf()");
  color(2);
  hboxtext(0.0, 6.0, 4.5, 0.5, "Polygon from bgnpoly()/ endpoly()");
  hboxtext(0.0, 5.0, 4.5, 0.5, "             pmv()/ pdr()/ pclos()");
  color(5);
  hboxtext(3.5, -3.5, 1.9, 0.5, "Arc/ Arcf");
  drawpoly();
  rot(20.0, 'x');
  rot(30.0, 'y');
  drawpolyf();
  gexit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
call   10b0 <vinit@plt>
lea    0xe74(%rip),%rdi
call   1080 <winopen@plt>
mov    $0x106,%edi
call   1070 <unqdevice@plt>
mov    $0x101,%edi
call   1030 <qdevice@plt>
lea    -0x6(%rbp),%rdi
call   10d0 <qread@plt>
cmp    $0x105,%eax
je     1234 <main+0x54>
jmp    121b <main+0x3b>
xor    %edi,%edi
call   1090 <color@plt>
mov    $0x0,%al
call   10e0 <clear@plt>
movsd  0xe16(%rip),%xmm5
movsd  0xe16(%rip),%xmm4
movaps %xmm5,%xmm0
movaps %xmm4,%xmm1
movaps %xmm5,%xmm2
movaps %xmm4,%xmm3
call   1050 <ortho@plt>
mov    $0x3,%edi
call   1090 <color@plt>
lea    0xe07(%rip),%rdi
call   10a0 <hfont@plt>
movsd  0xdc7(%rip),%xmm0
movsd  0xdc7(%rip),%xmm1
movsd  0xdc7(%rip),%xmm2
movsd  0xd8f(%rip),%xmm3
lea    0xde4(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x2,%edi
call   1090 <color@plt>
xorps  %xmm0,%xmm0
movsd  0xd86(%rip),%xmm1
movsd  0xd76(%rip),%xmm2
movsd  0xd5e(%rip),%xmm3
lea    0xdcf(%rip),%rdi
call   1060 <hboxtext@plt>
xorps  %xmm0,%xmm0
movsd  0xd4f(%rip),%xmm1
movsd  0xd4f(%rip),%xmm2
movsd  0xd37(%rip),%xmm3
lea    0xdca(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x5,%edi
call   1090 <color@plt>
movsd  0xd01(%rip),%xmm0
movsd  0xd01(%rip),%xmm1
movsd  0xd01(%rip),%xmm2
movsd  0xd01(%rip),%xmm3
lea    0xdb7(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x0,%al
call   1100 <drawpoly@plt>
movsd  0xcc6(%rip),%xmm0
mov    $0x78,%edi
call   10f0 <rot@plt>
movsd  0xcac(%rip),%xmm0
mov    $0x79,%edi
call   10f0 <rot@plt>
mov    $0x0,%al
call   10c0 <drawpolyf@plt>
mov    $0x0,%al
call   1040 <gexit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe84(%rip),%rdi
call   10b0 <vinit@plt>
lea    0xe7e(%rip),%rdi
call   1080 <winopen@plt>
mov    $0x106,%edi
call   1070 <unqdevice@plt>
mov    $0x101,%edi
call   1030 <qdevice@plt>
lea    0xe(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10d0 <qread@plt>
cmp    $0x105,%eax
jne    1220 <main+0x40>
xor    %edi,%edi
call   1090 <color@plt>
xor    %eax,%eax
call   10e0 <clear@plt>
movsd  0xdbb(%rip),%xmm1
movsd  0xdbb(%rip),%xmm0
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm4
movaps %xmm0,%xmm5
call   1050 <ortho@plt>
mov    $0x3,%edi
call   1090 <color@plt>
lea    0xe0c(%rip),%rdi
call   10a0 <hfont@plt>
lea    0xe09(%rip),%rdi
movsd  0xd8d(%rip),%xmm0
movsd  0xd8d(%rip),%xmm1
movsd  0xd8d(%rip),%xmm2
movsd  0xd8d(%rip),%xmm3
call   1060 <hboxtext@plt>
mov    $0x2,%edi
call   1090 <color@plt>
lea    0xdef(%rip),%rdi
movsd  0xd77(%rip),%xmm1
movsd  0xd77(%rip),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd5c(%rip),%xmm3
call   1060 <hboxtext@plt>
lea    0xdea(%rip),%rdi
movsd  0xd60(%rip),%xmm1
xorps  %xmm0,%xmm0
movsd  0xd4d(%rip),%xmm2
movsd  0xd35(%rip),%xmm3
call   1060 <hboxtext@plt>
mov    $0x5,%edi
call   1090 <color@plt>
lea    0xddc(%rip),%rdi
movsd  0xd37(%rip),%xmm0
movsd  0xd37(%rip),%xmm1
movsd  0xd37(%rip),%xmm2
movsd  0xcff(%rip),%xmm3
call   1060 <hboxtext@plt>
xor    %eax,%eax
call   1100 <drawpoly@plt>
movsd  0xd23(%rip),%xmm0
mov    $0x78,%edi
call   10f0 <rot@plt>
movsd  0xd19(%rip),%xmm0
mov    $0x79,%edi
call   10f0 <rot@plt>
xor    %eax,%eax
call   10c0 <drawpolyf@plt>
xor    %eax,%eax
call   1040 <gexit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [5 x i8] c"poly\00"
@.str.2 = [9 x i8] c"futura.m\00"
@.str.3 = [28 x i8] c"Polygon from poly()/ polf()\00"
@.str.4 = [34 x i8] c"Polygon from bgnpoly()/ endpoly()\00"
@.str.5 = [35 x i8] c" pmv()/ pdr()/ pclos()\00"
@.str.6 = [10 x i8] c"Arc/ Arcf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call i32 @vinit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @winopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @unqdevice(i32 262)
%6 = call i32 @qdevice(i32 257)
br label %7
7: ; preds = %10, %0
%8 = call i32 @qread(i16* %2)
%9 = icmp ne i32 %8, 261
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
%12 = call i32 @color(i32 0)
%13 = call i32 (...) @clear()
%14 = call i32 @ortho(double -1.000000e+01, double 1.000000e+01, double -1.000000e+01, double 1.000000e+01, double 1.000000e+01, double -1.000000e+01)
%15 = call i32 @color(i32 3)
%16 = call i32 @hfont(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @hboxtext(double -8.000000e+00, double -4.000000e+00, double 4.000000e+00, double 5.000000e-01, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @color(i32 2)
%19 = call i32 @hboxtext(double 0.000000e+00, double 6.000000e+00, double 4.500000e+00, double 5.000000e-01, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @hboxtext(double 0.000000e+00, double 5.000000e+00, double 4.500000e+00, double 5.000000e-01, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @color(i32 5)
%22 = call i32 @hboxtext(double 3.500000e+00, double -3.500000e+00, double 1.900000e+00, double 5.000000e-01, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 (...) @drawpoly()
%24 = call i32 @rot(double 2.000000e+01, i8 signext 120)
%25 = call i32 @rot(double 3.000000e+01, i8 signext 121)
%26 = call i32 (...) @drawpolyf()
%27 = call i32 (...) @gexit()
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [5 x i8] c"poly\00"
@.str.2 = [9 x i8] c"futura.m\00"
@.str.3 = [28 x i8] c"Polygon from poly()/ polf()\00"
@.str.4 = [34 x i8] c"Polygon from bgnpoly()/ endpoly()\00"
@.str.5 = [35 x i8] c" pmv()/ pdr()/ pclos()\00"
@.str.6 = [10 x i8] c"Arc/ Arcf\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = tail call i32 @vinit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @winopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @unqdevice(i32 262)
%6 = tail call i32 @qdevice(i32 257)
br label %7
7: ; preds = %7, %0
%8 = call i32 @qread(i16* %1)
%9 = icmp eq i32 %8, 261
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = call i32 @color(i32 0)
%12 = call i32 (...) @clear()
%13 = call i32 @ortho(double -1.000000e+01, double 1.000000e+01, double -1.000000e+01, double 1.000000e+01, double 1.000000e+01, double -1.000000e+01)
%14 = call i32 @color(i32 3)
%15 = call i32 @hfont(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @hboxtext(double -8.000000e+00, double -4.000000e+00, double 4.000000e+00, double 5.000000e-01, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @color(i32 2)
%18 = call i32 @hboxtext(double 0.000000e+00, double 6.000000e+00, double 4.500000e+00, double 5.000000e-01, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @hboxtext(double 0.000000e+00, double 5.000000e+00, double 4.500000e+00, double 5.000000e-01, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @color(i32 5)
%21 = call i32 @hboxtext(double 3.500000e+00, double -3.500000e+00, double 1.900000e+00, double 5.000000e-01, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (...) @drawpoly()
%23 = call i32 @rot(double 2.000000e+01, i8 signext 120)
%24 = call i32 @rot(double 3.000000e+01, i8 signext 121)
%25 = call i32 (...) @drawpolyf()
%26 = call i32 (...) @gexit()
ret i32 0
}