#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 __VERIFIER_nondet_int();
int /*<<< orphan*/ parts(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  if (x < 0)
    return 0;
  int y = __VERIFIER_nondet_int();
  if (y < 0)
    return 0;
  int z = __VERIFIER_nondet_int();
  for (int p = 0; p <= x; p++)
    for (int q = 0; q <= x; q++)
      parts(p, q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    11cb <main+0xab>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    11cb <main+0xab>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11cb <main+0xab>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b8 <main+0x98>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <parts@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1193 <main+0x73>
jmp    11bd <main+0x9d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <main+0x60>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     117d <main+0x5d>
mov    %eax,%r14d
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     117d <main+0x5d>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    0x1(%r14),%ebx
xchg   %ax,%ax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15d,%edi
mov    %ebp,%esi
call   1030 <parts@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1160 <main+0x40>
lea    0x1(%r15),%eax
cmp    %r14d,%r15d
mov    %eax,%r15d
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %1
br label %38
11: ; preds = %0
%12 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %1
br label %38
16: ; preds = %11
%17 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %17, i32* %4
store i32 0, i32* %5
br label %18
18: ; preds = %35, %16
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
store i32 0, i32* %6
br label %23
23: ; preds = %31, %22
%24 = load i32, i32* %6
%25 = load i32, i32* %2
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %34
27: ; preds = %23
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = call i32 @parts(i32 %28, i32 %29)
br label %31
31: ; preds = %27
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %23
34: ; preds = %23
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %18
38: ; preds = %10, %15, %18
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 0
br i1 %2, label %18, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp slt i32 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %8
8: ; preds = %10, %6
%9 = phi i32 [ 0, %6 ], [ %11, %10 ]
br label %13
10: ; preds = %13
%11 = add nuw i32 %9, 1
%12 = icmp eq i32 %9, %1
br i1 %12, label %18, label %8
13: ; preds = %8, %13
%14 = phi i32 [ %16, %13 ], [ 0, %8 ]
%15 = tail call i32 @parts(i32 %9, i32 %14)
%16 = add nuw i32 %14, 1
%17 = icmp eq i32 %14, %1
br i1 %17, label %10, label %13
18: ; preds = %10, %3, %0
ret i32 0
}