#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(long);
int /*<<< orphan*/ popmatrix();
int /*<<< orphan*/ pushmatrix();
int /*<<< orphan*/ rotate(int, char);
double sin(double);
int /*<<< orphan*/ translate(double, double, float);
void makesphere() {
  float i, r, z, a;
  makeobj(1L);
  for (i = 0; i < 180; i += 20) {
    pushmatrix();
    rotate((int)i * 10, 'y');
    circ(0.0, 0.0, 10.0);
    popmatrix();
  }
  pushmatrix();
  rotate(900, 'x');
  for (a = -90.0; a < 90.0; a += 20.0) {
    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    $0x10,%rsp
mov    $0x1,%edi
call   1080 <makeobj@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe4e(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1206 <makesphere+0x76>
mov    $0x0,%al
call   10b0 <pushmatrix@plt>
cvttss2si -0x4(%rbp),%eax
imul   $0xa,%eax,%edi
mov    $0x79,%esi
call   1070 <rotate@plt>
xorps  %xmm1,%xmm1
movss  0xe28(%rip),%xmm2
movaps %xmm1,%xmm0
call   1050 <circ@plt>
mov    $0x0,%al
call   1030 <popmatrix@plt>
movss  0xe15(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11aa <makesphere+0x1a>
mov    $0x0,%al
call   10b0 <pushmatrix@plt>
mov    $0x384,%edi
mov    $0x78,%esi
call   1070 <rotate@plt>
movss  0xde0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdd6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    131e <makesphere+0x18e>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1090 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xda3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd81(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xd65(%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>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd24(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1229 <makesphere+0x99>
mov    $0x0,%al
call   1030 <popmatrix@plt>
mov    $0x0,%al
call   1040 <closeobj@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makesphere>:
push   %rbx
sub    $0x20,%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>
mov    $0xffffff92,%ebx
add    $0x14,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
cvtss2sd %xmm0,%xmm0
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  0xc53(%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>
cmp    $0x46,%ebx
jl     1370 <makesphere+0x1e0>
xor    %eax,%eax
call   1030 <popmatrix@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <closeobj@plt>

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

LLVM IR (-O2):
define void @makesphere() {
%1 = tail call i32 @makeobj(i64 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 [ -90, %0 ], [ %57, %40 ]
%42 = sitofp i32 %41 to float
%43 = fpext float %42 to double
%44 = fmul double %43, 0x400921FB54442D11
%45 = fdiv double %44, 1.800000e+02
%46 = tail call double @cos(double %45)
%47 = fmul double %46, 1.000000e+01
%48 = fptrunc double %47 to float
%49 = tail call double @sin(double %45)
%50 = fmul double %49, 1.000000e+01
%51 = fptrunc double %50 to float
%52 = tail call i32 (...) @pushmatrix()
%53 = fneg float %51
%54 = tail call i32 @translate(double 0.000000e+00, double 0.000000e+00, float %53)
%55 = tail call i32 @circ(double 0.000000e+00, double 0.000000e+00, float %48)
%56 = tail call i32 (...) @popmatrix()
%57 = add nsw i32 %41, 20
%58 = icmp slt i32 %41, 70
br i1 %58, label %40, label %59
59: ; preds = %40
%60 = tail call i32 (...) @popmatrix()
%61 = tail call i32 (...) @closeobj()
ret void
}