#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*/ winopen(char *);
main() {
  short val;
  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    0xe8a(%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   10c0 <qread@plt>
cmp    $0x105,%eax
je     1218 <main+0x48>
jmp    11ff <main+0x2f>
xor    %edi,%edi
call   1090 <color@plt>
mov    $0x0,%al
call   10d0 <clear@plt>
movsd  0xe32(%rip),%xmm5
movsd  0xe32(%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    0xe1d(%rip),%rdi
call   10a0 <hfont@plt>
movsd  0xde3(%rip),%xmm0
movsd  0xde3(%rip),%xmm1
movsd  0xde3(%rip),%xmm2
movsd  0xdab(%rip),%xmm3
lea    0xdfa(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x2,%edi
call   1090 <color@plt>
xorps  %xmm0,%xmm0
movsd  0xda2(%rip),%xmm1
movsd  0xd92(%rip),%xmm2
movsd  0xd7a(%rip),%xmm3
lea    0xde5(%rip),%rdi
call   1060 <hboxtext@plt>
xorps  %xmm0,%xmm0
movsd  0xd6b(%rip),%xmm1
movsd  0xd6b(%rip),%xmm2
movsd  0xd53(%rip),%xmm3
lea    0xde0(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x5,%edi
call   1090 <color@plt>
movsd  0xd1d(%rip),%xmm0
movsd  0xd1d(%rip),%xmm1
movsd  0xd1d(%rip),%xmm2
movsd  0xd1d(%rip),%xmm3
lea    0xdcd(%rip),%rdi
call   1060 <hboxtext@plt>
mov    $0x0,%al
call   10f0 <drawpoly@plt>
movsd  0xce2(%rip),%xmm0
mov    $0x78,%edi
call   10e0 <rot@plt>
movsd  0xcc8(%rip),%xmm0
mov    $0x79,%edi
call   10e0 <rot@plt>
mov    $0x0,%al
call   10b0 <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    0xe94(%rip),%rdi
call   1080 <winopen@plt>
mov    $0x106,%edi
call   1070 <unqdevice@plt>
mov    $0x101,%edi
call   1030 <qdevice@plt>
lea    0xe(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10c0 <qread@plt>
cmp    $0x105,%eax
jne    1200 <main+0x30>
xor    %edi,%edi
call   1090 <color@plt>
xor    %eax,%eax
call   10d0 <clear@plt>
movsd  0xddb(%rip),%xmm1
movsd  0xddb(%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    0xe26(%rip),%rdi
call   10a0 <hfont@plt>
lea    0xe23(%rip),%rdi
movsd  0xdad(%rip),%xmm0
movsd  0xdad(%rip),%xmm1
movsd  0xdad(%rip),%xmm2
movsd  0xdad(%rip),%xmm3
call   1060 <hboxtext@plt>
mov    $0x2,%edi
call   1090 <color@plt>
lea    0xe09(%rip),%rdi
movsd  0xd97(%rip),%xmm1
movsd  0xd97(%rip),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd7c(%rip),%xmm3
call   1060 <hboxtext@plt>
lea    0xe04(%rip),%rdi
movsd  0xd80(%rip),%xmm1
xorps  %xmm0,%xmm0
movsd  0xd6d(%rip),%xmm2
movsd  0xd55(%rip),%xmm3
call   1060 <hboxtext@plt>
mov    $0x5,%edi
call   1090 <color@plt>
lea    0xdf6(%rip),%rdi
movsd  0xd57(%rip),%xmm0
movsd  0xd57(%rip),%xmm1
movsd  0xd57(%rip),%xmm2
movsd  0xd1f(%rip),%xmm3
call   1060 <hboxtext@plt>
xor    %eax,%eax
call   10f0 <drawpoly@plt>
movsd  0xd43(%rip),%xmm0
mov    $0x78,%edi
call   10e0 <rot@plt>
movsd  0xd39(%rip),%xmm0
mov    $0x79,%edi
call   10e0 <rot@plt>
xor    %eax,%eax
call   10b0 <drawpolyf@plt>
xor    %eax,%eax
call   1040 <gexit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"poly\00"
@.str.1 = [9 x i8] c"futura.m\00"
@.str.2 = [28 x i8] c"Polygon from poly()/ polf()\00"
@.str.3 = [34 x i8] c"Polygon from bgnpoly()/ endpoly()\00"
@.str.4 = [35 x i8] c" pmv()/ pdr()/ pclos()\00"
@.str.5 = [10 x i8] c"Arc/ Arcf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call i32 @winopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @unqdevice(i32 262)
%5 = call i32 @qdevice(i32 257)
br label %6
6: ; preds = %9, %0
%7 = call i32 @qread(i16* %2)
%8 = icmp ne i32 %7, 261
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
%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.1, 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.2, 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.3, 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.4, 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.5, 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()
%27 = load i32, i32* %1
ret i32 %27
}

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