#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*/ abort();
int x(int, int);
int main() {
  int i, j;
  for (j = 1; j <= 2; ++j)
    for (i = 1; i <= 2; ++i) {
      int a = x(j, i);
      if (a != 2 + j)
        abort();
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     119d <main+0x7d>
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     118a <main+0x6a>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <x@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
je     1177 <main+0x57>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    117c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
jmp    118f <main+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <x@plt>
cmp    $0x3,%eax
jne    1175 <main+0x55>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <x@plt>
cmp    $0x3,%eax
jne    1175 <main+0x55>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <x@plt>
cmp    $0x4,%eax
jne    1175 <main+0x55>
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <x@plt>
cmp    $0x4,%eax
jne    1175 <main+0x55>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %5
5: ; preds = %27, %0
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 2
br i1 %7, label %8, label %30
8: ; preds = %5
store i32 1, i32* %2
br label %9
9: ; preds = %23, %8
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 2
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = call i32 @x(i32 %13, i32 %14)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 2, %17
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %9
26: ; preds = %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
30: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @x(i32 1, i32 1)
%2 = icmp eq i32 %1, 3
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i32 @x(i32 1, i32 2)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i32 @x(i32 2, i32 1)
%8 = icmp eq i32 %7, 4
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 @x(i32 2, i32 2)
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %13
12: ; preds = %9
ret i32 0
13: ; preds = %9, %6, %3, %0
%14 = tail call i32 (...) @abort()
unreachable
}