#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*/ RSdraw(short, short, short, short, short, char *);
int /*<<< orphan*/ VSIclip(short *, short *, short *, short *, short *,
                           short *);
void VSIdraw(short VSIwn, short x, short y, short a, short len, char *c) {
  short x2, y2, offset;
  if (!VSIclip(&x, &y, &x2, &y2, &len, &offset))
    RSdraw(VSIwn, x, y, a, len, (char *)(c + offset));
}


x86 assembly (clang, -O0):
<VSIdraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %di,-0x2(%rbp)
mov    %si,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %cx,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %r9,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x6(%rbp),%rsi
lea    -0x1a(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0xa(%rbp),%r8
lea    -0x1e(%rbp),%r9
call   1040 <VSIclip@plt>
cmp    $0x0,%eax
jne    11a2 <VSIdraw+0x82>
mov    -0x2(%rbp),%di
mov    -0x4(%rbp),%si
mov    -0x6(%rbp),%dx
mov    -0x8(%rbp),%cx
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%r9
movswl -0x1e(%rbp),%r8d
movslq %r8d,%r8
add    %r8,%r9
movswl %di,%edi
movswl %si,%esi
movswl %dx,%edx
movswl %cx,%ecx
movswl %ax,%r8d
call   1030 <RSdraw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VSIdraw>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r9,%rbx
mov    %ecx,%r14d
mov    %edi,%ebp
mov    %si,0x8(%rsp)
mov    %dx,0x6(%rsp)
mov    %r8w,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x6(%rsp),%rsi
lea    0xe(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0xa(%rsp),%r9
call   1040 <VSIclip@plt>
test   %eax,%eax
jne    118f <VSIdraw+0x6f>
movswl 0x8(%rsp),%esi
movswl 0x6(%rsp),%edx
movswl 0x4(%rsp),%r8d
movswq 0xa(%rsp),%rax
add    %rax,%rbx
movswl %bp,%edi
movswl %r14w,%ecx
mov    %rbx,%r9
call   1030 <RSdraw@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @VSIdraw(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i8* %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i8*
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
store i16 %0, i16* %7
store i16 %1, i16* %8
store i16 %2, i16* %9
store i16 %3, i16* %10
store i16 %4, i16* %11
store i8* %5, i8** %12
%16 = call i32 @VSIclip(i16* %8, i16* %9, i16* %13, i16* %14, i16* %11, i16* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %30, label %18
18: ; preds = %6
%19 = load i16, i16* %7
%20 = load i16, i16* %8
%21 = load i16, i16* %9
%22 = load i16, i16* %10
%23 = load i16, i16* %11
%24 = load i8*, i8** %12
%25 = load i16, i16* %15
%26 = sext i16 %25 to i32
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = call i32 @RSdraw(i16 signext %19, i16 signext %20, i16 signext %21, i16 signext %22, i16 signext %23, i8* %28)
br label %30
30: ; preds = %18, %6
ret void
}

LLVM IR (-O2):
define void @VSIdraw(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i8* %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
store i16 %1, i16* %7
store i16 %2, i16* %8
store i16 %4, i16* %9
%13 = bitcast i16* %10 to i8*
%14 = bitcast i16* %11 to i8*
%15 = bitcast i16* %12 to i8*
%16 = call i32 @VSIclip(i16* %7, i16* %8, i16* %10, i16* %11, i16* %9, i16* %12)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %6
%19 = load i16, i16* %7
%20 = load i16, i16* %8
%21 = load i16, i16* %9
%22 = load i16, i16* %12
%23 = sext i16 %22 to i64
%24 = getelementptr inbounds i8, i8* %5, i64 %23
%25 = call i32 @RSdraw(i16 signext %0, i16 signext %19, i16 signext %20, i16 signext %3, i16 signext %21, i8* %24)
br label %26
26: ; preds = %18, %6
ret void
}