int uncover_image(cover_image, message_image, mlength, mwidth, clength, cwidth,
                  lsb, n)
int lsb, n;
long clength, cwidth, mlength, mwidth;
short **cover_image, **message_image;
{
  int h_counter;
  for (h_counter = 0; h_counter < mwidth; h_counter++) {
    uncover_pixels(cover_image, message_image, h_counter, h_counter * n, lsb, n,
                   mlength);
  }
  return (1);
}


x86 assembly (clang, -O0):
<uncover_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1182 <uncover_image+0x72>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x34(%rbp),%ecx
imul   0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    -0x18(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <uncover_pixels@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113d <uncover_image+0x2d>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncover_image>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rcx,%rcx
jle    116f <uncover_image+0x5f>
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbp
xor    %r13d,%r13d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,(%rsp)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
mov    %r13d,%ecx
mov    0x40(%rsp),%r8d
mov    0x48(%rsp),%r9d
xor    %eax,%eax
call   1030 <uncover_pixels@plt>
add    $0x1,%r14
add    0x48(%rsp),%r13d
cmp    %r14,%rbx
jne    1140 <uncover_image+0x30>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @uncover_image(i16** %0, i16** %1, i64 %2, i64 %3, i64 %4, i64 %5, i32 %6, i32 %7) {
%9 = icmp sgt i64 %3, 0
br i1 %9, label %10, label %17
10: ; preds = %8, %10
%11 = phi i64 [ %15, %10 ], [ 0, %8 ]
%12 = trunc i64 %11 to i32
%13 = mul nsw i32 %12, %7
%14 = tail call i32 (i16**, i16**, i32, i32, i32, i32, i64, ...) bitcast (i32 (...)* @uncover_pixels to i32 (i16**, i16**, i32, i32, i32, i32, i64, ...)*)(i16** %0, i16** %1, i32 %12, i32 %13, i32 %6, i32 %7, i64 %2)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %3
br i1 %16, label %17, label %10
17: ; preds = %10, %8
ret i32 1
}