#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 PsArc(struct ADrawTag *ctx, unsigned int cx, unsigned int cy,
           unsigned int w, unsigned int h, unsigned int s, unsigned int e) {
  fprintf(getPsFile(ctx),
          "newpath "
          "%d %d %d %d %d %d ellipse "
          "stroke\n",
          cx, -cy, w, h, s, e);
}


x86 assembly (clang, -O0):
<PsArc>:
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
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    0x10(%rbp),%eax
lea    0xe97(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsArc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%ebp
mov    %esi,%ebx
mov    0x40(%rsp),%r13d
call   1040 <getPsFile@plt>
neg    %ebp
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
push   %r13
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 = [42 x i8] c"newpath %d %d %d %d %d %d ellipse stroke\0A\00"
define void @PsArc(%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 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [42 x i8] c"newpath %d %d %d %d %d %d ellipse stroke\0A\00"
define void @PsArc(%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 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %9, i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}