#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*/ draw_line(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/, char, char,
                             char, int);
int /*<<< orphan*/ pXleft(int, int);
int /*<<< orphan*/ pXright(int, int);
int /*<<< orphan*/ pY(int, int);
void psdraw_line(int x1, int y1, int x2, int y2, int z, char r, char g,
                 char b) {
  if ((z >= -64) & (z <= 63)) {
    draw_line(pXleft(x1, z), pY(y1, z), pXleft(x2, z), pY(y2, z), r, g, b,
              0x20184E60);
    draw_line(pXright(x1, z), pY(y1, z), pXright(x2, z), pY(y2, z), r, g, b,
              0x201CB370);
  }
}


x86 assembly (clang, -O0):
<psdraw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %al,-0x15(%rbp)
cmpl   $0xffffffc0,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x3f,-0x14(%rbp)
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1250 <psdraw_line+0x110>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <pXleft@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <pY@plt>
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <pXleft@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <pY@plt>
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    %eax,%ecx
mov    -0x15(%rbp),%r8b
mov    0x10(%rbp),%al
movsbl %r8b,%r8d
movsbl %al,%r9d
movsbl 0x18(%rbp),%eax
mov    %eax,(%rsp)
movl   $0x20184e60,0x8(%rsp)
20
call   1040 <draw_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <pXright@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <pY@plt>
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <pXright@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <pY@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x15(%rbp),%r8b
mov    0x10(%rbp),%al
movsbl %r8b,%r8d
movsbl %al,%r9d
movsbl 0x18(%rbp),%eax
mov    %eax,(%rsp)
movl   $0x201cb370,0x8(%rsp)
20
call   1040 <draw_line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psdraw_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebx
lea    0x40(%rbx),%eax
cmp    $0x7f,%eax
ja     122f <psdraw_line+0xef>
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%r14d
mov    %ebx,%esi
mov    %ecx,%r13d
mov    %ecx,0x14(%rsp)
mov    %r9d,0x4(%rsp)
call   1030 <pXleft@plt>
mov    %eax,0xc(%rsp)
mov    %r12d,%edi
mov    %ebx,%esi
call   1060 <pY@plt>
mov    %eax,0x8(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <pXleft@plt>
mov    %eax,%r15d
mov    %r13d,%edi
mov    %ebx,%esi
call   1060 <pY@plt>
movsbl 0x58(%rsp),%r13d
movsbl 0x4(%rsp),%r8d
mov    %r8d,0x4(%rsp)
movsbl 0x50(%rsp),%r9d
mov    %r9d,0x10(%rsp)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %r15d,%edx
mov    %eax,%ecx
push   $0x20184e60
push   %r13
call   1040 <draw_line@plt>
add    $0x10,%rsp
mov    %r14d,%edi
mov    %ebx,%esi
call   1050 <pXright@plt>
mov    %eax,%r15d
mov    %r12d,%edi
mov    %ebx,%esi
call   1060 <pY@plt>
mov    %eax,%r12d
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <pXright@plt>
mov    %eax,%ebp
mov    0x14(%rsp),%edi
mov    %ebx,%esi
call   1060 <pY@plt>
mov    %r15d,%edi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    0x4(%rsp),%r8d
mov    0x10(%rsp),%r9d
push   $0x201cb370
push   %r13
call   1040 <draw_line@plt>
add    $0x28,%rsp
jmp    1233 <psdraw_line+0xf3>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @psdraw_line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%17 = load i32, i32* %13
%18 = icmp sge i32 %17, -64
%19 = zext i1 %18 to i32
%20 = load i32, i32* %13
%21 = icmp sle i32 %20, 63
%22 = zext i1 %21 to i32
%23 = and i32 %19, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %58
25: ; preds = %8
%26 = load i32, i32* %9
%27 = load i32, i32* %13
%28 = call i32 @pXleft(i32 %26, i32 %27)
%29 = load i32, i32* %10
%30 = load i32, i32* %13
%31 = call i32 @pY(i32 %29, i32 %30)
%32 = load i32, i32* %11
%33 = load i32, i32* %13
%34 = call i32 @pXleft(i32 %32, i32 %33)
%35 = load i32, i32* %12
%36 = load i32, i32* %13
%37 = call i32 @pY(i32 %35, i32 %36)
%38 = load i8, i8* %14
%39 = load i8, i8* %15
%40 = load i8, i8* %16
%41 = call i32 @draw_line(i32 %28, i32 %31, i32 %34, i32 %37, i8 signext %38, i8 signext %39, i8 signext %40, i32 538463840)
%42 = load i32, i32* %9
%43 = load i32, i32* %13
%44 = call i32 @pXright(i32 %42, i32 %43)
%45 = load i32, i32* %10
%46 = load i32, i32* %13
%47 = call i32 @pY(i32 %45, i32 %46)
%48 = load i32, i32* %11
%49 = load i32, i32* %13
%50 = call i32 @pXright(i32 %48, i32 %49)
%51 = load i32, i32* %12
%52 = load i32, i32* %13
%53 = call i32 @pY(i32 %51, i32 %52)
%54 = load i8, i8* %14
%55 = load i8, i8* %15
%56 = load i8, i8* %16
%57 = call i32 @draw_line(i32 %44, i32 %47, i32 %50, i32 %53, i8 signext %54, i8 signext %55, i8 signext %56, i32 538751856)
br label %58
58: ; preds = %25, %8
ret void
}

LLVM IR (-O2):
define void @psdraw_line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = add i32 %4, 64
%10 = icmp ult i32 %9, 128
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = tail call i32 @pXleft(i32 %0, i32 %4)
%13 = tail call i32 @pY(i32 %1, i32 %4)
%14 = tail call i32 @pXleft(i32 %2, i32 %4)
%15 = tail call i32 @pY(i32 %3, i32 %4)
%16 = tail call i32 @draw_line(i32 %12, i32 %13, i32 %14, i32 %15, i8 signext %5, i8 signext %6, i8 signext %7, i32 538463840)
%17 = tail call i32 @pXright(i32 %0, i32 %4)
%18 = tail call i32 @pY(i32 %1, i32 %4)
%19 = tail call i32 @pXright(i32 %2, i32 %4)
%20 = tail call i32 @pY(i32 %3, i32 %4)
%21 = tail call i32 @draw_line(i32 %17, i32 %18, i32 %19, i32 %20, i8 signext %5, i8 signext %6, i8 signext %7, i32 538751856)
br label %22
22: ; preds = %11, %8
ret void
}