#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*/ callobj(long);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ gexit();
int /*<<< orphan*/ hboxfit(double, double, int);
int /*<<< orphan*/ hfont(char *);
int /*<<< orphan*/ lookat(double, double, double, double, double, double,
                          int /*<<< orphan*/);
int /*<<< orphan*/ makesphere();
int /*<<< orphan*/ perspective(int, double, double, double);
int /*<<< orphan*/ popmatrix();
int /*<<< orphan*/ pushmatrix();
int /*<<< orphan*/ qdevice(int);
int qread(short *);
int /*<<< orphan*/ rotate(int, char);
int /*<<< orphan*/ scale(double, double, double);
int /*<<< orphan*/ showroundtext(char *);
int /*<<< orphan*/ translate(double, double, double);
int /*<<< orphan*/ unqdevice(int);
int /*<<< orphan*/ vinit(char *);
int /*<<< orphan*/ winopen(char *);
main() {
  int i;
  short val;
  float r, z, a;
  vinit("mswin");
  winopen("world");
  qdevice(257);
  unqdevice(262);
  while (qread(&val) != 261)
    ;
  hfont("futura.m");
  perspective(800, 1.0, 0.001, 50.0);
  lookat(13.0, 13.0, 8.0, 0.0, 0.0, 0.0, 0);
  color(0);
  clear();
  makesphere();
  color(6);
  callobj(1L);
  color(7);
  pushmatrix();
  translate(0.0, -1.4 * 10.0, 1.4 * 10.0);
  scale(0.3, 0.3, 0.3);
  callobj(1L);
  popmatrix();
  hboxfit(2.0 * 3.14159265358979 * 10.0, 0.25 * 10.0, 31);
  color(2);
  showroundtext("Around the world in eighty days ");
  color(4);
  rotate(900, 'x');
  showroundtext("Around the world in eighty days ");
  color(1);
  rotate(900, 'z');
  showroundtext("Around the world in eighty days ");
  qread(&val);
  gexit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdfa(%rip),%rdi
call   1100 <vinit@plt>
lea    0xdf4(%rip),%rdi
call   10b0 <winopen@plt>
mov    $0x101,%edi
call   1040 <qdevice@plt>
mov    $0x106,%edi
call   10a0 <unqdevice@plt>
lea    -0xa(%rbp),%rdi
call   1140 <qread@plt>
cmp    $0x105,%eax
je     1294 <main+0x54>
jmp    127b <main+0x3b>
lea    0xdc1(%rip),%rdi
call   10e0 <hfont@plt>
mov    $0x320,%edi
movsd  0xd8b(%rip),%xmm0
movsd  0xd8b(%rip),%xmm1
movsd  0xd8b(%rip),%xmm2
call   1090 <perspective@plt>
movsd  0xd5e(%rip),%xmm1
movsd  0xd5e(%rip),%xmm2
xorps  %xmm5,%xmm5
xor    %edi,%edi
movaps %xmm1,%xmm0
movaps %xmm5,%xmm3
movaps %xmm5,%xmm4
call   1060 <lookat@plt>
xor    %edi,%edi
call   10d0 <color@plt>
mov    $0x0,%al
call   1150 <clear@plt>
mov    $0x0,%al
call   1110 <makesphere@plt>
mov    $0x6,%edi
call   10d0 <color@plt>
mov    $0x1,%edi
call   1080 <callobj@plt>
mov    $0x7,%edi
call   10d0 <color@plt>
mov    $0x0,%al
call   1160 <pushmatrix@plt>
xorps  %xmm0,%xmm0
movsd  0xcee(%rip),%xmm1
movsd  0xcee(%rip),%xmm2
call   1130 <translate@plt>
movsd  0xcd1(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   10f0 <scale@plt>
mov    $0x1,%edi
call   1080 <callobj@plt>
mov    $0x0,%al
call   1030 <popmatrix@plt>
movsd  0xc9d(%rip),%xmm0
movsd  0xc9d(%rip),%xmm1
mov    $0x1f,%edi
call   1070 <hboxfit@plt>
mov    $0x2,%edi
call   10d0 <color@plt>
lea    0xcdf(%rip),%rdi
call   1120 <showroundtext@plt>
mov    $0x4,%edi
call   10d0 <color@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   10c0 <rotate@plt>
lea    0xcba(%rip),%rdi
call   1120 <showroundtext@plt>
mov    $0x1,%edi
call   10d0 <color@plt>
mov    $0x384,%edi
mov    $0x7a,%esi
call   10c0 <rotate@plt>
lea    0xc95(%rip),%rdi
call   1120 <showroundtext@plt>
lea    -0xa(%rbp),%rdi
call   1140 <qread@plt>
mov    $0x0,%al
call   1050 <gexit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe04(%rip),%rdi
call   1100 <vinit@plt>
lea    0xdfe(%rip),%rdi
call   10b0 <winopen@plt>
mov    $0x101,%edi
call   1040 <qdevice@plt>
mov    $0x106,%edi
call   10a0 <unqdevice@plt>
lea    0xe(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1140 <qread@plt>
cmp    $0x105,%eax
jne    1280 <main+0x40>
lea    0xdc6(%rip),%rdi
call   10e0 <hfont@plt>
movsd  0xd5d(%rip),%xmm0
movsd  0xd5d(%rip),%xmm1
movsd  0xd5d(%rip),%xmm2
mov    $0x320,%edi
call   1090 <perspective@plt>
movsd  0xd53(%rip),%xmm0
movsd  0xd53(%rip),%xmm2
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
movaps %xmm0,%xmm1
xor    %edi,%edi
call   1060 <lookat@plt>
xor    %edi,%edi
call   10d0 <color@plt>
xor    %eax,%eax
call   1150 <clear@plt>
xor    %eax,%eax
call   1110 <makesphere@plt>
mov    $0x6,%edi
call   10d0 <color@plt>
mov    $0x1,%edi
call   1080 <callobj@plt>
mov    $0x7,%edi
call   10d0 <color@plt>
xor    %eax,%eax
call   1160 <pushmatrix@plt>
movsd  0xd06(%rip),%xmm1
movsd  0xd06(%rip),%xmm2
xorps  %xmm0,%xmm0
call   1130 <translate@plt>
movsd  0xcfe(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   10f0 <scale@plt>
mov    $0x1,%edi
call   1080 <callobj@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
movsd  0xce2(%rip),%xmm0
movsd  0xce2(%rip),%xmm1
mov    $0x1f,%edi
call   1070 <hboxfit@plt>
mov    $0x2,%edi
call   10d0 <color@plt>
lea    0xce4(%rip),%rbx
mov    %rbx,%rdi
call   1120 <showroundtext@plt>
mov    $0x4,%edi
call   10d0 <color@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   10c0 <rotate@plt>
mov    %rbx,%rdi
call   1120 <showroundtext@plt>
mov    $0x1,%edi
call   10d0 <color@plt>
mov    $0x384,%edi
mov    $0x7a,%esi
call   10c0 <rotate@plt>
mov    %rbx,%rdi
call   1120 <showroundtext@plt>
lea    0xe(%rsp),%rdi
call   1140 <qread@plt>
xor    %eax,%eax
call   1050 <gexit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [9 x i8] c"futura.m\00"
@.str.3 = [33 x i8] c"Around the world in eighty days \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 @vinit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @winopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @qdevice(i32 257)
%10 = call i32 @unqdevice(i32 262)
br label %11
11: ; preds = %14, %0
%12 = call i32 @qread(i16* %3)
%13 = icmp ne i32 %12, 261
br i1 %13, label %14, label %15
14: ; preds = %11
br label %11
15: ; preds = %11
%16 = call i32 @hfont(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @perspective(i32 800, double 1.000000e+00, double 1.000000e-03, double 5.000000e+01)
%18 = call i32 @lookat(double 1.300000e+01, double 1.300000e+01, double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, i32 0)
%19 = call i32 @color(i32 0)
%20 = call i32 (...) @clear()
%21 = call i32 (...) @makesphere()
%22 = call i32 @color(i32 6)
%23 = call i32 @callobj(i64 1)
%24 = call i32 @color(i32 7)
%25 = call i32 (...) @pushmatrix()
%26 = call i32 @translate(double 0.000000e+00, double -1.400000e+01, double 1.400000e+01)
%27 = call i32 @scale(double 3.000000e-01, double 3.000000e-01, double 3.000000e-01)
%28 = call i32 @callobj(i64 1)
%29 = call i32 (...) @popmatrix()
%30 = call i32 @hboxfit(double 0x404F6A7A29553855, double 2.500000e+00, i32 31)
%31 = call i32 @color(i32 2)
%32 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @color(i32 4)
%34 = call i32 @rotate(i32 900, i8 signext 120)
%35 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%36 = call i32 @color(i32 1)
%37 = call i32 @rotate(i32 900, i8 signext 122)
%38 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 @qread(i16* %3)
%40 = call i32 (...) @gexit()
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [9 x i8] c"futura.m\00"
@.str.3 = [33 x i8] c"Around the world in eighty days \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 ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @qdevice(i32 257)
%6 = tail call i32 @unqdevice(i32 262)
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 @hfont(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @perspective(i32 800, double 1.000000e+00, double 1.000000e-03, double 5.000000e+01)
%13 = call i32 @lookat(double 1.300000e+01, double 1.300000e+01, double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, i32 0)
%14 = call i32 @color(i32 0)
%15 = call i32 (...) @clear()
%16 = call i32 (...) @makesphere()
%17 = call i32 @color(i32 6)
%18 = call i32 @callobj(i64 1)
%19 = call i32 @color(i32 7)
%20 = call i32 (...) @pushmatrix()
%21 = call i32 @translate(double 0.000000e+00, double -1.400000e+01, double 1.400000e+01)
%22 = call i32 @scale(double 3.000000e-01, double 3.000000e-01, double 3.000000e-01)
%23 = call i32 @callobj(i64 1)
%24 = call i32 (...) @popmatrix()
%25 = call i32 @hboxfit(double 0x404F6A7A29553855, double 2.500000e+00, i32 31)
%26 = call i32 @color(i32 2)
%27 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @color(i32 4)
%29 = call i32 @rotate(i32 900, i8 signext 120)
%30 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @color(i32 1)
%32 = call i32 @rotate(i32 900, i8 signext 122)
%33 = call i32 @showroundtext(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @qread(i16* %1)
%35 = call i32 (...) @gexit()
ret i32 0
}