#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*/ assert(int);
int /*<<< orphan*/ find_level(int, int *, int *, int *, int *, int *, int *,
                              int *);
int comp_decomplev(int fw, int fh, int Xsiz, int Ysiz) {
  int level;
  int xmin, xmax, ymin, ymax;
  level = 0;
  xmin = ymin = 0;
  xmax = Xsiz;
  ymax = Ysiz;
  find_level(1000, &level, &fw, &fh, &xmin, &ymin, &xmax, &ymax);
  assert(level >= 0);
  return level;
}


x86 assembly (clang, -O0):
<comp_decomplev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x3e8,%edi
lea    -0x14(%rbp),%rsi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x1c(%rbp),%r10
lea    -0x24(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <find_level@plt>
cmpl   $0x0,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_decomplev>:
sub    $0x28,%rsp
mov    %edi,0x24(%rsp)
mov    %esi,0x20(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x1c(%rsp)
mov    %edx,0x18(%rsp)
mov    %ecx,0x10(%rsp)
lea    0x10(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0xc(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x14(%rsp),%r9
mov    $0x3e8,%edi
push   %rax
push   %r10
call   1040 <find_level@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @comp_decomplev(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %10
%14 = load i32, i32* %7
store i32 %14, i32* %11
%15 = load i32, i32* %8
store i32 %15, i32* %13
%16 = call i32 @find_level(i32 1000, i32* %9, i32* %5, i32* %6, i32* %10, i32* %12, i32* %11, i32* %13)
%17 = load i32, i32* %9
%18 = icmp sge i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @comp_decomplev(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
%12 = bitcast i32* %7 to i8*
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32* %9 to i8*
%15 = bitcast i32* %10 to i8*
%16 = bitcast i32* %11 to i8*
store i32 0, i32* %7
store i32 0, i32* %10
store i32 0, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %11
%17 = call i32 @find_level(i32 1000, i32* %7, i32* %5, i32* %6, i32* %8, i32* %10, i32* %9, i32* %11)
%18 = load i32, i32* %7
%19 = xor i32 %18, -1
%20 = lshr i32 %19, 31
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %7
ret i32 %22
}