#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*/ __svgalib_driver8_putbox(int, int, int, int, void *, int);
void __svgalib_driver16_putboxpart(int x, int y, int w, int h, int ow, int oh,
                                   void *b, int xo, int yo) {
  __svgalib_driver8_putbox(x * 2, y, w * 2, h, b + yo * ow * 2 + xo * 2,
                           ow * 2);
}


x86 assembly (clang, -O0):
<__svgalib_driver16_putboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
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
shl    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%r8
mov    0x18(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%r8
mov    -0x14(%rbp),%r9d
shl    $0x1,%r9d
call   1030 <__svgalib_driver8_putbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver16_putboxpart>:
mov    0x10(%rsp),%r10d
add    %edi,%edi
lea    (%r8,%r8,1),%r9d
mov    0x18(%rsp),%eax
imul   %r9d,%eax
cltq
add    0x8(%rsp),%rax
add    %edx,%edx
add    %r10d,%r10d
movslq %r10d,%r8
add    %rax,%r8
jmp    1030 <__svgalib_driver8_putbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver16_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = mul nsw i32 %19, 2
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = mul nsw i32 %22, 2
%24 = load i32, i32* %13
%25 = load i8*, i8** %16
%26 = load i32, i32* %18
%27 = load i32, i32* %14
%28 = mul nsw i32 %26, %27
%29 = mul nsw i32 %28, 2
%30 = sext i32 %29 to i64
%31 = getelementptr i8, i8* %25, i64 %30
%32 = load i32, i32* %17
%33 = mul nsw i32 %32, 2
%34 = sext i32 %33 to i64
%35 = getelementptr i8, i8* %31, i64 %34
%36 = load i32, i32* %14
%37 = mul nsw i32 %36, 2
%38 = call i32 @__svgalib_driver8_putbox(i32 %20, i32 %21, i32 %23, i32 %24, i8* %35, i32 %37)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver16_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = shl nsw i32 %0, 1
%11 = shl nsw i32 %2, 1
%12 = shl i32 %4, 1
%13 = mul i32 %12, %8
%14 = sext i32 %13 to i64
%15 = getelementptr i8, i8* %6, i64 %14
%16 = shl nsw i32 %7, 1
%17 = sext i32 %16 to i64
%18 = getelementptr i8, i8* %15, i64 %17
%19 = tail call i32 @__svgalib_driver8_putbox(i32 %10, i32 %1, i32 %11, i32 %3, i8* %18, i32 %12)
ret void
}