int gray_shade_region(the_image, out_image, diff, min_area, max_area, rows,
                      cols)
long cols, rows;
short **the_image, **out_image, diff, min_area, max_area;
{
  int a, b, big_count, count, i, j, k, l, not_finished, length, width;
  printf("\nDEBUG> GSR> before calling pixel grow");
  pixel_grow(the_image, out_image, diff, min_area, max_area, rows, cols);
  printf("\nDEBUG> GSR> after calling pixel grow");
  return (1);
}


x86 assembly (clang, -O0):
<gray_shade_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dx,-0x12(%rbp)
mov    %cx,-0x14(%rbp)
mov    %ax,-0x16(%rbp)
mov    %r9,-0x20(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movswl -0x12(%rbp),%edx
movswl -0x14(%rbp),%ecx
movswl -0x16(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <pixel_grow@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gray_shade_region>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movswl %bp,%edx
movswl %bx,%ecx
movswl %r15w,%r8d
mov    0x40(%rsp),%rax
mov    %rax,(%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14,%r9
xor    %eax,%eax
call   1040 <pixel_grow@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\0ADEBUG> GSR> before calling pixel grow\00"
@.str.1 = [38 x i8] c"\0ADEBUG> GSR> after calling pixel grow\00"
define i32 @gray_shade_region(i16** %0, i16** %1, i32 %2, i32 %3, i32 %4, i64 %5, i64 %6) {
%8 = alloca i16**
%9 = alloca i16**
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = trunc i32 %2 to i16
%27 = trunc i32 %3 to i16
%28 = trunc i32 %4 to i16
store i16** %0, i16*** %8
store i16** %1, i16*** %9
store i16 %26, i16* %10
store i16 %27, i16* %11
store i16 %28, i16* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%30 = load i16**, i16*** %8
%31 = load i16**, i16*** %9
%32 = load i16, i16* %10
%33 = sext i16 %32 to i32
%34 = load i16, i16* %11
%35 = sext i16 %34 to i32
%36 = load i16, i16* %12
%37 = sext i16 %36 to i32
%38 = load i64, i64* %13
%39 = load i64, i64* %14
%40 = call i32 (i16**, i16**, i32, i32, i32, i64, i64, ...) bitcast (i32 (...)* @pixel_grow to i32 (i16**, i16**, i32, i32, i32, i64, i64, ...)*)(i16** %30, i16** %31, i32 %33, i32 %35, i32 %37, i64 %38, i64 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [39 x i8] c"\0ADEBUG> GSR> before calling pixel grow\00"
@.str.1 = [38 x i8] c"\0ADEBUG> GSR> after calling pixel grow\00"
define i32 @gray_shade_region(i16** %0, i16** %1, i32 %2, i32 %3, i32 %4, i64 %5, i64 %6) {
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = shl i32 %2, 16
%10 = ashr exact i32 %9, 16
%11 = shl i32 %3, 16
%12 = ashr exact i32 %11, 16
%13 = shl i32 %4, 16
%14 = ashr exact i32 %13, 16
%15 = tail call i32 (i16**, i16**, i32, i32, i32, i64, i64, ...) bitcast (i32 (...)* @pixel_grow to i32 (i16**, i16**, i32, i32, i32, i64, i64, ...)*)(i16** %0, i16** %1, i32 %10, i32 %12, i32 %14, i64 %5, i64 %6)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}