#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 */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ drawtriangle(int, int, int, int /*<<< orphan*/ *,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void octahedron(GLdouble p0[3], GLdouble radius, GLenum shadeType) {
  int i;
  for (i = 0; i < 8; i++)
    drawtriangle(i, 1, 1, p0, radius, shadeType, 0);
}


x86 assembly (clang, -O0):
<octahedron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1165 <octahedron+0x55>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    $0x1,%edx
xor    %eax,%eax
mov    %edx,%esi
movl   $0x0,(%rsp)
call   1030 <drawtriangle@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <octahedron+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octahedron>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @octahedron(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @drawtriangle(i32 %12, i32 1, i32 1, i32* %13, i32 %14, i32 %15, i32 0)
br label %17
17: ; preds = %11
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @octahedron(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @drawtriangle(i32 0, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%5 = tail call i32 @drawtriangle(i32 1, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%6 = tail call i32 @drawtriangle(i32 2, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%7 = tail call i32 @drawtriangle(i32 3, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%8 = tail call i32 @drawtriangle(i32 4, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%9 = tail call i32 @drawtriangle(i32 5, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%10 = tail call i32 @drawtriangle(i32 6, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%11 = tail call i32 @drawtriangle(i32 7, i32 1, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
ret void
}