#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*/ plot_palettized_even_mosaic(unsigned char **,
                                               unsigned char **, unsigned int,
                                               unsigned char, unsigned int, int,
                                               int, unsigned int, void const *);
void plot_palettized_even_run_mosaic(
    unsigned char (*screen1)[2], unsigned char (*screen2)[2],
    unsigned output_surface_offset, unsigned char depth, unsigned tile_address,
    unsigned tileset_mask, unsigned tileset_address, unsigned vram_mask,
    unsigned line_count, int pixel_in_tile, int pixel_count,
    unsigned palette_mask, const void *cache) {
  tile_address &= tileset_mask;
  tile_address += tileset_address;
  tile_address &= vram_mask;
  plot_palettized_even_mosaic(screen1, screen2, output_surface_offset, depth,
                              tile_address, pixel_in_tile, pixel_count,
                              palette_mask, cache);
}


x86 assembly (clang, -O0):
<plot_palettized_even_run_mosaic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %cl,%al
mov    0x40(%rbp),%rcx
mov    0x38(%rbp),%ecx
mov    0x30(%rbp),%ecx
mov    0x28(%rbp),%ecx
mov    0x20(%rbp),%ecx
mov    0x18(%rbp),%ecx
mov    0x10(%rbp),%ecx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x20(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x10(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x18(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x15(%rbp),%cl
mov    -0x1c(%rbp),%r8d
mov    0x28(%rbp),%r9d
mov    0x30(%rbp),%r11d
mov    0x38(%rbp),%r10d
mov    0x40(%rbp),%rax
movzbl %cl,%ecx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <plot_palettized_even_mosaic@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_palettized_even_run_mosaic>:
push   %rax
mov    0x28(%rsp),%eax
mov    0x30(%rsp),%r10d
mov    0x38(%rsp),%r11d
and    %r9d,%r8d
add    0x10(%rsp),%r8d
and    0x18(%rsp),%r8d
sub    $0x8,%rsp
mov    %eax,%r9d
push   0x48(%rsp)
push   %r11
push   %r10
call   1030 <plot_palettized_even_mosaic@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @plot_palettized_even_run_mosaic([2 x i8]* %0, [2 x i8]* %1, i32 %2, i8 zeroext %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i8* %12) {
%14 = alloca [2 x i8]*
%15 = alloca [2 x i8]*
%16 = alloca i32
%17 = alloca i8
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
store [2 x i8]* %0, [2 x i8]** %14
store [2 x i8]* %1, [2 x i8]** %15
store i32 %2, i32* %16
store i8 %3, i8* %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i8* %12, i8** %26
%27 = load i32, i32* %19
%28 = load i32, i32* %18
%29 = and i32 %28, %27
store i32 %29, i32* %18
%30 = load i32, i32* %20
%31 = load i32, i32* %18
%32 = add i32 %31, %30
store i32 %32, i32* %18
%33 = load i32, i32* %21
%34 = load i32, i32* %18
%35 = and i32 %34, %33
store i32 %35, i32* %18
%36 = load [2 x i8]*, [2 x i8]** %14
%37 = bitcast [2 x i8]* %36 to i8**
%38 = load [2 x i8]*, [2 x i8]** %15
%39 = bitcast [2 x i8]* %38 to i8**
%40 = load i32, i32* %16
%41 = load i8, i8* %17
%42 = load i32, i32* %18
%43 = load i32, i32* %23
%44 = load i32, i32* %24
%45 = load i32, i32* %25
%46 = load i8*, i8** %26
%47 = call i32 @plot_palettized_even_mosaic(i8** %37, i8** %39, i32 %40, i8 zeroext %41, i32 %42, i32 %43, i32 %44, i32 %45, i8* %46)
ret void
}

LLVM IR (-O2):
define void @plot_palettized_even_run_mosaic([2 x i8]* %0, [2 x i8]* %1, i32 %2, i8 zeroext %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i8* %12) {
%14 = and i32 %5, %4
%15 = add i32 %14, %6
%16 = and i32 %15, %7
%17 = bitcast [2 x i8]* %0 to i8**
%18 = bitcast [2 x i8]* %1 to i8**
%19 = tail call i32 @plot_palettized_even_mosaic(i8** %17, i8** %18, i32 %2, i8 zeroext %3, i32 %16, i32 %9, i32 %10, i32 %11, i8* %12)
ret void
}