#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*/ hash(int);
void test(int M, int N, int O) {
  int c2, c4, c6;
  int i, j, k;
  if ((M >= 3) && (N >= 4)) {
    for (c2 = 2; c2 <= O - 1; c2++) {
      for (c6 = 1; c6 <= M; c6++) {
        {
          hash(1);
          hash(c2);
          hash(2);
          hash(c6);
        };
        {
          hash(2);
          hash(c2);
          hash(2);
          hash(c6);
        };
      }
      for (c4 = 4; c4 <= 2 * N - 3; c4++) {
        for (c6 = 1; c6 <= M; c6++) {
          if ((c4 + 1) % 2 == 0) {
            j = (c4 + 1) / 2;
            {
              hash(1);
              hash(c2);
              hash((c4 + 1) / 2);
              hash(c6);
            };
            {
              hash(2);
              hash(c2);
              hash((c4 + 1) / 2);
              hash(c6);
            };
          }
        }
        for (c6 = 2; c6 <= M - 1; c6++) {
          if (c4 % 2 == 0) {
            {
              hash(3);
              hash(c2);
              hash(c4 / 2);
              hash(c6);
            };
          }
        }
      }
      c4 = 2 * N - 2;
      for (c6 = 2; c6 <= M - 1; c6++) {
        j = N - 1;
        {
          hash(3);
          hash(c2);
          hash(N - 1);
          hash(c6);
        };
      }
    }
  }
  if ((M >= 3) && (N == 3)) {
    for (c2 = 2; c2 <= O - 1; c2++) {
      for (c6 = 1; c6 <= M; c6++) {
        {
          hash(1);
          hash(c2);
          hash(2);
          hash(c6);
        };
        {
          hash(2);
          hash(c2);
          hash(2);
          hash(c6);
        };
      }
      for (c6 = 2; c6 <= M - 1; c6++) {
        {
          hash(3);
          hash(c2);
          hash(2);
          hash(c6);
        };
      }
    }
  }
  if ((M >= 1) && (M <= 2) && (N >= 3)) {
    for (c2 = 2; c2 <= O - 1; c2++) {
      for (c4 = 3; c4 <= 2 * N - 3; c4++) {
        for (c6 = 1; c6 <= M; c6++) {
          if ((c4 + 1) % 2 == 0) {
            j = (c4 + 1) / 2;
            {
              hash(1);
              hash(c2);
              hash((c4 + 1) / 2);
              hash(c6);
            };
            {
              hash(2);
              hash(c2);
              hash((c4 + 1) / 2);
              hash(c6);
            };
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0x4(%rbp)
jl     1373 <test+0x263>
cmpl   $0x4,-0x8(%rbp)
jl     1373 <test+0x263>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     136e <test+0x25e>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11b6 <test+0xa6>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <test+0x44>
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     12fb <test+0x1eb>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     127d <test+0x16d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    126a <test+0x15a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
jmp    126f <test+0x15f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d8 <test+0xc8>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12e8 <test+0x1d8>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12d5 <test+0x1c5>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
jmp    12da <test+0x1ca>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1284 <test+0x174>
jmp    12ed <test+0x1dd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bd <test+0xad>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     135b <test+0x24b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    130e <test+0x1fe>
jmp    1360 <test+0x250>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <test+0x2c>
jmp    1373 <test+0x263>
cmpl   $0x3,-0x4(%rbp)
jl     146a <test+0x35a>
cmpl   $0x3,-0x8(%rbp)
jne    146a <test+0x35a>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1465 <test+0x355>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1408 <test+0x2f8>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13a6 <test+0x296>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1452 <test+0x342>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    140f <test+0x2ff>
jmp    1457 <test+0x347>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    138e <test+0x27e>
jmp    146a <test+0x35a>
cmpl   $0x1,-0x4(%rbp)
jl     1592 <test+0x482>
cmpl   $0x2,-0x4(%rbp)
jg     1592 <test+0x482>
cmpl   $0x3,-0x8(%rbp)
jl     1592 <test+0x482>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     158d <test+0x47d>
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     157a <test+0x46a>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1567 <test+0x457>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1554 <test+0x444>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%edi
call   1030 <hash@plt>
jmp    1559 <test+0x449>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14c2 <test+0x3b2>
jmp    156c <test+0x45c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14a7 <test+0x397>
jmp    157f <test+0x46f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    148f <test+0x37f>
jmp    1592 <test+0x482>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,0x4(%rsp)
mov    %rsi,0x10(%rsp)
mov    %edi,%r14d
cmp    $0x3,%edi
mov    %r14,0x8(%rsp)
jl     1327 <test+0x217>
cmpl   $0x4,0x10(%rsp)
jl     1327 <test+0x217>
cmpl   $0x3,0x4(%rsp)
jl     1327 <test+0x217>
mov    0x10(%rsp),%rcx
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffd,%eax
lea    -0x1(%rcx),%ebp
cmp    $0x5,%eax
mov    $0x4,%ecx
cmovge %eax,%ecx
mov    %ecx,0x1c(%rsp)
neg    %r14d
mov    %r14,0x20(%rsp)
mov    $0x2,%r15d
mov    %ebp,0x18(%rsp)
nopl   (%rax)
mov    $0x1,%ebx
mov    0x20(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1190 <test+0x80>
mov    $0x4,%r12d
jmp    11fe <test+0xee>
cmp    0x1c(%rsp),%r12d
mov    %r13d,%r12d
je     12e0 <test+0x1d0>
lea    0x1(%r12),%r13d
mov    %r13d,%ebx
shr    %ebx
mov    $0x1,%r14d
mov    0x20(%rsp),%rbp
jmp    1235 <test+0x125>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r14,%rbp,1),%eax
add    $0x1,%eax
mov    %r14d,%ecx
add    $0x1,%ecx
mov    %ecx,%r14d
cmp    $0x1,%eax
je     1280 <test+0x170>
test   $0x1,%r13b
jne    1220 <test+0x110>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
jmp    1220 <test+0x110>
nop
mov    %r12d,%ebx
shr    %ebx
mov    $0x2,%ebp
mov    0x8(%rsp),%r14
jmp    12ac <test+0x19c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ebp,%r14d
je     11f0 <test+0xe0>
test   $0x1,%r12b
jne    12a0 <test+0x190>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
jmp    12a0 <test+0x190>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2,%ebx
mov    0x18(%rsp),%ebp
nopl   0x0(%rax)
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    12f0 <test+0x1e0>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jne    1180 <test+0x70>
cmp    $0x3,%r14d
jl     1407 <test+0x2f7>
cmpl   $0x3,0x10(%rsp)
jne    1407 <test+0x2f7>
cmpl   $0x3,0x4(%rsp)
jl     1407 <test+0x2f7>
mov    0x8(%rsp),%r14
neg    %r14d
mov    $0x2,%ebp
mov    0x8(%rsp),%r15
nopl   0x0(%rax)
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1370 <test+0x260>
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    13d0 <test+0x2c0>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jne    1360 <test+0x250>
mov    0x8(%rsp),%rax
add    $0xffffffff,%eax
cmp    $0x1,%eax
ja     14fe <test+0x3ee>
cmpl   $0x3,0x10(%rsp)
jl     14fe <test+0x3ee>
cmpl   $0x3,0x4(%rsp)
jl     14fe <test+0x3ee>
mov    0x10(%rsp),%rax
lea    (%rax,%rax,1),%r15d
add    $0xfffffffd,%r15d
cmp    $0x4,%r15d
mov    $0x3,%eax
cmovl  %eax,%r15d
mov    0x8(%rsp),%rax
neg    %eax
mov    %rax,0x8(%rsp)
mov    $0x2,%r14d
jmp    146f <test+0x35f>
nopl   0x0(%rax)
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
je     14fe <test+0x3ee>
mov    $0x3,%r12d
jmp    1488 <test+0x378>
nopw   0x0(%rax,%rax,1)
cmp    %r15d,%r12d
mov    %r13d,%r12d
je     1460 <test+0x350>
lea    0x1(%r12),%r13d
mov    %r13d,%ebx
shr    %ebx
mov    $0x1,%ebp
jmp    14b6 <test+0x3a6>
nopl   0x0(%rax)
mov    0x8(%rsp),%rax
add    %ebp,%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
je     1480 <test+0x370>
test   $0x1,%r13b
jne    14a0 <test+0x390>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
jmp    14a0 <test+0x390>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 3
br i1 %14, label %15, label %143
15: ; preds = %3
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 4
br i1 %17, label %18, label %143
18: ; preds = %15
store i32 2, i32* %7
br label %19
19: ; preds = %139, %18
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %142
24: ; preds = %19
store i32 1, i32* %9
br label %25
25: ; preds = %42, %24
%26 = load i32, i32* %9
%27 = load i32, i32* %4
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %45
29: ; preds = %25
%30 = call i32 @hash(i32 1)
%31 = load i32, i32* %7
%32 = call i32 @hash(i32 %31)
%33 = call i32 @hash(i32 2)
%34 = load i32, i32* %9
%35 = call i32 @hash(i32 %34)
%36 = call i32 @hash(i32 2)
%37 = load i32, i32* %7
%38 = call i32 @hash(i32 %37)
%39 = call i32 @hash(i32 2)
%40 = load i32, i32* %9
%41 = call i32 @hash(i32 %40)
br label %42
42: ; preds = %29
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %25
45: ; preds = %25
store i32 4, i32* %8
br label %46
46: ; preds = %112, %45
%47 = load i32, i32* %8
%48 = load i32, i32* %5
%49 = mul nsw i32 2, %48
%50 = sub nsw i32 %49, 3
%51 = icmp sle i32 %47, %50
br i1 %51, label %52, label %115
52: ; preds = %46
store i32 1, i32* %9
br label %53
53: ; preds = %85, %52
%54 = load i32, i32* %9
%55 = load i32, i32* %4
%56 = icmp sle i32 %54, %55
br i1 %56, label %57, label %88
57: ; preds = %53
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
%60 = srem i32 %59, 2
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %84
62: ; preds = %57
%63 = load i32, i32* %8
%64 = add nsw i32 %63, 1
%65 = sdiv i32 %64, 2
store i32 %65, i32* %11
%66 = call i32 @hash(i32 1)
%67 = load i32, i32* %7
%68 = call i32 @hash(i32 %67)
%69 = load i32, i32* %8
%70 = add nsw i32 %69, 1
%71 = sdiv i32 %70, 2
%72 = call i32 @hash(i32 %71)
%73 = load i32, i32* %9
%74 = call i32 @hash(i32 %73)
%75 = call i32 @hash(i32 2)
%76 = load i32, i32* %7
%77 = call i32 @hash(i32 %76)
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
%80 = sdiv i32 %79, 2
%81 = call i32 @hash(i32 %80)
%82 = load i32, i32* %9
%83 = call i32 @hash(i32 %82)
br label %84
84: ; preds = %62, %57
br label %85
85: ; preds = %84
%86 = load i32, i32* %9
%87 = add nsw i32 %86, 1
store i32 %87, i32* %9
br label %53
88: ; preds = %53
store i32 2, i32* %9
br label %89
89: ; preds = %108, %88
%90 = load i32, i32* %9
%91 = load i32, i32* %4
%92 = sub nsw i32 %91, 1
%93 = icmp sle i32 %90, %92
br i1 %93, label %94, label %111
94: ; preds = %89
%95 = load i32, i32* %8
%96 = srem i32 %95, 2
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %107
98: ; preds = %94
%99 = call i32 @hash(i32 3)
%100 = load i32, i32* %7
%101 = call i32 @hash(i32 %100)
%102 = load i32, i32* %8
%103 = sdiv i32 %102, 2
%104 = call i32 @hash(i32 %103)
%105 = load i32, i32* %9
%106 = call i32 @hash(i32 %105)
br label %107
107: ; preds = %98, %94
br label %108
108: ; preds = %107
%109 = load i32, i32* %9
%110 = add nsw i32 %109, 1
store i32 %110, i32* %9
br label %89
111: ; preds = %89
br label %112
112: ; preds = %111
%113 = load i32, i32* %8
%114 = add nsw i32 %113, 1
store i32 %114, i32* %8
br label %46
115: ; preds = %46
%116 = load i32, i32* %5
%117 = mul nsw i32 2, %116
%118 = sub nsw i32 %117, 2
store i32 %118, i32* %8
store i32 2, i32* %9
br label %119
119: ; preds = %135, %115
%120 = load i32, i32* %9
%121 = load i32, i32* %4
%122 = sub nsw i32 %121, 1
%123 = icmp sle i32 %120, %122
br i1 %123, label %124, label %138
124: ; preds = %119
%125 = load i32, i32* %5
%126 = sub nsw i32 %125, 1
store i32 %126, i32* %11
%127 = call i32 @hash(i32 3)
%128 = load i32, i32* %7
%129 = call i32 @hash(i32 %128)
%130 = load i32, i32* %5
%131 = sub nsw i32 %130, 1
%132 = call i32 @hash(i32 %131)
%133 = load i32, i32* %9
%134 = call i32 @hash(i32 %133)
br label %135
135: ; preds = %124
%136 = load i32, i32* %9
%137 = add nsw i32 %136, 1
store i32 %137, i32* %9
br label %119
138: ; preds = %119
br label %139
139: ; preds = %138
%140 = load i32, i32* %7
%141 = add nsw i32 %140, 1
store i32 %141, i32* %7
br label %19
142: ; preds = %19
br label %143
143: ; preds = %142, %15, %3
%144 = load i32, i32* %4
%145 = icmp sge i32 %144, 3
br i1 %145, label %146, label %197
146: ; preds = %143
%147 = load i32, i32* %5
%148 = icmp eq i32 %147, 3
br i1 %148, label %149, label %197
149: ; preds = %146
store i32 2, i32* %7
br label %150
150: ; preds = %193, %149
%151 = load i32, i32* %7
%152 = load i32, i32* %6
%153 = sub nsw i32 %152, 1
%154 = icmp sle i32 %151, %153
br i1 %154, label %155, label %196
155: ; preds = %150
store i32 1, i32* %9
br label %156
156: ; preds = %173, %155
%157 = load i32, i32* %9
%158 = load i32, i32* %4
%159 = icmp sle i32 %157, %158
br i1 %159, label %160, label %176
160: ; preds = %156
%161 = call i32 @hash(i32 1)
%162 = load i32, i32* %7
%163 = call i32 @hash(i32 %162)
%164 = call i32 @hash(i32 2)
%165 = load i32, i32* %9
%166 = call i32 @hash(i32 %165)
%167 = call i32 @hash(i32 2)
%168 = load i32, i32* %7
%169 = call i32 @hash(i32 %168)
%170 = call i32 @hash(i32 2)
%171 = load i32, i32* %9
%172 = call i32 @hash(i32 %171)
br label %173
173: ; preds = %160
%174 = load i32, i32* %9
%175 = add nsw i32 %174, 1
store i32 %175, i32* %9
br label %156
176: ; preds = %156
store i32 2, i32* %9
br label %177
177: ; preds = %189, %176
%178 = load i32, i32* %9
%179 = load i32, i32* %4
%180 = sub nsw i32 %179, 1
%181 = icmp sle i32 %178, %180
br i1 %181, label %182, label %192
182: ; preds = %177
%183 = call i32 @hash(i32 3)
%184 = load i32, i32* %7
%185 = call i32 @hash(i32 %184)
%186 = call i32 @hash(i32 2)
%187 = load i32, i32* %9
%188 = call i32 @hash(i32 %187)
br label %189
189: ; preds = %182
%190 = load i32, i32* %9
%191 = add nsw i32 %190, 1
store i32 %191, i32* %9
br label %177
192: ; preds = %177
br label %193
193: ; preds = %192
%194 = load i32, i32* %7
%195 = add nsw i32 %194, 1
store i32 %195, i32* %7
br label %150
196: ; preds = %150
br label %197
197: ; preds = %196, %146, %143
%198 = load i32, i32* %4
%199 = icmp sge i32 %198, 1
br i1 %199, label %200, label %264
200: ; preds = %197
%201 = load i32, i32* %4
%202 = icmp sle i32 %201, 2
br i1 %202, label %203, label %264
203: ; preds = %200
%204 = load i32, i32* %5
%205 = icmp sge i32 %204, 3
br i1 %205, label %206, label %264
206: ; preds = %203
store i32 2, i32* %7
br label %207
207: ; preds = %260, %206
%208 = load i32, i32* %7
%209 = load i32, i32* %6
%210 = sub nsw i32 %209, 1
%211 = icmp sle i32 %208, %210
br i1 %211, label %212, label %263
212: ; preds = %207
store i32 3, i32* %8
br label %213
213: ; preds = %256, %212
%214 = load i32, i32* %8
%215 = load i32, i32* %5
%216 = mul nsw i32 2, %215
%217 = sub nsw i32 %216, 3
%218 = icmp sle i32 %214, %217
br i1 %218, label %219, label %259
219: ; preds = %213
store i32 1, i32* %9
br label %220
220: ; preds = %252, %219
%221 = load i32, i32* %9
%222 = load i32, i32* %4
%223 = icmp sle i32 %221, %222
br i1 %223, label %224, label %255
224: ; preds = %220
%225 = load i32, i32* %8
%226 = add nsw i32 %225, 1
%227 = srem i32 %226, 2
%228 = icmp eq i32 %227, 0
br i1 %228, label %229, label %251
229: ; preds = %224
%230 = load i32, i32* %8
%231 = add nsw i32 %230, 1
%232 = sdiv i32 %231, 2
store i32 %232, i32* %11
%233 = call i32 @hash(i32 1)
%234 = load i32, i32* %7
%235 = call i32 @hash(i32 %234)
%236 = load i32, i32* %8
%237 = add nsw i32 %236, 1
%238 = sdiv i32 %237, 2
%239 = call i32 @hash(i32 %238)
%240 = load i32, i32* %9
%241 = call i32 @hash(i32 %240)
%242 = call i32 @hash(i32 2)
%243 = load i32, i32* %7
%244 = call i32 @hash(i32 %243)
%245 = load i32, i32* %8
%246 = add nsw i32 %245, 1
%247 = sdiv i32 %246, 2
%248 = call i32 @hash(i32 %247)
%249 = load i32, i32* %9
%250 = call i32 @hash(i32 %249)
br label %251
251: ; preds = %229, %224
br label %252
252: ; preds = %251
%253 = load i32, i32* %9
%254 = add nsw i32 %253, 1
store i32 %254, i32* %9
br label %220
255: ; preds = %220
br label %256
256: ; preds = %255
%257 = load i32, i32* %8
%258 = add nsw i32 %257, 1
store i32 %258, i32* %8
br label %213
259: ; preds = %213
br label %260
260: ; preds = %259
%261 = load i32, i32* %7
%262 = add nsw i32 %261, 1
store i32 %262, i32* %7
br label %207
263: ; preds = %207
br label %264
264: ; preds = %263, %203, %200, %197
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 2
%5 = icmp sgt i32 %1, 3
%6 = and i1 %4, %5
%7 = icmp sgt i32 %2, 2
%8 = and i1 %6, %7
br i1 %8, label %9, label %76
9: ; preds = %3
%10 = shl nuw nsw i32 %1, 1
%11 = add i32 %10, -3
%12 = add nsw i32 %1, -1
%13 = call i32 @llvm.smax.i32(i32 %11, i32 4)
br label %14
14: ; preds = %73, %9
%15 = phi i32 [ 2, %9 ], [ %74, %73 ]
br label %16
16: ; preds = %14, %16
%17 = phi i32 [ %26, %16 ], [ 1, %14 ]
%18 = tail call i32 @hash(i32 1)
%19 = tail call i32 @hash(i32 %15)
%20 = tail call i32 @hash(i32 2)
%21 = tail call i32 @hash(i32 %17)
%22 = tail call i32 @hash(i32 2)
%23 = tail call i32 @hash(i32 %15)
%24 = tail call i32 @hash(i32 2)
%25 = tail call i32 @hash(i32 %17)
%26 = add nuw i32 %17, 1
%27 = icmp eq i32 %17, %0
br i1 %27, label %28, label %16
28: ; preds = %16, %62
%29 = phi i32 [ %63, %62 ], [ 4, %16 ]
%30 = add nuw nsw i32 %29, 1
%31 = and i32 %30, 1
%32 = icmp eq i32 %31, 0
%33 = lshr i32 %30, 1
br label %38
34: ; preds = %49
%35 = and i32 %29, 1
%36 = icmp eq i32 %35, 0
%37 = lshr i32 %29, 1
br label %52
38: ; preds = %28, %49
%39 = phi i32 [ 1, %28 ], [ %50, %49 ]
br i1 %32, label %40, label %49
40: ; preds = %38
%41 = tail call i32 @hash(i32 1)
%42 = tail call i32 @hash(i32 %15)
%43 = tail call i32 @hash(i32 %33)
%44 = tail call i32 @hash(i32 %39)
%45 = tail call i32 @hash(i32 2)
%46 = tail call i32 @hash(i32 %15)
%47 = tail call i32 @hash(i32 %33)
%48 = tail call i32 @hash(i32 %39)
br label %49
49: ; preds = %38, %40
%50 = add nuw i32 %39, 1
%51 = icmp eq i32 %39, %0
br i1 %51, label %34, label %38
52: ; preds = %34, %59
%53 = phi i32 [ 2, %34 ], [ %60, %59 ]
br i1 %36, label %54, label %59
54: ; preds = %52
%55 = tail call i32 @hash(i32 3)
%56 = tail call i32 @hash(i32 %15)
%57 = tail call i32 @hash(i32 %37)
%58 = tail call i32 @hash(i32 %53)
br label %59
59: ; preds = %52, %54
%60 = add nuw nsw i32 %53, 1
%61 = icmp eq i32 %60, %0
br i1 %61, label %62, label %52
62: ; preds = %59
%63 = add nuw i32 %29, 1
%64 = icmp eq i32 %29, %13
br i1 %64, label %65, label %28
65: ; preds = %62, %65
%66 = phi i32 [ %71, %65 ], [ 2, %62 ]
%67 = tail call i32 @hash(i32 3)
%68 = tail call i32 @hash(i32 %15)
%69 = tail call i32 @hash(i32 %12)
%70 = tail call i32 @hash(i32 %66)
%71 = add nuw nsw i32 %66, 1
%72 = icmp eq i32 %71, %0
br i1 %72, label %73, label %65
73: ; preds = %65
%74 = add nuw nsw i32 %15, 1
%75 = icmp eq i32 %74, %2
br i1 %75, label %76, label %14
76: ; preds = %73, %3
%77 = icmp eq i32 %1, 3
%78 = and i1 %4, %77
%79 = and i1 %78, %7
br i1 %79, label %80, label %105
80: ; preds = %76, %102
%81 = phi i32 [ %103, %102 ], [ 2, %76 ]
br label %82
82: ; preds = %80, %82
%83 = phi i32 [ %92, %82 ], [ 1, %80 ]
%84 = tail call i32 @hash(i32 1)
%85 = tail call i32 @hash(i32 %81)
%86 = tail call i32 @hash(i32 2)
%87 = tail call i32 @hash(i32 %83)
%88 = tail call i32 @hash(i32 2)
%89 = tail call i32 @hash(i32 %81)
%90 = tail call i32 @hash(i32 2)
%91 = tail call i32 @hash(i32 %83)
%92 = add nuw i32 %83, 1
%93 = icmp eq i32 %83, %0
br i1 %93, label %94, label %82
94: ; preds = %82, %94
%95 = phi i32 [ %100, %94 ], [ 2, %82 ]
%96 = tail call i32 @hash(i32 3)
%97 = tail call i32 @hash(i32 %81)
%98 = tail call i32 @hash(i32 2)
%99 = tail call i32 @hash(i32 %95)
%100 = add nuw nsw i32 %95, 1
%101 = icmp eq i32 %100, %0
br i1 %101, label %102, label %94
102: ; preds = %94
%103 = add nuw nsw i32 %81, 1
%104 = icmp eq i32 %103, %2
br i1 %104, label %105, label %80
105: ; preds = %102, %76
%106 = add i32 %0, -1
%107 = icmp ult i32 %106, 2
%108 = icmp sgt i32 %1, 2
%109 = and i1 %107, %108
%110 = and i1 %109, %7
br i1 %110, label %111, label %142
111: ; preds = %105
%112 = shl nuw nsw i32 %1, 1
%113 = add i32 %112, -3
%114 = call i32 @llvm.smax.i32(i32 %113, i32 3)
br label %115
115: ; preds = %139, %111
%116 = phi i32 [ 2, %111 ], [ %140, %139 ]
br label %117
117: ; preds = %115, %137
%118 = phi i32 [ %119, %137 ], [ 3, %115 ]
%119 = add nuw i32 %118, 1
%120 = and i32 %119, 1
%121 = icmp eq i32 %120, 0
%122 = lshr i32 %119, 1
br label %123
123: ; preds = %117, %134
%124 = phi i32 [ 1, %117 ], [ %135, %134 ]
br i1 %121, label %125, label %134
125: ; preds = %123
%126 = tail call i32 @hash(i32 1)
%127 = tail call i32 @hash(i32 %116)
%128 = tail call i32 @hash(i32 %122)
%129 = tail call i32 @hash(i32 %124)
%130 = tail call i32 @hash(i32 2)
%131 = tail call i32 @hash(i32 %116)
%132 = tail call i32 @hash(i32 %122)
%133 = tail call i32 @hash(i32 %124)
br label %134
134: ; preds = %123, %125
%135 = add nuw i32 %124, 1
%136 = icmp eq i32 %124, %0
br i1 %136, label %137, label %123
137: ; preds = %134
%138 = icmp eq i32 %118, %114
br i1 %138, label %139, label %117
139: ; preds = %137
%140 = add nuw nsw i32 %116, 1
%141 = icmp eq i32 %140, %2
br i1 %141, label %142, label %115
142: ; preds = %139, %105
ret void
}