#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*/ circ(double, double, float);
int /*<<< orphan*/ closeobj();
double cos(double);
int /*<<< orphan*/ makeobj(int);
int /*<<< orphan*/ popmatrix();
int /*<<< orphan*/ pushmatrix();
int /*<<< orphan*/ rotate(int, char);
double sin(double);
int /*<<< orphan*/ translate(double, double, float);
makesphere() {
  float r, z;
  int i, a;
  makeobj(1);
  for (i = 0; i < 1800; i += 200) {
    pushmatrix();
    rotate(i, 'y');
    circ(0.0, 0.0, 10.0);
    popmatrix();
  }
  pushmatrix();
  rotate(900, 'x');
  for (a = -900; a < 900; a += 200) {
    r = 10.0 * cos((double)a * 3.14159265358979 / 180.0);
    z = 10.0 * sin((double)a * 3.14159265358979 / 180.0);
    pushmatrix();
    translate(0.0, 0.0, -z);
    circ(0.0, 0.0, r);
    popmatrix();
  }
  popmatrix();
  closeobj();
}


x86 assembly (clang, -O0):
<makesphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
call   1080 <makeobj@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x708,-0x10(%rbp)
jge    11f4 <makesphere+0x64>
mov    $0x0,%al
call   10b0 <pushmatrix@plt>
mov    -0x10(%rbp),%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm1,%xmm1
movss  0xe43(%rip),%xmm2
movaps %xmm1,%xmm0
call   1050 <circ@plt>
mov    $0x0,%al
call   1030 <popmatrix@plt>
mov    -0x10(%rbp),%eax
add    $0xc8,%eax
mov    %eax,-0x10(%rbp)
jmp    11a9 <makesphere+0x19>
mov    $0x0,%al
call   10b0 <pushmatrix@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1070 <rotate@plt>
movl   $0xfffffc7c,-0x14(%rbp)
cmpl   $0x384,-0x14(%rbp)
jge    12dd <makesphere+0x14d>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xde5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1090 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xdb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xdab(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd97(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xd7b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   10b0 <pushmatrix@plt>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   10a0 <translate@plt>
movss  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1050 <circ@plt>
mov    $0x0,%al
call   1030 <popmatrix@plt>
mov    -0x14(%rbp),%eax
add    $0xc8,%eax
mov    %eax,-0x14(%rbp)
jmp    1211 <makesphere+0x81>
mov    $0x0,%al
call   1030 <popmatrix@plt>
mov    $0x0,%al
call   1040 <closeobj@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makesphere>:
push   %rbx
sub    $0x30,%rsp
mov    $0x1,%edi
call   1080 <makeobj@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
xor    %edi,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
movss  0xe46(%rip),%xmm2
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0xc8,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xe0e(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x190,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xddd(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x258,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xdac(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x320,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xd7b(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x3e8,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xd4a(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x4b0,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xd19(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x578,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xce8(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x640,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xcb7(%rip),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1070 <rotate@plt>
movsd  0xc95(%rip),%xmm0
mov    $0xfffffbb4,%ebx
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x28(%rsp)
mulsd  0xc82(%rip),%xmm0
divsd  0xc82(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1090 <cos@plt>
movsd  0xc77(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0xc56(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  0xc5b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
xor    %eax,%eax
call   10b0 <pushmatrix@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movaps 0x10(%rsp),%xmm2
call   10a0 <translate@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
call   1050 <circ@plt>
xor    %eax,%eax
call   1030 <popmatrix@plt>
movsd  0x28(%rsp),%xmm0
addsd  0xc0f(%rip),%xmm0
add    $0xc8,%ebx
cmp    $0x2bc,%ebx
jl     1380 <makesphere+0x1f0>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
jmp    1040 <closeobj@plt>

LLVM IR (-O0):
define i32 @makesphere() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @makeobj(i32 1)
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 1800
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = call i32 (...) @pushmatrix()
%12 = load i32, i32* %4
%13 = call i32 @rotate(i32 %12, i8 signext 121)
%14 = call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%15 = call i32 (...) @popmatrix()
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 200
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = call i32 (...) @pushmatrix()
%21 = call i32 @rotate(i32 900, i8 signext 120)
store i32 -900, i32* %5
br label %22
22: ; preds = %47, %19
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 900
br i1 %24, label %25, label %50
25: ; preds = %22
%26 = load i32, i32* %5
%27 = sitofp i32 %26 to double
%28 = fmul double %27, 0x400921FB54442D11
%29 = fdiv double %28, 1.800000e+02
%30 = call double @cos(double %29)
%31 = fmul double 1.000000e+01, %30
%32 = fptrunc double %31 to float
store float %32, float* %2
%33 = load i32, i32* %5
%34 = sitofp i32 %33 to double
%35 = fmul double %34, 0x400921FB54442D11
%36 = fdiv double %35, 1.800000e+02
%37 = call double @sin(double %36)
%38 = fmul double 1.000000e+01, %37
%39 = fptrunc double %38 to float
store float %39, float* %3
%40 = call i32 (...) @pushmatrix()
%41 = load float, float* %3
%42 = fneg float %41
%43 = call i32 @translate(double 0.000000e+00, double 0.000000e+00, float %42)
%44 = load float, float* %2
%45 = call i32 @circ(double 0.000000e+00, double 0.000000e+00, float %44)
%46 = call i32 (...) @popmatrix()
br label %47
47: ; preds = %25
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 200
store i32 %49, i32* %5
br label %22
50: ; preds = %22
%51 = call i32 (...) @popmatrix()
%52 = call i32 (...) @closeobj()
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
define i32 @makesphere() {
%1 = tail call i32 @makeobj(i32 1)
%2 = tail call i32 (...) @pushmatrix()
%3 = tail call i32 @rotate(i32 0, i8 signext 121)
%4 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%5 = tail call i32 (...) @popmatrix()
%6 = tail call i32 (...) @pushmatrix()
%7 = tail call i32 @rotate(i32 200, i8 signext 121)
%8 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%9 = tail call i32 (...) @popmatrix()
%10 = tail call i32 (...) @pushmatrix()
%11 = tail call i32 @rotate(i32 400, i8 signext 121)
%12 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%13 = tail call i32 (...) @popmatrix()
%14 = tail call i32 (...) @pushmatrix()
%15 = tail call i32 @rotate(i32 600, i8 signext 121)
%16 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%17 = tail call i32 (...) @popmatrix()
%18 = tail call i32 (...) @pushmatrix()
%19 = tail call i32 @rotate(i32 800, i8 signext 121)
%20 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%21 = tail call i32 (...) @popmatrix()
%22 = tail call i32 (...) @pushmatrix()
%23 = tail call i32 @rotate(i32 1000, i8 signext 121)
%24 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%25 = tail call i32 (...) @popmatrix()
%26 = tail call i32 (...) @pushmatrix()
%27 = tail call i32 @rotate(i32 1200, i8 signext 121)
%28 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%29 = tail call i32 (...) @popmatrix()
%30 = tail call i32 (...) @pushmatrix()
%31 = tail call i32 @rotate(i32 1400, i8 signext 121)
%32 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%33 = tail call i32 (...) @popmatrix()
%34 = tail call i32 (...) @pushmatrix()
%35 = tail call i32 @rotate(i32 1600, i8 signext 121)
%36 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float 1.000000e+01)
%37 = tail call i32 (...) @popmatrix()
%38 = tail call i32 (...) @pushmatrix()
%39 = tail call i32 @rotate(i32 900, i8 signext 120)
br label %40
40: ; preds = %0, %40
%41 = phi i32 [ -900, %0 ], [ %56, %40 ]
%42 = sitofp i32 %41 to double
%43 = fmul double %42, 0x400921FB54442D11
%44 = fdiv double %43, 1.800000e+02
%45 = tail call double @cos(double %44)
%46 = fmul double %45, 1.000000e+01
%47 = fptrunc double %46 to float
%48 = tail call double @sin(double %44)
%49 = fmul double %48, 1.000000e+01
%50 = fptrunc double %49 to float
%51 = tail call i32 (...) @pushmatrix()
%52 = fneg float %50
%53 = tail call i32 @translate(double 0.000000e+00, double 0.000000e+00, float %52)
%54 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float %47)
%55 = tail call i32 (...) @popmatrix()
%56 = add nsw i32 %41, 200
%57 = icmp slt i32 %41, 700
br i1 %57, label %40, label %58
58: ; preds = %40
%59 = tail call i32 (...) @popmatrix()
%60 = tail call i32 (...) @closeobj()
ret i32 undef
}