#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 ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           unsigned int, unsigned int, unsigned int,
                           unsigned int, unsigned int);
int /*<<< orphan*/ getPsFile(struct ADrawTag *);
void PsFilledTriangle(struct ADrawTag *ctx, unsigned int x1, unsigned int y1,
                      unsigned int x2, unsigned int y2, unsigned int x3,
                      unsigned int y3) {
  fprintf(getPsFile(ctx),
          "newpath "
          "%d %d moveto "
          "%d %d lineto "
          "%d %d lineto "
          "closepath "
          "fill\n",
          x1, -y1, x2, -y2, x3, -y3);
}


x86 assembly (clang, -O0):
<PsFilledTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getPsFile@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
xor    %eax,%eax
sub    0x10(%rbp),%eax
lea    0xe92(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsFilledTriangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r13d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %esi,%r12d
call   1040 <getPsFile@plt>
neg    %ebx
neg    %r13d
xor    %ebp,%ebp
sub    0x40(%rsp),%ebp
lea    0xeb0(%rip),%rsi
mov    %eax,%edi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %r13d,%r9d
push   %rbp
push   %r14
call   1030 <fprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [63 x i8] c"newpath %d %d moveto %d %d lineto %d %d lineto closepath fill\0A\00"
define void @PsFilledTriangle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.ADrawTag*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %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 %struct.ADrawTag*, %struct.ADrawTag** %8
%16 = call i32 @getPsFile(%struct.ADrawTag* %15)
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = sub i32 0, %18
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = sub i32 0, %21
%23 = load i32, i32* %13
%24 = load i32, i32* %14
%25 = sub i32 0, %24
%26 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %19, i32 %20, i32 %22, i32 %23, i32 %25)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [63 x i8] c"newpath %d %d moveto %d %d lineto %d %d lineto closepath fill\0A\00"
define void @PsFilledTriangle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @getPsFile(%struct.ADrawTag* %0)
%9 = sub i32 0, %2
%10 = sub i32 0, %4
%11 = sub i32 0, %6
%12 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %9, i32 %3, i32 %10, i32 %5, i32 %11)
ret void
}