#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_down(char *fbp, int x1, int y1, int x2, int y2) {
  int i, j;
  for (i = x1, j = y1; i <= x2; 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_down>:
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    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11cd <draw_line_oblique_down+0x9d>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%r8d
add    $0x1,%r8d
lea    0xe84(%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
add    $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    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1155 <draw_line_oblique_down+0x25>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_line_oblique_down>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %ecx,%esi
jg     11ae <draw_line_oblique_down+0x6e>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
nopl   0x0(%rax)
lea    0x1(%rbx),%r13d
lea    0x1(%rbp),%r12d
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %r12d,%r8d
call   1060 <draw_line_v@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
call   1050 <draw_line_h@plt>
mov    %r12d,%ebp
cmp    %r14d,%ebx
mov    %r13d,%ebx
jne    1160 <draw_line_oblique_down+0x20>
lea    0xe5f(%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_down(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 = %41, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %9
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %46
19: ; preds = %15
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %11
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %12
%25 = add nsw i32 %24, 1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, i32 %23, i32 %25)
%27 = load i8*, i8** %6
%28 = load i32, i32* %11
%29 = load i32, i32* %12
%30 = load i32, i32* %11
%31 = load i32, i32* %12
%32 = add nsw i32 %31, 1
%33 = call i32 @draw_line_v(i8* %27, i32 %28, i32 %29, i32 %30, i32 %32)
%34 = load i8*, i8** %6
%35 = load i32, i32* %11
%36 = load i32, i32* %12
%37 = load i32, i32* %11
%38 = add nsw i32 %37, 1
%39 = load i32, i32* %12
%40 = call i32 @draw_line_h(i8* %34, i32 %35, i32 %36, i32 %38, i32 %39)
br label %41
41: ; preds = %19
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
%44 = load i32, i32* %12
%45 = add nsw i32 %44, 1
store i32 %45, i32* %12
br label %15
46: ; preds = %15
%47 = 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_down(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, %3
br i1 %6, label %16, label %7
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ %2, %5 ]
%9 = phi i32 [ %10, %7 ], [ %1, %5 ]
%10 = add nsw i32 %9, 1
%11 = add nsw i32 %8, 1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %8, i32 %10, i32 %11)
%13 = tail call i32 @draw_line_v(i8* %0, i32 %9, i32 %8, i32 %9, i32 %11)
%14 = tail call i32 @draw_line_h(i8* %0, i32 %9, i32 %8, i32 %10, i32 %8)
%15 = icmp eq i32 %9, %3
br i1 %15, label %16, label %7
16: ; preds = %7, %5
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}