#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*/ backface(int);
int /*<<< orphan*/ callobj(long);
int /*<<< orphan*/ circ(double, double, double);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ color(int);
float cos(double);
int /*<<< orphan*/ doublebuffer();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gconfig();
int /*<<< orphan*/ gexit();
int /*<<< orphan*/ lookat(double, double, double, double, double, double,
                          int /*<<< orphan*/);
int /*<<< orphan*/ maketetra();
int /*<<< orphan*/ move(double, double, double);
int /*<<< orphan*/ perspective(int, double, double, double);
int /*<<< orphan*/ polymode(int);
int /*<<< orphan*/ popmatrix();
int /*<<< orphan*/ prefsize(long, long);
int /*<<< orphan*/ pushmatrix();
int /*<<< orphan*/ qdevice(char);
scalar_t__ qtest();
int /*<<< orphan*/ rotate(int, char);
int /*<<< orphan*/ scale(double, double, double);
float sin(double);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ swapbuffers();
int /*<<< orphan*/ translate(float, double, float);
int /*<<< orphan*/ unqdevice(int);
int /*<<< orphan*/ winopen(char *);
int main(int argc, char **argv) {
  char dev[20];
  int i;
  int rotval = 0, drotval = 2, irot = 0, srot;
  float R = 3.0, tx = 0.0, tz = R;
  int do_backface = 0;
  int do_fill = 0;
  short val;
  for (i = 1; i < argc; i++) {
    if (!strcmp(argv[i], "-b"))
      do_backface = 1;
    if (!strcmp(argv[i], "-f"))
      do_fill = 1;
  }
  prefsize(400L, 400L);
  winopen("tetra");
  qdevice('\033');
  qdevice('Q');
  unqdevice(262);
  doublebuffer();
  gconfig();
  polymode(0);
  if (do_fill)
    polymode(1);
  if (do_backface)
    backface(1);
  perspective(360, 1.0, 0.001, 15.0);
  lookat(0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0);
  maketetra();
  do {
    for (rotval = 0; rotval < 3600; rotval += drotval) {
      color(0);
      clear();
      for (i = 0; i < 2; i++) {
        translate(((i) ? 1.0 : -1.0) * 0.1, 0.0, 0.0);
        color((i) ? 1 : 4);
        irot = (irot + 3) % 3600;
        srot = rotval * sin(irot / 1800.0);
        if (srot < 0)
          srot += 3600;
        pushmatrix();
        {
          rotate(rotval, 'x');
          rotate(rotval, 'z');
          pushmatrix();
          {
            rotate(900, 'x');
            circ(0.0, 0.0, R);
          }
          popmatrix();
          move(0.0, 0.0, 0.0);
          pushmatrix();
          {
            rotate(450, 'z');
            rotate(450, 'x');
            scale(0.4, 0.4 + sin(rotval / 1800.0) / 20.0,
                  0.4 + cos(irot / 1800.0) / 20.0);
            callobj(1L);
            rotate(900, 'x');
            callobj(1L);
          }
          popmatrix();
          pushmatrix();
          {
            translate(tx + sin(irot / 1800.0), 0.0, tz + cos(irot / 1800.0));
            circ(0.0, 0.0, 0.1);
            rotate(450, 'z');
            rotate(450, 'x');
            circ(0.0, 0.0, 0.1);
            rotate(irot, 'y');
            scale(0.2, 0.2, 0.2);
            callobj(1L);
            rotate(900, 'y');
            callobj(1L);
          }
          popmatrix();
        }
        popmatrix();
      }
      tz = R * cos((double)(rotval * 3.1415926535 / 180));
      tx = R * sin((double)(rotval * 3.1415926535 / 180));
      swapbuffers();
      if (qtest()) {
        gexit();
        exit(0);
      }
    }
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x2,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movss  0xd0a(%rip),%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1391 <main+0xd1>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd27(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    1356 <main+0x96>
movl   $0x1,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd02(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    137e <main+0xbe>
movl   $0x1,-0x58(%rbp)
jmp    1383 <main+0xc3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1322 <main+0x62>
mov    $0x190,%esi
mov    %rsi,%rdi
call   1180 <prefsize@plt>
lea    0xcc9(%rip),%rdi
call   1110 <winopen@plt>
mov    $0x1b,%edi
call   1060 <qdevice@plt>
mov    $0x51,%edi
call   1060 <qdevice@plt>
mov    $0x106,%edi
call   1100 <unqdevice@plt>
mov    $0x0,%al
call   1170 <doublebuffer@plt>
mov    $0x0,%al
call   1190 <gconfig@plt>
xor    %edi,%edi
call   10e0 <polymode@plt>
cmpl   $0x0,-0x58(%rbp)
je     13f1 <main+0x131>
mov    $0x1,%edi
call   10e0 <polymode@plt>
cmpl   $0x0,-0x54(%rbp)
je     1405 <main+0x145>
mov    $0x1,%edi
call   1030 <backface@plt>
mov    $0x168,%edi
movsd  0xbfe(%rip),%xmm0
movsd  0xbfe(%rip),%xmm1
movsd  0xbfe(%rip),%xmm2
call   10b0 <perspective@plt>
xorps  %xmm5,%xmm5
movsd  0xbd6(%rip),%xmm2
xor    %edi,%edi
movaps %xmm5,%xmm0
movaps %xmm5,%xmm1
movaps %xmm5,%xmm3
movaps %xmm5,%xmm4
call   1080 <lookat@plt>
mov    $0x0,%al
call   10a0 <maketetra@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xe10,-0x38(%rbp)
jge    1843 <main+0x583>
xor    %edi,%edi
call   1130 <color@plt>
mov    $0x0,%al
call   11c0 <clear@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    1784 <main+0x4c4>
mov    -0x34(%rbp),%eax
movsd  0xb86(%rip),%xmm0
movsd  0xbb6(%rip),%xmm1
movsd  %xmm1,-0x70(%rbp)
cmp    $0x0,%eax
movsd  %xmm0,-0x68(%rbp)
jne    14af <main+0x1ef>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xb84(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   11b0 <translate@plt>
mov    -0x34(%rbp),%ecx
mov    $0x4,%edi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
call   1130 <color@plt>
mov    -0x40(%rbp),%eax
add    $0x3,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
cvtsi2ssl -0x38(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0xb29(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10f0 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    1540 <main+0x280>
mov    -0x44(%rbp),%eax
add    $0xe10,%eax
mov    %eax,-0x44(%rbp)
mov    $0x0,%al
call   11d0 <pushmatrix@plt>
mov    -0x38(%rbp),%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
mov    -0x38(%rbp),%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
mov    $0x0,%al
call   11d0 <pushmatrix@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   10c0 <circ@plt>
mov    $0x0,%al
call   1040 <popmatrix@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   11e0 <move@plt>
mov    $0x0,%al
call   11d0 <pushmatrix@plt>
mov    $0x1c2,%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
mov    $0x1c2,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xa66(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10f0 <sin@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xa79(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xa65(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0xa2c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1160 <cos@plt>
movsd  -0x88(%rbp),%xmm1
ff
cvtss2sd %xmm0,%xmm0
movsd  0xa37(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  0xa23(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xa17(%rip),%xmm0
call   1150 <scale@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x0,%al
call   1040 <popmatrix@plt>
mov    $0x0,%al
call   11d0 <pushmatrix@plt>
movss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0x9aa(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10f0 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x80(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0x979(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1160 <cos@plt>
movss  -0x7c(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x78(%rbp),%xmm0
addss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
call   11b0 <translate@plt>
xorps  %xmm1,%xmm1
movsd  0x954(%rip),%xmm2
movaps %xmm1,%xmm0
call   10c0 <circ@plt>
mov    $0x1c2,%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
mov    $0x1c2,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
xorps  %xmm1,%xmm1
movsd  0x923(%rip),%xmm2
movaps %xmm1,%xmm0
call   10c0 <circ@plt>
mov    -0x40(%rbp),%edi
mov    $0x79,%esi
call   1120 <rotate@plt>
movsd  0x916(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1150 <scale@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x384,%edi
mov    $0x79,%esi
call   1120 <rotate@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x0,%al
call   1040 <popmatrix@plt>
mov    $0x0,%al
call   1040 <popmatrix@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1475 <main+0x1b5>
movss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0x892(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x87e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1160 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x90(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0x84f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x83b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10f0 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x8c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    $0x0,%al
call   1140 <swapbuffers@plt>
mov    $0x0,%al
call   1050 <qtest@plt>
cmp    $0x0,%rax
je     1830 <main+0x570>
mov    $0x0,%al
call   1070 <gexit@plt>
xor    %edi,%edi
call   11a0 <exit@plt>
jmp    1835 <main+0x575>
mov    -0x3c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1453 <main+0x193>
jmp    1848 <main+0x588>
mov    $0x1,%al
test   $0x1,%al
jne    144c <main+0x18c>
jmp    1857 <main+0x597>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jl     1332 <main+0x72>
mov    %rsi,%r13
mov    %edi,%eax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
mov    $0x1,%r15d
mov    $0x1,%r12d
xor    %ebp,%ebp
xchg   %ax,%ax
mov    0x0(%r13,%r15,8),%rbx
mov    %rbx,%rdi
lea    0xd6d(%rip),%rsi
call   10d0 <strcmp@plt>
test   %eax,%eax
cmove  %r12d,%ebp
mov    %rbx,%rdi
lea    0xd5b(%rip),%rsi
call   10d0 <strcmp@plt>
test   %eax,%eax
cmove  %r12d,%r14d
add    $0x1,%r15
cmp    %r15,0x8(%rsp)
jne    12f0 <main+0x30>
test   %r14d,%r14d
sete   %bl
jmp    1336 <main+0x76>
mov    $0x1,%bl
xor    %ebp,%ebp
mov    $0x190,%edi
mov    $0x190,%esi
call   1180 <prefsize@plt>
lea    0xd26(%rip),%rdi
call   1110 <winopen@plt>
mov    $0x1b,%edi
call   1060 <qdevice@plt>
mov    $0x51,%edi
call   1060 <qdevice@plt>
mov    $0x106,%edi
call   1100 <unqdevice@plt>
xor    %eax,%eax
call   1170 <doublebuffer@plt>
xor    %eax,%eax
call   1190 <gconfig@plt>
xor    %edi,%edi
call   10e0 <polymode@plt>
test   %bl,%bl
jne    1392 <main+0xd2>
mov    $0x1,%edi
call   10e0 <polymode@plt>
test   %ebp,%ebp
je     13a0 <main+0xe0>
mov    $0x1,%edi
call   1030 <backface@plt>
movsd  0xc58(%rip),%xmm0
movsd  0xc58(%rip),%xmm1
movsd  0xc58(%rip),%xmm2
mov    $0x168,%edi
call   10b0 <perspective@plt>
movsd  0xc4e(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
xor    %edi,%edi
call   1080 <lookat@plt>
xor    %eax,%eax
call   10a0 <maketetra@plt>
movss  0xc71(%rip),%xmm0
xorps  %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
xor    %ebx,%ebx
movss  %xmm0,(%rsp)
nop
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
call   1130 <color@plt>
xor    %eax,%eax
call   11c0 <clear@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x10(%rsp)
divsd  0xbec(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%bpl
jmp    16a1 <main+0x3e1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   11b0 <translate@plt>
movzbl %bpl,%eax
and    $0x1,%eax
lea    (%rax,%rax,2),%edi
add    $0x1,%edi
call   1130 <color@plt>
mov    %ebx,%eax
add    $0x3,%eax
cltq
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %ebx,%ecx
add    $0x3,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
mov    %eax,%ebx
sub    %ecx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0xb79(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   10f0 <sin@plt>
xor    %eax,%eax
call   11d0 <pushmatrix@plt>
mov    %r14d,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
mov    %r14d,%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
xor    %eax,%eax
call   11d0 <pushmatrix@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
xorpd  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xb30(%rip),%xmm2
call   10c0 <circ@plt>
xor    %eax,%eax
call   1040 <popmatrix@plt>
xorpd  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   11e0 <move@plt>
xor    %eax,%eax
call   11d0 <pushmatrix@plt>
mov    $0x1c2,%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
mov    $0x1c2,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
movsd  0x20(%rsp),%xmm0
call   10f0 <sin@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xade(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xada(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1160 <cos@plt>
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
divsd  0xaae(%rip),%xmm2
movsd  0xaae(%rip),%xmm0
addsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm1
call   1150 <scale@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
xor    %eax,%eax
call   1040 <popmatrix@plt>
xor    %eax,%eax
call   11d0 <pushmatrix@plt>
movsd  0x8(%rsp),%xmm0
call   10f0 <sin@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1160 <cos@plt>
movaps %xmm0,%xmm2
addss  (%rsp),%xmm2
xorps  %xmm1,%xmm1
movss  0x18(%rsp),%xmm0
call   11b0 <translate@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xa30(%rip),%xmm2
call   10c0 <circ@plt>
mov    $0x1c2,%edi
mov    $0x7a,%esi
call   1120 <rotate@plt>
mov    $0x1c2,%edi
mov    $0x78,%esi
call   1120 <rotate@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0x9ff(%rip),%xmm2
call   10c0 <circ@plt>
mov    %ebx,%edi
mov    $0x79,%esi
call   1120 <rotate@plt>
movsd  0x9ee(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1150 <scale@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
mov    $0x384,%edi
mov    $0x79,%esi
call   1120 <rotate@plt>
mov    $0x1,%edi
call   1090 <callobj@plt>
xor    %eax,%eax
call   1040 <popmatrix@plt>
xor    %eax,%eax
call   1040 <popmatrix@plt>
test   $0x1,%bpl
mov    $0x0,%ebp
je     16c0 <main+0x400>
movss  0x9bb(%rip),%xmm0
test   $0x1,%bpl
jne    1450 <main+0x190>
movss  0x9ad(%rip),%xmm0
jmp    1450 <main+0x190>
movsd  0x10(%rsp),%xmm0
mulsd  0x982(%rip),%xmm0
divsd  0x982(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1160 <cos@plt>
movss  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   10f0 <sin@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1140 <swapbuffers@plt>
xor    %eax,%eax
call   1050 <qtest@plt>
test   %rax,%rax
jne    1749 <main+0x489>
movss  0x94e(%rip),%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  (%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
lea    0x2(%r14),%eax
cmp    $0xe0e,%r14d
mov    %eax,%r14d
jb     1410 <main+0x150>
jmp    1400 <main+0x140>
xor    %eax,%eax
call   1070 <gexit@plt>
xor    %edi,%edi
call   11a0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-b\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [6 x i8] c"tetra\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 2, i32* %9
store i32 0, i32* %10
store float 3.000000e+00, float* %12
store float 0.000000e+00, float* %13
%18 = load float, float* %12
store float %18, float* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 1, i32* %7
br label %19
19: ; preds = %42, %2
%20 = load i32, i32* %7
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %45
23: ; preds = %19
%24 = load i8**, i8*** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %23
store i32 1, i32* %15
br label %32
32: ; preds = %31, %23
%33 = load i8**, i8*** %5
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %32
store i32 1, i32* %16
br label %41
41: ; preds = %40, %32
br label %42
42: ; preds = %41
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %19
45: ; preds = %19
%46 = call i32 @prefsize(i64 400, i64 400)
%47 = call i32 @winopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%48 = call i32 @qdevice(i8 signext 27)
%49 = call i32 @qdevice(i8 signext 81)
%50 = call i32 @unqdevice(i32 262)
%51 = call i32 (...) @doublebuffer()
%52 = call i32 (...) @gconfig()
%53 = call i32 @polymode(i32 0)
%54 = load i32, i32* %16
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %45
%57 = call i32 @polymode(i32 1)
br label %58
58: ; preds = %56, %45
%59 = load i32, i32* %15
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 @backface(i32 1)
br label %63
63: ; preds = %61, %58
%64 = call i32 @perspective(i32 360, double 1.000000e+00, double 1.000000e-03, double 1.500000e+01)
%65 = call i32 @lookat(double 0.000000e+00, double 0.000000e+00, double 9.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, i32 0)
%66 = call i32 (...) @maketetra()
br label %67
67: ; preds = %197, %63
store i32 0, i32* %8
br label %68
68: ; preds = %192, %67
%69 = load i32, i32* %8
%70 = icmp slt i32 %69, 3600
br i1 %70, label %71, label %196
71: ; preds = %68
%72 = call i32 @color(i32 0)
%73 = call i32 (...) @clear()
store i32 0, i32* %7
br label %74
74: ; preds = %167, %71
%75 = load i32, i32* %7
%76 = icmp slt i32 %75, 2
br i1 %76, label %77, label %170
77: ; preds = %74
%78 = load i32, i32* %7
%79 = icmp ne i32 %78, 0
%80 = zext i1 %79 to i64
%81 = select i1 %79, double 1.000000e+00, double -1.000000e+00
%82 = fmul double %81, 1.000000e-01
%83 = fptrunc double %82 to float
%84 = call i32 @translate(float %83, double 0.000000e+00, float 0.000000e+00)
%85 = load i32, i32* %7
%86 = icmp ne i32 %85, 0
%87 = zext i1 %86 to i64
%88 = select i1 %86, i32 1, i32 4
%89 = call i32 @color(i32 %88)
%90 = load i32, i32* %10
%91 = add nsw i32 %90, 3
%92 = srem i32 %91, 3600
store i32 %92, i32* %10
%93 = load i32, i32* %8
%94 = sitofp i32 %93 to float
%95 = load i32, i32* %10
%96 = sitofp i32 %95 to double
%97 = fdiv double %96, 1.800000e+03
%98 = call float @sin(double %97)
%99 = fmul float %94, %98
%100 = fptosi float %99 to i32
store i32 %100, i32* %11
%101 = load i32, i32* %11
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %77
%104 = load i32, i32* %11
%105 = add nsw i32 %104, 3600
store i32 %105, i32* %11
br label %106
106: ; preds = %103, %77
%107 = call i32 (...) @pushmatrix()
%108 = load i32, i32* %8
%109 = call i32 @rotate(i32 %108, i8 signext 120)
%110 = load i32, i32* %8
%111 = call i32 @rotate(i32 %110, i8 signext 122)
%112 = call i32 (...) @pushmatrix()
%113 = call i32 @rotate(i32 900, i8 signext 120)
%114 = load float, float* %12
%115 = fpext float %114 to double
%116 = call i32 @circ(double 0.000000e+00, double 0.000000e+00, double %115)
%117 = call i32 (...) @popmatrix()
%118 = call i32 @move(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%119 = call i32 (...) @pushmatrix()
%120 = call i32 @rotate(i32 450, i8 signext 122)
%121 = call i32 @rotate(i32 450, i8 signext 120)
%122 = load i32, i32* %8
%123 = sitofp i32 %122 to double
%124 = fdiv double %123, 1.800000e+03
%125 = call float @sin(double %124)
%126 = fpext float %125 to double
%127 = fdiv double %126, 2.000000e+01
%128 = fadd double 4.000000e-01, %127
%129 = load i32, i32* %10
%130 = sitofp i32 %129 to double
%131 = fdiv double %130, 1.800000e+03
%132 = call float @cos(double %131)
%133 = fpext float %132 to double
%134 = fdiv double %133, 2.000000e+01
%135 = fadd double 4.000000e-01, %134
%136 = call i32 @scale(double 4.000000e-01, double %128, double %135)
%137 = call i32 @callobj(i64 1)
%138 = call i32 @rotate(i32 900, i8 signext 120)
%139 = call i32 @callobj(i64 1)
%140 = call i32 (...) @popmatrix()
%141 = call i32 (...) @pushmatrix()
%142 = load float, float* %13
%143 = load i32, i32* %10
%144 = sitofp i32 %143 to double
%145 = fdiv double %144, 1.800000e+03
%146 = call float @sin(double %145)
%147 = fadd float %142, %146
%148 = load float, float* %14
%149 = load i32, i32* %10
%150 = sitofp i32 %149 to double
%151 = fdiv double %150, 1.800000e+03
%152 = call float @cos(double %151)
%153 = fadd float %148, %152
%154 = call i32 @translate(float %147, double 0.000000e+00, float %153)
%155 = call i32 @circ(double 0.000000e+00, double 0.000000e+00, double 1.000000e-01)
%156 = call i32 @rotate(i32 450, i8 signext 122)
%157 = call i32 @rotate(i32 450, i8 signext 120)
%158 = call i32 @circ(double 0.000000e+00, double 0.000000e+00, double 1.000000e-01)
%159 = load i32, i32* %10
%160 = call i32 @rotate(i32 %159, i8 signext 121)
%161 = call i32 @scale(double 2.000000e-01, double 2.000000e-01, double 2.000000e-01)
%162 = call i32 @callobj(i64 1)
%163 = call i32 @rotate(i32 900, i8 signext 121)
%164 = call i32 @callobj(i64 1)
%165 = call i32 (...) @popmatrix()
%166 = call i32 (...) @popmatrix()
br label %167
167: ; preds = %106
%168 = load i32, i32* %7
%169 = add nsw i32 %168, 1
store i32 %169, i32* %7
br label %74
170: ; preds = %74
%171 = load float, float* %12
%172 = load i32, i32* %8
%173 = sitofp i32 %172 to double
%174 = fmul double %173, 0x400921FB54411744
%175 = fdiv double %174, 1.800000e+02
%176 = call float @cos(double %175)
%177 = fmul float %171, %176
store float %177, float* %14
%178 = load float, float* %12
%179 = load i32, i32* %8
%180 = sitofp i32 %179 to double
%181 = fmul double %180, 0x400921FB54411744
%182 = fdiv double %181, 1.800000e+02
%183 = call float @sin(double %182)
%184 = fmul float %178, %183
store float %184, float* %13
%185 = call i32 (...) @swapbuffers()
%186 = call i64 (...) @qtest()
%187 = icmp ne i64 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %170
%189 = call i32 (...) @gexit()
%190 = call i32 @exit(i32 0)
unreachable
191: ; preds = %170
br label %192
192: ; preds = %191
%193 = load i32, i32* %9
%194 = load i32, i32* %8
%195 = add nsw i32 %194, %193
store i32 %195, i32* %8
br label %68
196: ; preds = %68
br label %197
197: ; preds = %196
br i1 true, label %67, label %198
198: ; preds = %197
%199 = load i32, i32* %3
ret i32 %199
}

LLVM IR (-O2):
@.str = [3 x i8] c"-b\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [6 x i8] c"tetra\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %22
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %18, %6 ]
%8 = phi i32 [ 0, %4 ], [ %17, %6 ]
%9 = phi i32 [ 0, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %7
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 1, i32 %9
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 1, i32 %8
%18 = add nuw nsw i64 %7, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %20, label %6
20: ; preds = %6
%21 = icmp eq i32 %17, 0
br label %22
22: ; preds = %20, %2
%23 = phi i32 [ 0, %2 ], [ %14, %20 ]
%24 = phi i1 [ true, %2 ], [ %21, %20 ]
%25 = tail call i32 @prefsize(i64 400, i64 400)
%26 = tail call i32 @winopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%27 = tail call i32 @qdevice(i8 signext 27)
%28 = tail call i32 @qdevice(i8 signext 81)
%29 = tail call i32 @unqdevice(i32 262)
%30 = tail call i32 (...) @doublebuffer()
%31 = tail call i32 (...) @gconfig()
%32 = tail call i32 @polymode(i32 0)
br i1 %24, label %35, label %33
33: ; preds = %22
%34 = tail call i32 @polymode(i32 1)
br label %35
35: ; preds = %33, %22
%36 = icmp eq i32 %23, 0
br i1 %36, label %39, label %37
37: ; preds = %35
%38 = tail call i32 @backface(i32 1)
br label %39
39: ; preds = %37, %35
%40 = tail call i32 @perspective(i32 360, double 1.000000e+00, double 1.000000e-03, double 1.500000e+01)
%41 = tail call i32 @lookat(double 0.000000e+00, double 0.000000e+00, double 9.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, i32 0)
%42 = tail call i32 (...) @maketetra()
br label %43
43: ; preds = %120, %39
%44 = phi i32 [ 0, %39 ], [ %64, %120 ]
%45 = phi float [ 0.000000e+00, %39 ], [ %121, %120 ]
%46 = phi float [ 3.000000e+00, %39 ], [ %122, %120 ]
br label %47
47: ; preds = %43, %120
%48 = phi float [ %46, %43 ], [ %122, %120 ]
%49 = phi float [ %45, %43 ], [ %121, %120 ]
%50 = phi i32 [ 0, %43 ], [ %123, %120 ]
%51 = phi i32 [ %44, %43 ], [ %64, %120 ]
%52 = tail call i32 @color(i32 0)
%53 = tail call i32 (...) @clear()
%54 = sitofp i32 %50 to double
%55 = fdiv double %54, 1.800000e+03
br label %56
56: ; preds = %47, %56
%57 = phi i1 [ true, %47 ], [ false, %56 ]
%58 = phi i32 [ %51, %47 ], [ %64, %56 ]
%59 = select i1 %57, float 0xBFB99999A0000000, float 0x3FB99999A0000000
%60 = tail call i32 @translate(float %59, double 0.000000e+00, float 0.000000e+00)
%61 = select i1 %57, i32 4, i32 1
%62 = tail call i32 @color(i32 %61)
%63 = add nsw i32 %58, 3
%64 = srem i32 %63, 3600
%65 = sitofp i32 %64 to double
%66 = fdiv double %65, 1.800000e+03
%67 = tail call float @sin(double %66)
%68 = tail call i32 (...) @pushmatrix()
%69 = tail call i32 @rotate(i32 %50, i8 signext 120)
%70 = tail call i32 @rotate(i32 %50, i8 signext 122)
%71 = tail call i32 (...) @pushmatrix()
%72 = tail call i32 @rotate(i32 900, i8 signext 120)
%73 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, double 3.000000e+00)
%74 = tail call i32 (...) @popmatrix()
%75 = tail call i32 @move(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%76 = tail call i32 (...) @pushmatrix()
%77 = tail call i32 @rotate(i32 450, i8 signext 122)
%78 = tail call i32 @rotate(i32 450, i8 signext 120)
%79 = tail call float @sin(double %55)
%80 = fpext float %79 to double
%81 = fdiv double %80, 2.000000e+01
%82 = fadd double %81, 4.000000e-01
%83 = tail call float @cos(double %66)
%84 = fpext float %83 to double
%85 = fdiv double %84, 2.000000e+01
%86 = fadd double %85, 4.000000e-01
%87 = tail call i32 @scale(double 4.000000e-01, double %82, double %86)
%88 = tail call i32 @callobj(i64 1)
%89 = tail call i32 @rotate(i32 900, i8 signext 120)
%90 = tail call i32 @callobj(i64 1)
%91 = tail call i32 (...) @popmatrix()
%92 = tail call i32 (...) @pushmatrix()
%93 = tail call float @sin(double %66)
%94 = fadd float %49, %93
%95 = tail call float @cos(double %66)
%96 = fadd float %48, %95
%97 = tail call i32 @translate(float %94, double 0.000000e+00, float %96)
%98 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, double 1.000000e-01)
%99 = tail call i32 @rotate(i32 450, i8 signext 122)
%100 = tail call i32 @rotate(i32 450, i8 signext 120)
%101 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, double 1.000000e-01)
%102 = tail call i32 @rotate(i32 %64, i8 signext 121)
%103 = tail call i32 @scale(double 2.000000e-01, double 2.000000e-01, double 2.000000e-01)
%104 = tail call i32 @callobj(i64 1)
%105 = tail call i32 @rotate(i32 900, i8 signext 121)
%106 = tail call i32 @callobj(i64 1)
%107 = tail call i32 (...) @popmatrix()
%108 = tail call i32 (...) @popmatrix()
br i1 %57, label %56, label %109
109: ; preds = %56
%110 = fmul double %54, 0x400921FB54411744
%111 = fdiv double %110, 1.800000e+02
%112 = tail call float @cos(double %111)
%113 = tail call float @sin(double %111)
%114 = tail call i32 (...) @swapbuffers()
%115 = tail call i64 (...) @qtest()
%116 = icmp eq i64 %115, 0
br i1 %116, label %120, label %117
117: ; preds = %109
%118 = tail call i32 (...) @gexit()
%119 = tail call i32 @exit(i32 0)
unreachable
120: ; preds = %109
%121 = fmul float %113, 3.000000e+00
%122 = fmul float %112, 3.000000e+00
%123 = add nuw nsw i32 %50, 2
%124 = icmp ult i32 %50, 3598
br i1 %124, label %47, label %43
}