#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_point(int, int, int /*<<< orphan*/);
void draw_vline(int fd, int x, int y1, int y2) {
  int i = ((y1) < (y2) ? (y1) : (y2));
  while (i <= ((y2) > (y1) ? (y2) : (y1)))
    draw_point(fd, x, i++);
}


x86 assembly (clang, -O0):
<draw_vline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113b <draw_vline+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <draw_vline+0x31>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1164 <draw_vline+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    116a <draw_vline+0x5a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
cmp    %ecx,%eax
jg     1193 <draw_vline+0x83>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
call   1030 <draw_point@plt>
jmp    1147 <draw_vline+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_vline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
cmp    %ecx,%edx
mov    %ecx,%edx
cmovl  %ebx,%edx
mov    %esi,%r14d
mov    %edi,%r15d
cmovl  %ecx,%ebx
add    $0x1,%ebx
nopl   0x0(%rax)
lea    0x1(%rdx),%ebp
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <draw_point@plt>
mov    %ebp,%edx
cmp    %ebp,%ebx
jne    1130 <draw_vline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_vline(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %7
br label %17
15: ; preds = %4
%16 = load i32, i32* %8
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
store i32 %18, i32* %9
br label %19
19: ; preds = %31, %17
%20 = load i32, i32* %9
%21 = load i32, i32* %8
%22 = load i32, i32* %7
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = load i32, i32* %8
br label %28
26: ; preds = %19
%27 = load i32, i32* %7
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
%30 = icmp sle i32 %20, %29
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
%36 = call i32 @draw_point(i32 %32, i32 %33, i32 %34)
br label %19
37: ; preds = %28
ret void
}

LLVM IR (-O2):
define void @draw_vline(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
%6 = select i1 %5, i32 %2, i32 %3
%7 = select i1 %5, i32 %3, i32 %2
br label %8
8: ; preds = %4, %8
%9 = phi i32 [ %6, %4 ], [ %10, %8 ]
%10 = add i32 %9, 1
%11 = tail call i32 @draw_point(i32 %0, i32 %1, i32 %9)
%12 = icmp eq i32 %9, %7
br i1 %12, label %13, label %8
13: ; preds = %8
ret void
}