#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 *, char const *,
                           unsigned int, unsigned int, unsigned int,
                           unsigned int, unsigned int, unsigned int,
                           unsigned int, unsigned int);
int /*<<< orphan*/ getSvgFile(struct ADrawTag *);
void svgRect(struct ADrawTag *ctx, const char *colour, unsigned int x1,
             unsigned int y1, unsigned int x2, unsigned int y2) {
  fprintf(getSvgFile(ctx),
          "<polygon fill=\"%s\" points=\"%u,%u %u,%u %u,%u %u,%u\"/>\n", colour,
          x1, y1, x2, y1, x2, y2, x1, y2);
}


x86 assembly (clang, -O0):
<svgRect>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <getSvgFile@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
mov    -0x28(%rbp),%r14d
mov    -0x2c(%rbp),%ebx
mov    -0x30(%rbp),%r11d
mov    -0x24(%rbp),%r10d
mov    -0x30(%rbp),%eax
lea    0xe8c(%rip),%rsi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1040 <fprintf@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<svgRect>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9d,%r12d
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rsi,%r13
call   1030 <getSvgFile@plt>
sub    $0x8,%rsp
lea    0xeb9(%rip),%rsi
mov    %eax,%edi
mov    %r13,%rdx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
push   %r12
push   %rbx
push   %r12
push   %r14
push   %r15
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [55 x i8] c"<polygon fill=\22%s\22 points=\22%u,%u %u,%u %u,%u %u,%u\22/>\0A\00"
define void @svgRect(%struct.ADrawTag* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.ADrawTag*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.ADrawTag*, %struct.ADrawTag** %7
%14 = call i32 @getSvgFile(%struct.ADrawTag* %13)
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %9
%23 = load i32, i32* %12
%24 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [55 x i8] c"<polygon fill=\22%s\22 points=\22%u,%u %u,%u %u,%u %u,%u\22/>\0A\00"
define void @svgRect(%struct.ADrawTag* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @getSvgFile(%struct.ADrawTag* %0)
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %3, i32 %4, i32 %3, i32 %4, i32 %5, i32 %2, i32 %5)
ret void
}