#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*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glTranslated(int, double, int);
int /*<<< orphan*/ glutSolidCube(double);
int /*<<< orphan*/ tableLeg(double, double);
void table(double topWid, double topThick, double legThick, double legLen) {
  glPushMatrix();
  glTranslated(0, legLen, 0);
  glScaled(topWid, topThick, topWid);
  glutSolidCube(1.0);
  glPopMatrix();
  double dist = 0.95 * topWid / 2.0 - legThick / 2.0;
  glPushMatrix();
  glTranslated(dist, 0, dist);
  tableLeg(legThick, legLen);
  glTranslated(0.0, 0.0, -2 * dist);
  tableLeg(legThick, legLen);
  glTranslated(-2 * dist, 0, 2 * dist);
  tableLeg(legThick, legLen);
  glTranslated(0, 0, -2 * dist);
  tableLeg(legThick, legLen);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  -0x20(%rbp),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1080 <glTranslated@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
call   1050 <glScaled@plt>
movsd  0xe6b(%rip),%xmm0
call   1030 <glutSolidCube@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
movsd  0xe4f(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe3a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe29(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
cvttsd2si -0x28(%rbp),%edi
cvttsd2si -0x28(%rbp),%esi
xorps  %xmm0,%xmm0
call   1080 <glTranslated@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1070 <tableLeg@plt>
movsd  0xde4(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%esi
xor    %edi,%edi
xorps  %xmm0,%xmm0
call   1080 <glTranslated@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1070 <tableLeg@plt>
movsd  0xdba(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xdb1(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%esi
xorps  %xmm0,%xmm0
call   1080 <glTranslated@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1070 <tableLeg@plt>
movsd  0xd81(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%esi
xor    %edi,%edi
xorps  %xmm0,%xmm0
call   1080 <glTranslated@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1070 <tableLeg@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
xor    %edi,%edi
movsd  0x10(%rsp),%xmm0
xor    %esi,%esi
call   1080 <glTranslated@plt>
movsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movaps %xmm0,%xmm2
call   1050 <glScaled@plt>
movsd  0xe53(%rip),%xmm0
call   1030 <glutSolidCube@plt>
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
movsd  (%rsp),%xmm1
mulsd  0xe42(%rip),%xmm1
movsd  0xe42(%rip),%xmm0
mulsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
cvttsd2si (%rsp),%edi
xorpd  %xmm0,%xmm0
mov    %edi,%esi
call   1080 <glTranslated@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <tableLeg@plt>
movsd  0xe07(%rip),%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%ebx
xorpd  %xmm0,%xmm0
xor    %edi,%edi
mov    %ebx,%esi
call   1080 <glTranslated@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <tableLeg@plt>
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%esi
xorpd  %xmm0,%xmm0
mov    %ebx,%edi
call   1080 <glTranslated@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <tableLeg@plt>
xorps  %xmm0,%xmm0
xor    %edi,%edi
mov    %ebx,%esi
call   1080 <glTranslated@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <tableLeg@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @table(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = call i32 (...) @glPushMatrix()
%11 = load double, double* %8
%12 = call i32 @glTranslated(i32 0, double %11, i32 0)
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %5
%16 = call i32 @glScaled(double %13, double %14, double %15)
%17 = call i32 @glutSolidCube(double 1.000000e+00)
%18 = call i32 (...) @glPopMatrix()
%19 = load double, double* %5
%20 = fmul double 0x3FEE666666666666, %19
%21 = fdiv double %20, 2.000000e+00
%22 = load double, double* %7
%23 = fdiv double %22, 2.000000e+00
%24 = fsub double %21, %23
store double %24, double* %9
%25 = call i32 (...) @glPushMatrix()
%26 = load double, double* %9
%27 = fptosi double %26 to i32
%28 = load double, double* %9
%29 = fptosi double %28 to i32
%30 = call i32 @glTranslated(i32 %27, double 0.000000e+00, i32 %29)
%31 = load double, double* %7
%32 = load double, double* %8
%33 = call i32 @tableLeg(double %31, double %32)
%34 = load double, double* %9
%35 = fmul double -2.000000e+00, %34
%36 = fptosi double %35 to i32
%37 = call i32 @glTranslated(i32 0, double 0.000000e+00, i32 %36)
%38 = load double, double* %7
%39 = load double, double* %8
%40 = call i32 @tableLeg(double %38, double %39)
%41 = load double, double* %9
%42 = fmul double -2.000000e+00, %41
%43 = fptosi double %42 to i32
%44 = load double, double* %9
%45 = fmul double 2.000000e+00, %44
%46 = fptosi double %45 to i32
%47 = call i32 @glTranslated(i32 %43, double 0.000000e+00, i32 %46)
%48 = load double, double* %7
%49 = load double, double* %8
%50 = call i32 @tableLeg(double %48, double %49)
%51 = load double, double* %9
%52 = fmul double -2.000000e+00, %51
%53 = fptosi double %52 to i32
%54 = call i32 @glTranslated(i32 0, double 0.000000e+00, i32 %53)
%55 = load double, double* %7
%56 = load double, double* %8
%57 = call i32 @tableLeg(double %55, double %56)
%58 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @table(double %0, double %1, double %2, double %3) {
%5 = tail call i32 (...) @glPushMatrix()
%6 = tail call i32 @glTranslated(i32 0, double %3, i32 0)
%7 = tail call i32 @glScaled(double %0, double %1, double %0)
%8 = tail call i32 @glutSolidCube(double 1.000000e+00)
%9 = tail call i32 (...) @glPopMatrix()
%10 = fmul double %0, 0x3FEE666666666666
%11 = fmul double %10, 5.000000e-01
%12 = fmul double %2, 5.000000e-01
%13 = fsub double %11, %12
%14 = tail call i32 (...) @glPushMatrix()
%15 = fptosi double %13 to i32
%16 = tail call i32 @glTranslated(i32 %15, double 0.000000e+00, i32 %15)
%17 = tail call i32 @tableLeg(double %2, double %3)
%18 = fmul double %13, -2.000000e+00
%19 = fptosi double %18 to i32
%20 = tail call i32 @glTranslated(i32 0, double 0.000000e+00, i32 %19)
%21 = tail call i32 @tableLeg(double %2, double %3)
%22 = fmul double %13, 2.000000e+00
%23 = fptosi double %22 to i32
%24 = tail call i32 @glTranslated(i32 %19, double 0.000000e+00, i32 %23)
%25 = tail call i32 @tableLeg(double %2, double %3)
%26 = tail call i32 @glTranslated(i32 0, double 0.000000e+00, i32 %19)
%27 = tail call i32 @tableLeg(double %2, double %3)
%28 = tail call i32 (...) @glPopMatrix()
ret void
}