#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 */
typedef int /*<<< orphan*/ mask_odd;
typedef int /*<<< orphan*/ mask_even;

/* Variables and functions */
int FS460_decode_bitmap_from_alpha_masks(unsigned char *, long *,
                                         unsigned short *, int,
                                         unsigned short *, int);
int FS460_encode_alpha_masks_from_bitmap(unsigned short *, int *,
                                         unsigned short *, int *,
                                         unsigned char *, int);
int FS460_set_alpha_masks(unsigned short *, int, unsigned short *, int);
scalar_t__ OS_alloc(int);
int /*<<< orphan*/ OS_free(unsigned char *);
scalar_t__ sqrt(int);
void test_alpha_encode_decode_dissimilar(void) {
  unsigned char *p_alpha, *p_got;
  unsigned short mask_odd[6144], mask_even[6144];
  int mask_size_odd, mask_size_even;
  long alpha_value_size;
  int x, y;
  int off;
  int err;
  p_alpha = (unsigned char *)OS_alloc(720 * 576);
  if (p_alpha) {
    for (x = 0; x < (720 * 576); x++)
      p_alpha[x] = 0;
    for (y = 80; y < 160; y++)
      for (x = 40; x < 160; x++)
        p_alpha[720 * y + x] = 0x20;
    for (y = 40; y < 200; y++)
      for (x = 200 - (y - 40); x < 200 + (y - 40); x++)
        p_alpha[720 * y + x] = 0x40;
    for (y = 200; y < 360; y++)
      for (x = 200 - (360 - y); x < 200 + (360 - y); x++)
        p_alpha[720 * y + x] = 0x40;
    for (y = 240; y < 440; y++) {
      off = (int)sqrt(10000 - (340 - y) * (340 - y));
      for (x = 400 - off; x < 400 + off; x++)
        p_alpha[720 * y + x] = 0x60;
    }
    for (y = 300; y < 340; y++)
      for (x = 40; x < 680; x++)
        p_alpha[720 * y + x] = 0x7F;
    mask_size_odd = sizeof(mask_odd);
    mask_size_even = sizeof(mask_even);
    err = FS460_encode_alpha_masks_from_bitmap(mask_odd, &mask_size_odd,
                                               mask_even, &mask_size_even,
                                               p_alpha, 720 * 576);
    if (err) {
      {}
    } else {
      err = FS460_set_alpha_masks(mask_odd, mask_size_odd, mask_even,
                                  mask_size_even);
      p_got = (unsigned char *)OS_alloc(720 * 576);
      if (p_got) {
        alpha_value_size = 720 * 576;
        err = FS460_decode_bitmap_from_alpha_masks(
            p_got, &alpha_value_size, mask_odd, sizeof(mask_odd), mask_even,
            sizeof(mask_even));
        if (err) {
          {}
        } else {
          if (alpha_value_size != 720 * 576) {
          }
          for (x = 0; x < (720 * 576); x++) {
            if (p_got[x] != p_alpha[x])
              break;
          }
          if (x < (720 * 576)) {
            {} {} {}
          } else {
          }
        }
        OS_free(p_got);
      }
    }
    OS_free(p_alpha);
  }
}


