#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 */
struct matrix {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_point(struct matrix *, double, double, double);
void add_polygon(struct matrix *polygons, double x0, double y0, double z0,
                 double x1, double y1, double z1, double x2, double y2,
                 double z2) {
  add_point(polygons, x0, y0, z0);
  add_point(polygons, x1, y1, z1);
  add_point(polygons, x2, y2, z2);
}


x86 assembly (clang, -O0):
<add_polygon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  0x10(%rbp),%xmm8
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <add_point@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1030 <add_point@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0x10(%rbp),%xmm2
call   1030 <add_point@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_polygon>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm7,0x28(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,(%rsp)
mov    %rdi,%rbx
movsd  0x40(%rsp),%xmm3
movsd  %xmm3,0x10(%rsp)
call   1030 <add_point@plt>
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <add_point@plt>
mov    %rbx,%rdi
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
add    $0x30,%rsp
pop    %rbx
jmp    1030 <add_point@plt>

LLVM IR (-O0):
%struct.matrix = type { i32 }
define void @add_polygon(%struct.matrix* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = alloca %struct.matrix*
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store %struct.matrix* %0, %struct.matrix** %11
store double %1, double* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store double %7, double* %18
store double %8, double* %19
store double %9, double* %20
%21 = load %struct.matrix*, %struct.matrix** %11
%22 = load double, double* %12
%23 = load double, double* %13
%24 = load double, double* %14
%25 = call i32 @add_point(%struct.matrix* %21, double %22, double %23, double %24)
%26 = load %struct.matrix*, %struct.matrix** %11
%27 = load double, double* %15
%28 = load double, double* %16
%29 = load double, double* %17
%30 = call i32 @add_point(%struct.matrix* %26, double %27, double %28, double %29)
%31 = load %struct.matrix*, %struct.matrix** %11
%32 = load double, double* %18
%33 = load double, double* %19
%34 = load double, double* %20
%35 = call i32 @add_point(%struct.matrix* %31, double %32, double %33, double %34)
ret void
}

LLVM IR (-O2):
%struct.matrix = type { i32 }
define void @add_polygon(%struct.matrix* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = tail call i32 @add_point(%struct.matrix* %0, double %1, double %2, double %3)
%12 = tail call i32 @add_point(%struct.matrix* %0, double %4, double %5, double %6)
%13 = tail call i32 @add_point(%struct.matrix* %0, double %7, double %8, double %9)
ret void
}