#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*/ printPoint(double, double);
int /*<<< orphan*/ printf(char *);
void printTriangle(double x1, double y1, double x2, double y2, double x3,
                   double y3) {
  printf("Triangle is [");
  printPoint(x1, y1);
  printf(", ");
  printPoint(x2, y2);
  printf(", ");
  printPoint(x3, y3);
  printf("] \n");
}


x86 assembly (clang, -O0):
<printTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <printPoint@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <printPoint@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1040 <printPoint@plt>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTriangle>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm5,0x28(%rsp)
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <printPoint@plt>
lea    0xe93(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1050 <printPoint@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
call   1050 <printPoint@plt>
lea    0xe5d(%rip),%rdi
add    $0x30,%rsp
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Triangle is [\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [4 x i8] c"] \0A\00"
define void @printTriangle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = load double, double* %7
%15 = load double, double* %8
%16 = call i32 @printPoint(double %14, double %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = load double, double* %9
%19 = load double, double* %10
%20 = call i32 @printPoint(double %18, double %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = load double, double* %11
%23 = load double, double* %12
%24 = call i32 @printPoint(double %22, double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Triangle is [\00"
@.str.1 = [3 x i8] c", \00"
@str = [3 x i8] c"] \00"
define void @printTriangle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printPoint(double %0, double %1)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @printPoint(double %2, double %3)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @printPoint(double %4, double %5)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}