#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 n) {
  int c1, c3, c5;
  int i, j, k;
  if (n >= 2) {
    {
      hash(1);
      hash(1);
    };
    {
      hash(3);
      hash(1);
    };
    for (c3 = 2; c3 <= n; c3++) {
      {
        hash(4);
        hash(1);
        hash(c3);
      };
      {
        hash(6);
        hash(1);
        hash(c3);
      };
    }
  }
  if (n == 1) {
    {
      hash(1);
      hash(1);
    };
    {
      hash(3);
      hash(1);
    };
  }
  for (c1 = 2; c1 <= n - 1; c1++) {
    {
      hash(1);
      hash(c1);
    };
    for (c3 = 1; c3 <= c1 - 1; c3++) {
      {
        hash(2);
        hash(c1);
        hash(c3);
      };
    }
    {
      hash(3);
      hash(c1);
    };
    for (c3 = c1 + 1; c3 <= n; c3++) {
      {
        hash(4);
        hash(c1);
        hash(c3);
      };
      for (c5 = 1; c5 <= c1 - 1; c5++) {
        {
          hash(5);
          hash(c1);
          hash(c3);
          hash(c5);
        };
      }
      {
        hash(6);
        hash(c1);
        hash(c3);
      };
    }
  }
  if (n >= 2) {
    {
      hash(1);
      hash(n);
    };
    for (c3 = 1; c3 <= n - 1; c3++) {
      {
        hash(2);
        hash(n);
        hash(c3);
      };
    }
    {
      hash(3);
      hash(n);
    };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     11ab <test+0x9b>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11a6 <test+0x96>
mov    $0x4,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    $0x6,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <test+0x44>
jmp    11ab <test+0x9b>
cmpl   $0x1,-0x4(%rbp)
jne    11dd <test+0xcd>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     130b <test+0x1fb>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1247 <test+0x137>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120e <test+0xfe>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     12f8 <test+0x1e8>
mov    $0x4,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12d0 <test+0x1c0>
mov    $0x5,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%edi
call   1030 <hash@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    128f <test+0x17f>
mov    $0x6,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1262 <test+0x152>
jmp    12fd <test+0x1ed>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e4 <test+0xd4>
cmpl   $0x2,-0x4(%rbp)
jl     1379 <test+0x269>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1367 <test+0x257>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132e <test+0x21e>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
cmp    $0x2,%edi
jl     11a8 <test+0x98>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r14d,%ebp
neg    %ebp
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    $0x4,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x6,%edi
call   1030 <hash@plt>
mov    $0x1,%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    1160 <test+0x50>
cmp    $0x1,%r14d
jne    11db <test+0xcb>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
jmp    12e3 <test+0x1d3>
cmp    $0x3,%r14d
jl     12e3 <test+0x1d3>
mov    $0x2,%r13d
xor    %r12d,%r12d
xchg   %ax,%ax
mov    %r13d,%r15d
mov    $0x1,%ebp
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r13d,%edi
call   1030 <hash@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
lea    (%r12,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x2,%eax
jne    1210 <test+0x100>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
lea    0x1(%r15),%r13d
mov    %r13d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x4,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x1,%ebx
xchg   %ax,%ax
mov    $0x5,%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>
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    1280 <test+0x170>
mov    $0x6,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
lea    0x1(%rbp),%eax
cmp    %r14d,%ebp
mov    %eax,%ebp
jne    1260 <test+0x150>
add    $0xffffffff,%r12d
cmp    %r14d,%r13d
jne    11f0 <test+0xe0>
cmp    $0x2,%r14d
jl     1341 <test+0x231>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r14d,%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>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1300 <test+0x1f0>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <hash@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %18
3: ; preds = %1
%4 = tail call i32 @hash(i32 1)
%5 = tail call i32 @hash(i32 1)
%6 = tail call i32 @hash(i32 3)
%7 = tail call i32 @hash(i32 1)
br label %8
8: ; preds = %3, %8
%9 = phi i32 [ %16, %8 ], [ 2, %3 ]
%10 = tail call i32 @hash(i32 4)
%11 = tail call i32 @hash(i32 1)
%12 = tail call i32 @hash(i32 %9)
%13 = tail call i32 @hash(i32 6)
%14 = tail call i32 @hash(i32 1)
%15 = tail call i32 @hash(i32 %9)
%16 = add nuw i32 %9, 1
%17 = icmp eq i32 %9, %0
br i1 %17, label %18, label %8
18: ; preds = %8, %1
%19 = icmp eq i32 %0, 1
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = tail call i32 @hash(i32 1)
%22 = tail call i32 @hash(i32 1)
%23 = tail call i32 @hash(i32 3)
%24 = tail call i32 @hash(i32 1)
br label %63
25: ; preds = %18
%26 = icmp sgt i32 %0, 2
br i1 %26, label %29, label %63
27: ; preds = %57
%28 = icmp eq i32 %43, %0
br i1 %28, label %63, label %29
29: ; preds = %25, %27
%30 = phi i32 [ %43, %27 ], [ 2, %25 ]
%31 = tail call i32 @hash(i32 1)
%32 = tail call i32 @hash(i32 %30)
br label %33
33: ; preds = %29, %33
%34 = phi i32 [ 1, %29 ], [ %38, %33 ]
%35 = tail call i32 @hash(i32 2)
%36 = tail call i32 @hash(i32 %30)
%37 = tail call i32 @hash(i32 %34)
%38 = add nuw nsw i32 %34, 1
%39 = icmp eq i32 %38, %30
br i1 %39, label %40, label %33
40: ; preds = %33
%41 = tail call i32 @hash(i32 3)
%42 = tail call i32 @hash(i32 %30)
%43 = add nuw nsw i32 %30, 1
br label %44
44: ; preds = %40, %57
%45 = phi i32 [ %61, %57 ], [ %43, %40 ]
%46 = tail call i32 @hash(i32 4)
%47 = tail call i32 @hash(i32 %30)
%48 = tail call i32 @hash(i32 %45)
br label %49
49: ; preds = %44, %49
%50 = phi i32 [ 1, %44 ], [ %55, %49 ]
%51 = tail call i32 @hash(i32 5)
%52 = tail call i32 @hash(i32 %30)
%53 = tail call i32 @hash(i32 %45)
%54 = tail call i32 @hash(i32 %50)
%55 = add nuw nsw i32 %50, 1
%56 = icmp eq i32 %55, %30
br i1 %56, label %57, label %49
57: ; preds = %49
%58 = tail call i32 @hash(i32 6)
%59 = tail call i32 @hash(i32 %30)
%60 = tail call i32 @hash(i32 %45)
%61 = add nuw i32 %45, 1
%62 = icmp eq i32 %45, %0
br i1 %62, label %27, label %44
63: ; preds = %27, %20, %25
br i1 %2, label %64, label %77
64: ; preds = %63
%65 = tail call i32 @hash(i32 1)
%66 = tail call i32 @hash(i32 %0)
br label %67
67: ; preds = %64, %67
%68 = phi i32 [ 1, %64 ], [ %72, %67 ]
%69 = tail call i32 @hash(i32 2)
%70 = tail call i32 @hash(i32 %0)
%71 = tail call i32 @hash(i32 %68)
%72 = add nuw nsw i32 %68, 1
%73 = icmp eq i32 %72, %0
br i1 %73, label %74, label %67
74: ; preds = %67
%75 = tail call i32 @hash(i32 3)
%76 = tail call i32 @hash(i32 %0)
br label %77
77: ; preds = %74, %63
ret void
}