#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_h(char *, int, int, int, int);
int /*<<< orphan*/ draw_line_v(char *, int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
void draw_line_oblique_up(char *fbp, int x1, int y1, int x2, int y2) {
  int i, j;
  for (i = x1, j = y1; i <= x2 && j > 0; i++, j--) {
    printf("    %d.%d -> %d.%d\n", i, j, i + 1, j + 1);
    draw_line_v(fbp, i, j, i, j - 1);
    draw_line_h(fbp, i, j, i + 1, j);
  }
  printf("-------\n");
}


x86 assembly (clang, -O0):
<draw_line_oblique_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x21(%rbp)
jg     1170 <draw_line_oblique_up+0x40>
cmpl   $0x0,-0x20(%rbp)
setg   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1180 <draw_line_oblique_up+0x50>
jmp    11ec <draw_line_oblique_up+0xbc>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%r8d
add    $0x1,%r8d
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
sub    $0x1,%r8d
call   1050 <draw_line_v@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%r8d
call   1040 <draw_line_h@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1155 <draw_line_oblique_up+0x25>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_line_oblique_up>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %ecx,%esi
jg     11b4 <draw_line_oblique_up+0x74>
mov    %edx,%ebx
test   %edx,%edx
jle    11b4 <draw_line_oblique_up+0x74>
mov    %ecx,%r14d
mov    %esi,%r13d
mov    %rdi,%r15
xchg   %ax,%ax
mov    %r13d,%ebp
lea    0x1(%rbp),%r13d
lea    0x1(%rbx),%r8d
lea    0xe8e(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x1(%rbx),%r12d
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r12d,%r8d
call   1060 <draw_line_v@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %ebx,%r8d
call   1050 <draw_line_h@plt>
cmp    %r14d,%ebp
jge    11b4 <draw_line_oblique_up+0x74>
cmp    $0x1,%ebx
mov    %r12d,%ebx
ja     1160 <draw_line_oblique_up+0x20>
lea    0xe59(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" %d.%d -> %d.%d\0A\00"
@.str.1 = [9 x i8] c"-------\0A\00"
define void @draw_line_oblique_up(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %7
store i32 %13, i32* %11
%14 = load i32, i32* %8
store i32 %14, i32* %12
br label %15
15: ; preds = %46, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %9
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %12
%21 = icmp sgt i32 %20, 0
br label %22
22: ; preds = %19, %15
%23 = phi i1 [ false, %15 ], [ %21, %19 ]
br i1 %23, label %24, label %51
24: ; preds = %22
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %12
%30 = add nsw i32 %29, 1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %28, i32 %30)
%32 = load i8*, i8** %6
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = load i32, i32* %11
%36 = load i32, i32* %12
%37 = sub nsw i32 %36, 1
%38 = call i32 @draw_line_v(i8* %32, i32 %33, i32 %34, i32 %35, i32 %37)
%39 = load i8*, i8** %6
%40 = load i32, i32* %11
%41 = load i32, i32* %12
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
%44 = load i32, i32* %12
%45 = call i32 @draw_line_h(i8* %39, i32 %40, i32 %41, i32 %43, i32 %44)
br label %46
46: ; preds = %24
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %11
%49 = load i32, i32* %12
%50 = add nsw i32 %49, -1
store i32 %50, i32* %12
br label %15
51: ; preds = %22
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" %d.%d -> %d.%d\0A\00"
@str = [8 x i8] c"-------\00"
define void @draw_line_oblique_up(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sle i32 %1, %3
%7 = icmp sgt i32 %2, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5, %9
%10 = phi i32 [ %15, %9 ], [ %2, %5 ]
%11 = phi i32 [ %12, %9 ], [ %1, %5 ]
%12 = add nsw i32 %11, 1
%13 = add nuw nsw i32 %10, 1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10, i32 %12, i32 %13)
%15 = add nsw i32 %10, -1
%16 = tail call i32 @draw_line_v(i8* %0, i32 %11, i32 %10, i32 %11, i32 %15)
%17 = tail call i32 @draw_line_h(i8* %0, i32 %11, i32 %10, i32 %12, i32 %10)
%18 = icmp slt i32 %11, %3
%19 = icmp ugt i32 %10, 1
%20 = and i1 %18, %19
br i1 %20, label %9, label %21
21: ; preds = %9, %5
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}