#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_line(unsigned char **, unsigned char **, unsigned int,
                             unsigned char, unsigned int, scalar_t__,
                             int /*<<< orphan*/, scalar_t__, int, int,
                             unsigned int, unsigned int, unsigned int,
                             unsigned int, void const *);
void plot_lines(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, int xflip,
                unsigned line_count, unsigned line_increment,
                unsigned palette_mask, unsigned clip_left, unsigned clip_right,
                const void *cache) {
  tile_address &= tileset_mask;
  tile_address += tileset_address;
  tile_address &= vram_mask;
  do {
    plot_line(screen1, screen2, output_surface_offset, depth, tile_address,
              (0 - 1), 0, (0 - 1), xflip, 1, line_increment, palette_mask,
              clip_left, clip_right, cache);
  } while (output_surface_offset += 256, tile_address += line_increment,
           --line_count);
}


x86 assembly (clang, -O0):
<plot_lines>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %cl,%al
mov    0x50(%rbp),%rcx
mov    0x48(%rbp),%ecx
mov    0x40(%rbp),%ecx
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,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %edx,-0x34(%rbp)
mov    %al,-0x35(%rbp)
mov    %r8d,-0x3c(%rbp)
mov    %r9d,-0x40(%rbp)
mov    -0x40(%rbp),%eax
and    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x10(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x18(%rbp),%eax
and    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x35(%rbp),%cl
mov    -0x3c(%rbp),%r8d
mov    0x20(%rbp),%r15d
mov    0x30(%rbp),%r14d
mov    0x38(%rbp),%ebx
mov    0x40(%rbp),%r11d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%rax
mov    $0xffffffffffffffff,%r9
xor    %r12d,%r12d
movzbl %cl,%ecx
movl   $0x0,(%rsp)
movq   $0xffffffffffffffff,0x8(%rsp)
ff ff
mov    %r15d,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    %r14d,0x20(%rsp)
mov    %ebx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %rax,0x40(%rsp)
call   1030 <plot_line@plt>
mov    -0x34(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x34(%rbp)
mov    0x30(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,0x28(%rbp)
cmp    $0x0,%eax
jne    116e <plot_lines+0x5e>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_lines>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %edx,%ebp
mov    %rsi,(%rsp)
mov    %rdi,%r15
mov    0x60(%rsp),%r13d
mov    0x58(%rsp),%r14d
and    %r9d,%ebx
add    0x40(%rsp),%ebx
and    0x48(%rsp),%ebx
movzbl %cl,%r12d
sub    $0x8,%rsp
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %ebx,%r8d
mov    $0xffffffffffffffff,%r9
push   0x88(%rsp)
mov    0x88(%rsp),%eax
push   %rax
mov    0x88(%rsp),%eax
push   %rax
mov    0x88(%rsp),%eax
push   %rax
push   %r13
push   $0x1
mov    0x88(%rsp),%eax
push   %rax
push   $0xffffffffffffffff
push   $0x0
call   1030 <plot_line@plt>
add    $0x50,%rsp
add    $0x100,%ebp
add    %r13d,%ebx
add    $0xffffffff,%r14d
jne    1140 <plot_lines+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @plot_lines([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, i32 %12, i32 %13, i8* %14) {
%16 = alloca [2 x i8]*
%17 = alloca [2 x i8]*
%18 = alloca i32
%19 = alloca i8
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i8*
store [2 x i8]* %0, [2 x i8]** %16
store [2 x i8]* %1, [2 x i8]** %17
store i32 %2, i32* %18
store i8 %3, i8* %19
store i32 %4, i32* %20
store i32 %5, i32* %21
store i32 %6, i32* %22
store i32 %7, i32* %23
store i32 %8, i32* %24
store i32 %9, i32* %25
store i32 %10, i32* %26
store i32 %11, i32* %27
store i32 %12, i32* %28
store i32 %13, i32* %29
store i8* %14, i8** %30
%31 = load i32, i32* %21
%32 = load i32, i32* %20
%33 = and i32 %32, %31
store i32 %33, i32* %20
%34 = load i32, i32* %22
%35 = load i32, i32* %20
%36 = add i32 %35, %34
store i32 %36, i32* %20
%37 = load i32, i32* %23
%38 = load i32, i32* %20
%39 = and i32 %38, %37
store i32 %39, i32* %20
br label %40
40: ; preds = %55, %15
%41 = load [2 x i8]*, [2 x i8]** %16
%42 = bitcast [2 x i8]* %41 to i8**
%43 = load [2 x i8]*, [2 x i8]** %17
%44 = bitcast [2 x i8]* %43 to i8**
%45 = load i32, i32* %18
%46 = load i8, i8* %19
%47 = load i32, i32* %20
%48 = load i32, i32* %24
%49 = load i32, i32* %26
%50 = load i32, i32* %27
%51 = load i32, i32* %28
%52 = load i32, i32* %29
%53 = load i8*, i8** %30
%54 = call i32 @plot_line(i8** %42, i8** %44, i32 %45, i8 zeroext %46, i32 %47, i64 -1, i32 0, i64 -1, i32 %48, i32 1, i32 %49, i32 %50, i32 %51, i32 %52, i8* %53)
br label %55
55: ; preds = %40
%56 = load i32, i32* %18
%57 = add i32 %56, 256
store i32 %57, i32* %18
%58 = load i32, i32* %26
%59 = load i32, i32* %20
%60 = add i32 %59, %58
store i32 %60, i32* %20
%61 = load i32, i32* %25
%62 = add i32 %61, -1
store i32 %62, i32* %25
%63 = icmp ne i32 %62, 0
br i1 %63, label %40, label %64
64: ; preds = %55
ret void
}

LLVM IR (-O2):
define void @plot_lines([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, i32 %12, i32 %13, i8* %14) {
%16 = and i32 %5, %4
%17 = add i32 %16, %6
%18 = and i32 %17, %7
%19 = bitcast [2 x i8]* %0 to i8**
%20 = bitcast [2 x i8]* %1 to i8**
br label %21
21: ; preds = %21, %15
%22 = phi i32 [ %9, %15 ], [ %28, %21 ]
%23 = phi i32 [ %18, %15 ], [ %27, %21 ]
%24 = phi i32 [ %2, %15 ], [ %26, %21 ]
%25 = tail call i32 @plot_line(i8** %19, i8** %20, i32 %24, i8 zeroext %3, i32 %23, i64 -1, i32 0, i64 -1, i32 %8, i32 1, i32 %10, i32 %11, i32 %12, i32 %13, i8* %14)
%26 = add i32 %24, 256
%27 = add i32 %23, %10
%28 = add i32 %22, -1
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %21
30: ; preds = %21
ret void
}