#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 */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
unsigned int INT_MAX;
int /*<<< orphan*/ gdImageLine(int /*<<< orphan*/, unsigned int, unsigned int,
                               unsigned int, unsigned int, int);
int /*<<< orphan*/ getGdoImg(struct ADrawTag *);
int /*<<< orphan*/ setStyle(struct ADrawTag *);
void gdoDottedLine(struct ADrawTag *ctx, unsigned int x1, unsigned int y1,
                   unsigned int x2, unsigned int y2) {
  setStyle(ctx);
  if (x1 <= INT_MAX && y1 <= INT_MAX && x2 <= INT_MAX && y2 <= INT_MAX) {
    gdImageLine(getGdoImg(ctx), x1, y1, x2, y2, (-2));
  }
}


x86 assembly (clang, -O0):
<gdoDottedLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <setStyle@plt>
mov    -0xc(%rbp),%eax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
ja     11bd <gdoDottedLine+0x8d>
mov    -0x10(%rbp),%eax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%eax
ja     11bd <gdoDottedLine+0x8d>
mov    -0x14(%rbp),%eax
mov    0x2e68(%rip),%rcx
cmp    (%rcx),%eax
ja     11bd <gdoDottedLine+0x8d>
mov    -0x18(%rbp),%eax
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%eax
ja     11bd <gdoDottedLine+0x8d>
mov    -0x8(%rbp),%rdi
call   1050 <getGdoImg@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0xfffffffe,%r9d
call   1040 <gdImageLine@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdoDottedLine>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%ebx
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%rbp
call   1030 <setStyle@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
cmp    %ebx,%eax
jb     1191 <gdoDottedLine+0x61>
cmp    %r15d,%eax
jb     1191 <gdoDottedLine+0x61>
cmp    %r12d,%eax
jb     1191 <gdoDottedLine+0x61>
cmp    %r14d,%eax
jb     1191 <gdoDottedLine+0x61>
mov    %rbp,%rdi
call   1050 <getGdoImg@plt>
mov    %eax,%edi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %ebx,%r8d
mov    $0xfffffffe,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <gdImageLine@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@INT_MAX = global i32 0
define void @gdoDottedLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ADrawTag*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%12 = call i32 @setStyle(%struct.ADrawTag* %11)
%13 = load i32, i32* %7
%14 = load i32, i32* @INT_MAX
%15 = icmp ule i32 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %5
%17 = load i32, i32* %8
%18 = load i32, i32* @INT_MAX
%19 = icmp ule i32 %17, %18
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = load i32, i32* %9
%22 = load i32, i32* @INT_MAX
%23 = icmp ule i32 %21, %22
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i32, i32* %10
%26 = load i32, i32* @INT_MAX
%27 = icmp ule i32 %25, %26
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%30 = call i32 @getGdoImg(%struct.ADrawTag* %29)
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @gdImageLine(i32 %30, i32 %31, i32 %32, i32 %33, i32 %34, i32 -2)
br label %36
36: ; preds = %28, %24, %20, %16, %5
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@INT_MAX = global i32 0
define void @gdoDottedLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @setStyle(%struct.ADrawTag* %0)
%7 = load i32, i32* @INT_MAX
%8 = icmp ult i32 %7, %1
%9 = icmp ult i32 %7, %2
%10 = or i1 %8, %9
%11 = icmp ult i32 %7, %3
%12 = or i1 %11, %10
%13 = icmp ult i32 %7, %4
%14 = or i1 %13, %12
br i1 %14, label %18, label %15
15: ; preds = %5
%16 = tail call i32 @getGdoImg(%struct.ADrawTag* %0)
%17 = tail call i32 @gdImageLine(i32 %16, i32 %1, i32 %2, i32 %3, i32 %4, i32 -2)
br label %18
18: ; preds = %15, %5
ret void
}