x86 assembly (clang, -O0):
<test_alpha_encode_decode_dissimilar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6030,%rsp
mov    $0x65400,%edi
call   1060 <OS_alloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1628 <test_alpha_encode_decode_dissimilar+0x4c8>
movl   $0x0,-0x6024(%rbp)
cmpl   $0x65400,-0x6024(%rbp)
jge    11c1 <test_alpha_encode_decode_dissimilar+0x61>
mov    -0x8(%rbp),%rax
movslq -0x6024(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    118e <test_alpha_encode_decode_dissimilar+0x2e>
movl   $0x50,-0x6028(%rbp)
cmpl   $0xa0,-0x6028(%rbp)
jge    123d <test_alpha_encode_decode_dissimilar+0xdd>
movl   $0x28,-0x6024(%rbp)
cmpl   $0xa0,-0x6024(%rbp)
jge    1224 <test_alpha_encode_decode_dissimilar+0xc4>
mov    -0x8(%rbp),%rax
imul   $0x2d0,-0x6028(%rbp),%ecx
add    -0x6024(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    11e5 <test_alpha_encode_decode_dissimilar+0x85>
jmp    1229 <test_alpha_encode_decode_dissimilar+0xc9>
mov    -0x6028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6028(%rbp)
jmp    11cb <test_alpha_encode_decode_dissimilar+0x6b>
movl   $0x28,-0x6028(%rbp)
cmpl   $0xc8,-0x6028(%rbp)
jge    12d2 <test_alpha_encode_decode_dissimilar+0x172>
mov    -0x6028(%rbp),%ecx
sub    $0x28,%ecx
mov    $0xc8,%eax
sub    %ecx,%eax
mov    %eax,-0x6024(%rbp)
mov    -0x6024(%rbp),%eax
mov    -0x6028(%rbp),%ecx
sub    $0x28,%ecx
add    $0xc8,%ecx
cmp    %ecx,%eax
jge    12b9 <test_alpha_encode_decode_dissimilar+0x159>
mov    -0x8(%rbp),%rax
imul   $0x2d0,-0x6028(%rbp),%ecx
add    -0x6024(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x40,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    126d <test_alpha_encode_decode_dissimilar+0x10d>
jmp    12be <test_alpha_encode_decode_dissimilar+0x15e>
mov    -0x6028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6028(%rbp)
jmp    1247 <test_alpha_encode_decode_dissimilar+0xe7>
movl   $0xc8,-0x6028(%rbp)
cmpl   $0x168,-0x6028(%rbp)
jge    136b <test_alpha_encode_decode_dissimilar+0x20b>
mov    $0x168,%ecx
sub    -0x6028(%rbp),%ecx
mov    $0xc8,%eax
sub    %ecx,%eax
mov    %eax,-0x6024(%rbp)
mov    -0x6024(%rbp),%eax
mov    $0x168,%ecx
sub    -0x6028(%rbp),%ecx
add    $0xc8,%ecx
cmp    %ecx,%eax
jge    1352 <test_alpha_encode_decode_dissimilar+0x1f2>
mov    -0x8(%rbp),%rax
imul   $0x2d0,-0x6028(%rbp),%ecx
add    -0x6024(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x40,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    1304 <test_alpha_encode_decode_dissimilar+0x1a4>
jmp    1357 <test_alpha_encode_decode_dissimilar+0x1f7>
mov    -0x6028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6028(%rbp)
jmp    12dc <test_alpha_encode_decode_dissimilar+0x17c>
movl   $0xf0,-0x6028(%rbp)
cmpl   $0x1b8,-0x6028(%rbp)
jge    1423 <test_alpha_encode_decode_dissimilar+0x2c3>
mov    $0x154,%eax
sub    -0x6028(%rbp),%eax
mov    $0x154,%ecx
sub    -0x6028(%rbp),%ecx
imul   %ecx,%eax
mov    $0x2710,%edi
sub    %eax,%edi
call   1080 <sqrt@plt>
mov    %eax,-0x602c(%rbp)
mov    $0x190,%eax
sub    -0x602c(%rbp),%eax
mov    %eax,-0x6024(%rbp)
mov    -0x6024(%rbp),%eax
mov    -0x602c(%rbp),%ecx
add    $0x190,%ecx
cmp    %ecx,%eax
jge    140a <test_alpha_encode_decode_dissimilar+0x2aa>
mov    -0x8(%rbp),%rax
imul   $0x2d0,-0x6028(%rbp),%ecx
add    -0x6024(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x60,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    13c1 <test_alpha_encode_decode_dissimilar+0x261>
jmp    140f <test_alpha_encode_decode_dissimilar+0x2af>
mov    -0x6028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6028(%rbp)
jmp    1375 <test_alpha_encode_decode_dissimilar+0x215>
movl   $0x12c,-0x6028(%rbp)
cmpl   $0x154,-0x6028(%rbp)
jge    149f <test_alpha_encode_decode_dissimilar+0x33f>
movl   $0x28,-0x6024(%rbp)
cmpl   $0x2a8,-0x6024(%rbp)
jge    1486 <test_alpha_encode_decode_dissimilar+0x326>
mov    -0x8(%rbp),%rax
imul   $0x2d0,-0x6028(%rbp),%ecx
add    -0x6024(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x7f,(%rax,%rcx,1)
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    1447 <test_alpha_encode_decode_dissimilar+0x2e7>
jmp    148b <test_alpha_encode_decode_dissimilar+0x32b>
mov    -0x6028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6028(%rbp)
jmp    142d <test_alpha_encode_decode_dissimilar+0x2cd>
movl   $0x3000,-0x6014(%rbp)
movl   $0x3000,-0x6018(%rbp)
lea    -0x3010(%rbp),%rdi
lea    -0x6010(%rbp),%rdx
mov    -0x8(%rbp),%r8
lea    -0x6014(%rbp),%rsi
lea    -0x6018(%rbp),%rcx
mov    $0x65400,%r9d
call   1030 <FS460_encode_alpha_masks_from_bitmap@plt>
mov    %eax,-0x6030(%rbp)
cmpl   $0x0,-0x6030(%rbp)
je     14f6 <test_alpha_encode_decode_dissimilar+0x396>
jmp    161f <test_alpha_encode_decode_dissimilar+0x4bf>
lea    -0x3010(%rbp),%rdi
mov    -0x6014(%rbp),%esi
lea    -0x6010(%rbp),%rdx
mov    -0x6018(%rbp),%ecx
call   1040 <FS460_set_alpha_masks@plt>
mov    %eax,-0x6030(%rbp)
mov    $0x65400,%edi
call   1060 <OS_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     161a <test_alpha_encode_decode_dissimilar+0x4ba>
movq   $0x65400,-0x6020(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x3010(%rbp),%rdx
lea    -0x6010(%rbp),%r8
lea    -0x6020(%rbp),%rsi
mov    $0x3000,%r9d
mov    %r9d,%ecx
call   1070 <FS460_decode_bitmap_from_alpha_masks@plt>
mov    %eax,-0x6030(%rbp)
cmpl   $0x0,-0x6030(%rbp)
je     157e <test_alpha_encode_decode_dissimilar+0x41e>
jmp    1611 <test_alpha_encode_decode_dissimilar+0x4b1>
cmpq   $0x65400,-0x6020(%rbp)
je     1594 <test_alpha_encode_decode_dissimilar+0x434>
jmp    1594 <test_alpha_encode_decode_dissimilar+0x434>
movl   $0x0,-0x6024(%rbp)
cmpl   $0x65400,-0x6024(%rbp)
jge    15f2 <test_alpha_encode_decode_dissimilar+0x492>
mov    -0x10(%rbp),%rax
movslq -0x6024(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
movslq -0x6024(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     15d9 <test_alpha_encode_decode_dissimilar+0x479>
jmp    15f2 <test_alpha_encode_decode_dissimilar+0x492>
jmp    15de <test_alpha_encode_decode_dissimilar+0x47e>
mov    -0x6024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6024(%rbp)
jmp    159e <test_alpha_encode_decode_dissimilar+0x43e>
cmpl   $0x65400,-0x6024(%rbp)
jge    1607 <test_alpha_encode_decode_dissimilar+0x4a7>
jmp    160c <test_alpha_encode_decode_dissimilar+0x4ac>
jmp    160c <test_alpha_encode_decode_dissimilar+0x4ac>
jmp    1611 <test_alpha_encode_decode_dissimilar+0x4b1>
mov    -0x10(%rbp),%rdi
call   1050 <OS_free@plt>
jmp    161f <test_alpha_encode_decode_dissimilar+0x4bf>
mov    -0x8(%rbp),%rdi
call   1050 <OS_free@plt>
add    $0x6030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alpha_encode_decode_dissimilar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x6018,%rsp
mov    $0x65400,%edi
call   1070 <OS_alloc@plt>
test   %rax,%rax
je     158e <test_alpha_encode_decode_dissimilar+0x41e>
mov    %rax,%r14
mov    $0x65400,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    $0xe128,%eax
movabs $0x2020202020202020,%rcx
20 20 20
movaps 0xe44(%rip),%xmm0
nopl   0x0(%rax)
mov    %rcx,0x70(%r14,%rax,1)
movups %xmm0,0x60(%r14,%rax,1)
movups %xmm0,0x50(%r14,%rax,1)
movups %xmm0,0x40(%r14,%rax,1)
movups %xmm0,0x30(%r14,%rax,1)
movups %xmm0,0x20(%r14,%rax,1)
movups %xmm0,0x10(%r14,%rax,1)
movups %xmm0,(%r14,%rax,1)
movups %xmm0,0x2d0(%r14,%rax,1)
movups %xmm0,0x2e0(%r14,%rax,1)
movups %xmm0,0x2f0(%r14,%rax,1)
movups %xmm0,0x300(%r14,%rax,1)
movups %xmm0,0x310(%r14,%rax,1)
movups %xmm0,0x320(%r14,%rax,1)
movups %xmm0,0x330(%r14,%rax,1)
mov    %rcx,0x340(%r14,%rax,1)
movups %xmm0,0x5a0(%r14,%rax,1)
movups %xmm0,0x5b0(%r14,%rax,1)
movups %xmm0,0x5c0(%r14,%rax,1)
movups %xmm0,0x5d0(%r14,%rax,1)
movups %xmm0,0x5e0(%r14,%rax,1)
movups %xmm0,0x5f0(%r14,%rax,1)
movups %xmm0,0x600(%r14,%rax,1)
mov    %rcx,0x610(%r14,%rax,1)
mov    %rcx,0x8e0(%r14,%rax,1)
movups %xmm0,0x8d0(%r14,%rax,1)
movups %xmm0,0x8c0(%r14,%rax,1)
movups %xmm0,0x8b0(%r14,%rax,1)
movups %xmm0,0x8a0(%r14,%rax,1)
movups %xmm0,0x890(%r14,%rax,1)
movups %xmm0,0x880(%r14,%rax,1)
movups %xmm0,0x870(%r14,%rax,1)
movups %xmm0,0xb40(%r14,%rax,1)
movups %xmm0,0xb50(%r14,%rax,1)
movups %xmm0,0xb60(%r14,%rax,1)
movups %xmm0,0xb70(%r14,%rax,1)
movups %xmm0,0xb80(%r14,%rax,1)
movups %xmm0,0xb90(%r14,%rax,1)
movups %xmm0,0xba0(%r14,%rax,1)
mov    %rcx,0xbb0(%r14,%rax,1)
add    $0xe10,%rax
cmp    $0x1c228,%rax
jne    11c0 <test_alpha_encode_decode_dissimilar+0x50>
mov    $0x7148,%ebx
mov    $0xc8,%r15d
mov    $0xfffffffe,%r12d
mov    $0xc8,%ebp
mov    $0xfffffffe,%r13d
jmp    135b <test_alpha_encode_decode_dissimilar+0x1eb>
nopw   0x0(%rax,%rax,1)
add    $0x2,%r13
add    $0x2cf,%rbx
add    $0xffffffff,%ebp
add    $0x1,%r15d
cmp    $0x232a8,%rbx
je     137a <test_alpha_encode_decode_dissimilar+0x20a>
cmp    %r15d,%ebp
jae    1340 <test_alpha_encode_decode_dissimilar+0x1d0>
mov    %r13d,%edx
and    $0xfffffffe,%edx
add    $0x2,%rdx
lea    (%r14,%rbx,1),%rdi
mov    $0x40,%esi
call   1040 <memset@plt>
jmp    1340 <test_alpha_encode_decode_dissimilar+0x1d0>
lea    0x232a8(%r14),%r15
mov    $0x140,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x40,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
lea    -0x2(%rbx),%rdx
lea    0x2d1(%r15),%rdi
mov    $0x40,%esi
call   1040 <memset@plt>
lea    -0x4(%rbx),%rdx
lea    0x5a2(%r15),%rdi
mov    $0x40,%esi
call   1040 <memset@plt>
lea    -0x6(%rbx),%rdx
lea    0x873(%r15),%rdi
mov    $0x40,%esi
call   1040 <memset@plt>
add    $0xb44,%r15
add    $0xfffffffffffffff8,%rbx
jne    1390 <test_alpha_encode_decode_dissimilar+0x220>
mov    $0x2a490,%ebx
mov    $0x64,%ebp
jmp    1411 <test_alpha_encode_decode_dissimilar+0x2a1>
nopl   0x0(%rax,%rax,1)
add    $0x2d0,%ebx
add    $0xffffffff,%ebp
cmp    $0x4d710,%ebx
je     1458 <test_alpha_encode_decode_dissimilar+0x2e8>
mov    %ebp,%eax
imul   %ebp,%eax
mov    $0x2710,%edi
sub    %eax,%edi
call   1090 <sqrt@plt>
mov    $0x190,%ecx
sub    %eax,%ecx
lea    0x190(%rax),%edx
cmp    %edx,%ecx
jge    1400 <test_alpha_encode_decode_dissimilar+0x290>
add    %ebx,%ecx
add    $0xfffffe70,%ecx
movslq %ecx,%rdi
add    %r14,%rdi
lea    (%r12,%rax,2),%edx
and    $0xfffffffe,%edx
add    $0x2,%rdx
mov    $0x60,%esi
call   1040 <memset@plt>
jmp    1400 <test_alpha_encode_decode_dissimilar+0x290>
mov    $0x34be8,%ebx
nopl   (%rax)
lea    (%r14,%rbx,1),%rdi
mov    $0x280,%edx
mov    $0x7f,%esi
call   1040 <memset@plt>
lea    (%r14,%rbx,1),%rdi
add    $0x2d0,%rdi
mov    $0x280,%edx
mov    $0x7f,%esi
call   1040 <memset@plt>
lea    (%r14,%rbx,1),%rdi
add    $0x5a0,%rdi
mov    $0x280,%edx
mov    $0x7f,%esi
call   1040 <memset@plt>
lea    (%r14,%rbx,1),%rdi
add    $0x870,%rdi
mov    $0x280,%edx
mov    $0x7f,%esi
call   1040 <memset@plt>
lea    (%r14,%rbx,1),%rdi
add    $0xb40,%rdi
mov    $0x280,%edx
mov    $0x7f,%esi
call   1040 <memset@plt>
add    $0xe10,%rbx
cmp    $0x3bc68,%rbx
jne    1460 <test_alpha_encode_decode_dissimilar+0x2f0>
movl   $0x3000,0x4(%rsp)
movl   $0x3000,(%rsp)
lea    0x3010(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rsp,%rcx
mov    %r14,%r8
mov    $0x65400,%r9d
call   1030 <FS460_encode_alpha_masks_from_bitmap@plt>
test   %eax,%eax
jne    1586 <test_alpha_encode_decode_dissimilar+0x416>
mov    0x4(%rsp),%esi
mov    (%rsp),%ecx
lea    0x3010(%rsp),%rdi
lea    0x10(%rsp),%rdx
call   1050 <FS460_set_alpha_masks@plt>
mov    $0x65400,%edi
call   1070 <OS_alloc@plt>
test   %rax,%rax
je     1586 <test_alpha_encode_decode_dissimilar+0x416>
mov    %rax,%rbx
movq   $0x65400,0x8(%rsp)
lea    0x8(%rsp),%rsi
lea    0x3010(%rsp),%rdx
lea    0x10(%rsp),%r8
mov    %rax,%rdi
mov    $0x3000,%ecx
mov    $0x3000,%r9d
call   1080 <FS460_decode_bitmap_from_alpha_masks@plt>
mov    %rbx,%rdi
call   1060 <OS_free@plt>
mov    %r14,%rdi
call   1060 <OS_free@plt>
add    $0x6018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test_alpha_encode_decode_dissimilar() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [6144 x i16]
%4 = alloca [6144 x i16]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = call i64 @OS_alloc(i32 414720)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %1
%14 = load i8*, i8** %1
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %233
16: ; preds = %0
store i32 0, i32* %8
br label %17
17: ; preds = %25, %16
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 414720
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i8*, i8** %1
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %20
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %17
28: ; preds = %17
store i32 80, i32* %9
br label %29
29: ; preds = %48, %28
%30 = load i32, i32* %9
%31 = icmp slt i32 %30, 160
br i1 %31, label %32, label %51
32: ; preds = %29
store i32 40, i32* %8
br label %33
33: ; preds = %44, %32
%34 = load i32, i32* %8
%35 = icmp slt i32 %34, 160
br i1 %35, label %36, label %47
36: ; preds = %33
%37 = load i8*, i8** %1
%38 = load i32, i32* %9
%39 = mul nsw i32 720, %38
%40 = load i32, i32* %8
%41 = add nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %37, i64 %42
store i8 32, i8* %43
br label %44
44: ; preds = %36
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %33
47: ; preds = %33
br label %48
48: ; preds = %47
%49 = load i32, i32* %9
%50 = add nsw i32 %49, 1
store i32 %50, i32* %9
br label %29
51: ; preds = %29
store i32 40, i32* %9
br label %52
52: ; preds = %77, %51
%53 = load i32, i32* %9
%54 = icmp slt i32 %53, 200
br i1 %54, label %55, label %80
55: ; preds = %52
%56 = load i32, i32* %9
%57 = sub nsw i32 %56, 40
%58 = sub nsw i32 200, %57
store i32 %58, i32* %8
br label %59
59: ; preds = %73, %55
%60 = load i32, i32* %8
%61 = load i32, i32* %9
%62 = sub nsw i32 %61, 40
%63 = add nsw i32 200, %62
%64 = icmp slt i32 %60, %63
br i1 %64, label %65, label %76
65: ; preds = %59
%66 = load i8*, i8** %1
%67 = load i32, i32* %9
%68 = mul nsw i32 720, %67
%69 = load i32, i32* %8
%70 = add nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %66, i64 %71
store i8 64, i8* %72
br label %73
73: ; preds = %65
%74 = load i32, i32* %8
%75 = add nsw i32 %74, 1
store i32 %75, i32* %8
br label %59
76: ; preds = %59
br label %77
77: ; preds = %76
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %52
80: ; preds = %52
store i32 200, i32* %9
br label %81
81: ; preds = %106, %80
%82 = load i32, i32* %9
%83 = icmp slt i32 %82, 360
br i1 %83, label %84, label %109
84: ; preds = %81
%85 = load i32, i32* %9
%86 = sub nsw i32 360, %85
%87 = sub nsw i32 200, %86
store i32 %87, i32* %8
br label %88
88: ; preds = %102, %84
%89 = load i32, i32* %8
%90 = load i32, i32* %9
%91 = sub nsw i32 360, %90
%92 = add nsw i32 200, %91
%93 = icmp slt i32 %89, %92
br i1 %93, label %94, label %105
94: ; preds = %88
%95 = load i8*, i8** %1
%96 = load i32, i32* %9
%97 = mul nsw i32 720, %96
%98 = load i32, i32* %8
%99 = add nsw i32 %97, %98
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %95, i64 %100
store i8 64, i8* %101
br label %102
102: ; preds = %94
%103 = load i32, i32* %8
%104 = add nsw i32 %103, 1
store i32 %104, i32* %8
br label %88
105: ; preds = %88
br label %106
106: ; preds = %105
%107 = load i32, i32* %9
%108 = add nsw i32 %107, 1
store i32 %108, i32* %9
br label %81
109: ; preds = %81
store i32 240, i32* %9
br label %110
110: ; preds = %141, %109
%111 = load i32, i32* %9
%112 = icmp slt i32 %111, 440
br i1 %112, label %113, label %144
113: ; preds = %110
%114 = load i32, i32* %9
%115 = sub nsw i32 340, %114
%116 = load i32, i32* %9
%117 = sub nsw i32 340, %116
%118 = mul nsw i32 %115, %117
%119 = sub nsw i32 10000, %118
%120 = call i64 @sqrt(i32 %119)
%121 = trunc i64 %120 to i32
store i32 %121, i32* %10
%122 = load i32, i32* %10
%123 = sub nsw i32 400, %122
store i32 %123, i32* %8
br label %124
124: ; preds = %137, %113
%125 = load i32, i32* %8
%126 = load i32, i32* %10
%127 = add nsw i32 400, %126
%128 = icmp slt i32 %125, %127
br i1 %128, label %129, label %140
129: ; preds = %124
%130 = load i8*, i8** %1
%131 = load i32, i32* %9
%132 = mul nsw i32 720, %131
%133 = load i32, i32* %8
%134 = add nsw i32 %132, %133
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %130, i64 %135
store i8 96, i8* %136
br label %137
137: ; preds = %129
%138 = load i32, i32* %8
%139 = add nsw i32 %138, 1
store i32 %139, i32* %8
br label %124
140: ; preds = %124
br label %141
141: ; preds = %140
%142 = load i32, i32* %9
%143 = add nsw i32 %142, 1
store i32 %143, i32* %9
br label %110
144: ; preds = %110
store i32 300, i32* %9
br label %145
145: ; preds = %164, %144
%146 = load i32, i32* %9
%147 = icmp slt i32 %146, 340
br i1 %147, label %148, label %167
148: ; preds = %145
store i32 40, i32* %8
br label %149
149: ; preds = %160, %148
%150 = load i32, i32* %8
%151 = icmp slt i32 %150, 680
br i1 %151, label %152, label %163
152: ; preds = %149
%153 = load i8*, i8** %1
%154 = load i32, i32* %9
%155 = mul nsw i32 720, %154
%156 = load i32, i32* %8
%157 = add nsw i32 %155, %156
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %153, i64 %158
store i8 127, i8* %159
br label %160
160: ; preds = %152
%161 = load i32, i32* %8
%162 = add nsw i32 %161, 1
store i32 %162, i32* %8
br label %149
163: ; preds = %149
br label %164
164: ; preds = %163
%165 = load i32, i32* %9
%166 = add nsw i32 %165, 1
store i32 %166, i32* %9
br label %145
167: ; preds = %145
store i32 12288, i32* %5
store i32 12288, i32* %6
%168 = getelementptr inbounds [6144 x i16], [6144 x i16]* %3, i64 0, i64 0
%169 = getelementptr inbounds [6144 x i16], [6144 x i16]* %4, i64 0, i64 0
%170 = load i8*, i8** %1
%171 = call i32 @FS460_encode_alpha_masks_from_bitmap(i16* %168, i32* %5, i16* %169, i32* %6, i8* %170, i32 414720)
store i32 %171, i32* %11
%172 = load i32, i32* %11
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %175
174: ; preds = %167
br label %230
175: ; preds = %167
%176 = getelementptr inbounds [6144 x i16], [6144 x i16]* %3, i64 0, i64 0
%177 = load i32, i32* %5
%178 = getelementptr inbounds [6144 x i16], [6144 x i16]* %4, i64 0, i64 0
%179 = load i32, i32* %6
%180 = call i32 @FS460_set_alpha_masks(i16* %176, i32 %177, i16* %178, i32 %179)
store i32 %180, i32* %11
%181 = call i64 @OS_alloc(i32 414720)
%182 = inttoptr i64 %181 to i8*
store i8* %182, i8** %2
%183 = load i8*, i8** %2
%184 = icmp ne i8* %183, null
br i1 %184, label %185, label %229
185: ; preds = %175
store i64 414720, i64* %7
%186 = load i8*, i8** %2
%187 = getelementptr inbounds [6144 x i16], [6144 x i16]* %3, i64 0, i64 0
%188 = getelementptr inbounds [6144 x i16], [6144 x i16]* %4, i64 0, i64 0
%189 = call i32 @FS460_decode_bitmap_from_alpha_masks(i8* %186, i64* %7, i16* %187, i32 12288, i16* %188, i32 12288)
store i32 %189, i32* %11
%190 = load i32, i32* %11
%191 = icmp ne i32 %190, 0
br i1 %191, label %192, label %193
192: ; preds = %185
br label %226
193: ; preds = %185
%194 = load i64, i64* %7
%195 = icmp ne i64 %194, 414720
br i1 %195, label %196, label %197
196: ; preds = %193
br label %197
197: ; preds = %196, %193
store i32 0, i32* %8
br label %198
198: ; preds = %217, %197
%199 = load i32, i32* %8
%200 = icmp slt i32 %199, 414720
br i1 %200, label %201, label %220
201: ; preds = %198
%202 = load i8*, i8** %2
%203 = load i32, i32* %8
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8, i8* %202, i64 %204
%206 = load i8, i8* %205
%207 = zext i8 %206 to i32
%208 = load i8*, i8** %1
%209 = load i32, i32* %8
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %208, i64 %210
%212 = load i8, i8* %211
%213 = zext i8 %212 to i32
%214 = icmp ne i32 %207, %213
br i1 %214, label %215, label %216
215: ; preds = %201
br label %220
216: ; preds = %201
br label %217
217: ; preds = %216
%218 = load i32, i32* %8
%219 = add nsw i32 %218, 1
store i32 %219, i32* %8
br label %198
220: ; preds = %215, %198
%221 = load i32, i32* %8
%222 = icmp slt i32 %221, 414720
br i1 %222, label %223, label %224
223: ; preds = %220
br label %225
224: ; preds = %220
br label %225
225: ; preds = %224, %223
br label %226
226: ; preds = %225, %192
%227 = load i8*, i8** %2
%228 = call i32 @OS_free(i8* %227)
br label %229
229: ; preds = %226, %175
br label %230
230: ; preds = %229, %174
%231 = load i8*, i8** %1
%232 = call i32 @OS_free(i8* %231)
br label %233
233: ; preds = %230, %0
ret void
}

LLVM IR (-O2):
define void @test_alpha_encode_decode_dissimilar() {
%1 = alloca [6144 x i16]
%2 = alloca [6144 x i16]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = bitcast [6144 x i16]* %1 to i8*
%7 = bitcast [6144 x i16]* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = tail call i64 @OS_alloc(i32 414720)
%12 = inttoptr i64 %11 to i8*
%13 = icmp eq i64 %11, 0
br i1 %13, label %140, label %14
14: ; preds = %0
br label %15
15: ; preds = %15, %14
%16 = phi i64 [ 0, %14 ], [ %32, %15 ]
%17 = mul nuw nsw i64 %16, 720
%18 = add nuw nsw i64 %17, 57640
%19 = getelementptr i8, i8* %12, i64 %18
%20 = mul i64 %16, 720
%21 = add i64 %20, 58360
%22 = getelementptr i8, i8* %12, i64 %21
%23 = mul i64 %16, 720
%24 = add i64 %23, 59080
%25 = getelementptr i8, i8* %12, i64 %24
%26 = mul i64 %16, 720
%27 = add i64 %26, 59800
%28 = getelementptr i8, i8* %12, i64 %27
%29 = mul i64 %16, 720
%30 = add i64 %29, 60520
%31 = getelementptr i8, i8* %12, i64 %30
%32 = add nuw nsw i64 %16, 5
%33 = icmp eq i64 %32, 80
br i1 %33, label %34, label %15
34: ; preds = %15, %48
%35 = phi i64 [ %50, %48 ], [ 0, %15 ]
%36 = phi i32 [ %49, %48 ], [ 40, %15 ]
%37 = sub nuw nsw i32 240, %36
%38 = add nuw nsw i32 %36, 160
%39 = icmp ult i32 %37, %38
br i1 %39, label %40, label %48
40: ; preds = %34
%41 = shl nuw i64 %35, 1
%42 = add i64 %41, 4294967294
%43 = and i64 %42, 4294967294
%44 = add nuw nsw i64 %43, 2
%45 = mul nuw nsw i64 %35, 719
%46 = add nuw nsw i64 %45, 29000
%47 = getelementptr i8, i8* %12, i64 %46
br label %48
48: ; preds = %40, %34
%49 = add nuw nsw i32 %36, 1
%50 = add nuw nsw i64 %35, 1
%51 = icmp eq i64 %50, 160
br i1 %51, label %52, label %34
52: ; preds = %48, %52
%53 = phi i64 [ %77, %52 ], [ 0, %48 ]
%54 = mul nsw i64 %53, -2
%55 = add nsw i64 %54, 320
%56 = mul nuw nsw i64 %53, 721
%57 = add nuw nsw i64 %56, 144040
%58 = getelementptr i8, i8* %12, i64 %57
%59 = or i64 %53, 1
%60 = mul nsw i64 %59, -2
%61 = add nsw i64 %60, 320
%62 = mul nuw nsw i64 %59, 721
%63 = add nuw nsw i64 %62, 144040
%64 = getelementptr i8, i8* %12, i64 %63
%65 = or i64 %53, 2
%66 = mul nsw i64 %65, -2
%67 = add nsw i64 %66, 320
%68 = mul nuw nsw i64 %65, 721
%69 = add nuw nsw i64 %68, 144040
%70 = getelementptr i8, i8* %12, i64 %69
%71 = or i64 %53, 3
%72 = mul nsw i64 %71, -2
%73 = add nsw i64 %72, 320
%74 = mul nuw nsw i64 %71, 721
%75 = add nuw nsw i64 %74, 144040
%76 = getelementptr i8, i8* %12, i64 %75
%77 = add nuw nsw i64 %53, 4
%78 = icmp eq i64 %77, 160
br i1 %78, label %79, label %52
79: ; preds = %52, %100
%80 = phi i32 [ %102, %100 ], [ 0, %52 ]
%81 = phi i32 [ %101, %100 ], [ 240, %52 ]
%82 = sub nsw i32 340, %81
%83 = mul nsw i32 %82, %82
%84 = sub nsw i32 10000, %83
%85 = tail call i64 @sqrt(i32 %84)
%86 = trunc i64 %85 to i32
%87 = sub i32 400, %86
%88 = add nsw i32 %86, 400
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %100
90: ; preds = %79
%91 = mul nuw nsw i32 %80, 720
%92 = add nuw nsw i32 %91, 173200
%93 = sub i32 %92, %86
%94 = sext i32 %93 to i64
%95 = getelementptr i8, i8* %12, i64 %94
%96 = shl i64 %85, 1
%97 = add i64 %96, 4294967294
%98 = and i64 %97, 4294967294
%99 = add nuw nsw i64 %98, 2
br label %100
100: ; preds = %90, %79
%101 = add nuw nsw i32 %81, 1
%102 = add nuw nsw i32 %80, 1
%103 = icmp eq i32 %102, 200
br i1 %103, label %104, label %79
104: ; preds = %100, %104
%105 = phi i64 [ %121, %104 ], [ 0, %100 ]
%106 = mul nuw nsw i64 %105, 720
%107 = add nuw nsw i64 %106, 216040
%108 = getelementptr i8, i8* %12, i64 %107
%109 = mul i64 %105, 720
%110 = add i64 %109, 216760
%111 = getelementptr i8, i8* %12, i64 %110
%112 = mul i64 %105, 720
%113 = add i64 %112, 217480
%114 = getelementptr i8, i8* %12, i64 %113
%115 = mul i64 %105, 720
%116 = add i64 %115, 218200
%117 = getelementptr i8, i8* %12, i64 %116
%118 = mul i64 %105, 720
%119 = add i64 %118, 218920
%120 = getelementptr i8, i8* %12, i64 %119
%121 = add nuw nsw i64 %105, 5
%122 = icmp eq i64 %121, 40
br i1 %122, label %123, label %104
123: ; preds = %104
store i32 12288, i32* %3
store i32 12288, i32* %4
%124 = getelementptr inbounds [6144 x i16], [6144 x i16]* %1, i64 0, i64 0
%125 = getelementptr inbounds [6144 x i16], [6144 x i16]* %2, i64 0, i64 0
%126 = call i32 @FS460_encode_alpha_masks_from_bitmap(i16* %124, i32* %3, i16* %125, i32* %4, i8* %12, i32 414720)
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %138
128: ; preds = %123
%129 = load i32, i32* %3
%130 = load i32, i32* %4
%131 = call i32 @FS460_set_alpha_masks(i16* %124, i32 %129, i16* %125, i32 %130)
%132 = call i64 @OS_alloc(i32 414720)
%133 = inttoptr i64 %132 to i8*
%134 = icmp eq i64 %132, 0
br i1 %134, label %138, label %135
135: ; preds = %128
store i64 414720, i64* %5
%136 = call i32 @FS460_decode_bitmap_from_alpha_masks(i8* %133, i64* %5, i16* %124, i32 12288, i16* %125, i32 12288)
%137 = call i32 @OS_free(i8* %133)
br label %138
138: ; preds = %128, %135, %123
%139 = call i32 @OS_free(i8* %12)
br label %140
140: ; preds = %138, %0
ret void
}