#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 m) {
  int i, j;
  if (n >= 1) {
    for (i = 1; i <= m; i++) {
      {
        hash(1);
        hash(i);
      };
      for (j = 1; j <= n; j++) {
        {
          hash(2);
          hash(i);
          hash(j);
        };
      }
    }
  }
  if (n <= 0) {
    for (i = 1; i <= m; i++) {
      {
        hash(1);
        hash(i);
      };
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     11a0 <test+0x90>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     119b <test+0x8b>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1188 <test+0x78>
mov    $0x2,%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    1154 <test+0x44>
jmp    118d <test+0x7d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <test+0x1f>
jmp    11a0 <test+0x90>
cmpl   $0x0,-0x4(%rbp)
jg     11e2 <test+0xd2>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11dd <test+0xcd>
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    11b1 <test+0xa1>
jmp    11e2 <test+0xd2>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %edi,%r14d
test   %edi,%edi
jle    1195 <test+0x85>
test   %r15d,%r15d
jle    1195 <test+0x85>
mov    %r14d,%r12d
neg    %r12d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2,%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    $0x1,%eax
jne    1160 <test+0x50>
lea    0x1(%rbp),%eax
cmp    %r15d,%ebp
mov    %eax,%ebp
jne    1140 <test+0x30>
test   %r14d,%r14d
jg     11d4 <test+0xc4>
test   %r15d,%r15d
jle    11d4 <test+0xc4>
neg    %r15d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    11b0 <test+0xa0>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %36
9: ; preds = %2
store i32 1, i32* %5
br label %10
10: ; preds = %32, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %35
14: ; preds = %10
%15 = call i32 @hash(i32 1)
%16 = load i32, i32* %5
%17 = call i32 @hash(i32 %16)
store i32 1, i32* %6
br label %18
18: ; preds = %28, %14
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = call i32 @hash(i32 2)
%24 = load i32, i32* %5
%25 = call i32 @hash(i32 %24)
%26 = load i32, i32* %6
%27 = call i32 @hash(i32 %26)
br label %28
28: ; preds = %22
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %18
31: ; preds = %18
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %10
35: ; preds = %10
br label %36
36: ; preds = %35, %2
%37 = load i32, i32* %3
%38 = icmp sle i32 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %36
store i32 1, i32* %5
br label %40
40: ; preds = %48, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %4
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %51
44: ; preds = %40
%45 = call i32 @hash(i32 1)
%46 = load i32, i32* %5
%47 = call i32 @hash(i32 %46)
br label %48
48: ; preds = %44
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %40
51: ; preds = %40
br label %52
52: ; preds = %51, %36
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %20, label %6
6: ; preds = %2, %17
%7 = phi i32 [ %18, %17 ], [ 1, %2 ]
%8 = tail call i32 @hash(i32 1)
%9 = tail call i32 @hash(i32 %7)
br label %10
10: ; preds = %6, %10
%11 = phi i32 [ %15, %10 ], [ 1, %6 ]
%12 = tail call i32 @hash(i32 2)
%13 = tail call i32 @hash(i32 %7)
%14 = tail call i32 @hash(i32 %11)
%15 = add nuw i32 %11, 1
%16 = icmp eq i32 %11, %0
br i1 %16, label %17, label %10
17: ; preds = %10
%18 = add nuw i32 %7, 1
%19 = icmp eq i32 %7, %1
br i1 %19, label %20, label %6
20: ; preds = %17, %2
%21 = icmp sgt i32 %0, 0
%22 = or i1 %21, %4
br i1 %22, label %29, label %23
23: ; preds = %20, %23
%24 = phi i32 [ %27, %23 ], [ 1, %20 ]
%25 = tail call i32 @hash(i32 1)
%26 = tail call i32 @hash(i32 %24)
%27 = add nuw i32 %24, 1
%28 = icmp eq i32 %24, %1
br i1 %28, label %29, label %23
29: ; preds = %23, %20
ret void
}