#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*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fgui_draw_line(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void fgui_draw_triangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
                        uint16_t x2, uint16_t y2, uint32_t color) {
  fgui_draw_line(x0, y0, x1, y1, color);
  fgui_draw_line(x1, y1, x2, y2, color);
  fgui_draw_line(x2, y2, x0, y0, color);
}


x86 assembly (clang, -O0):
<fgui_draw_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <fgui_draw_line@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <fgui_draw_line@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <fgui_draw_line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgui_draw_triangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%r13d
mov    0x40(%rsp),%r14d
mov    %r14d,%r8d
call   1030 <fgui_draw_line@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    0x4(%rsp),%ebx
mov    %ebx,%ecx
mov    %r14d,%r8d
call   1030 <fgui_draw_line@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fgui_draw_line@plt>

LLVM IR (-O0):
define void @fgui_draw_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %14
%20 = call i32 @fgui_draw_line(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = call i32 @fgui_draw_line(i32 %21, i32 %22, i32 %23, i32 %24, i32 %25)
%27 = load i32, i32* %12
%28 = load i32, i32* %13
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load i32, i32* %14
%32 = call i32 @fgui_draw_line(i32 %27, i32 %28, i32 %29, i32 %30, i32 %31)
ret void
}

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