int get_pv_extension(const int depth, const int n_empties) {
  int depth_pv_extension;
  if (depth >= n_empties || depth <= 9)
    depth_pv_extension = -1;
  else if (depth <= 12)
    depth_pv_extension = 10;
  else if (depth <= 18)
    depth_pv_extension = 12;
  else if (depth <= 24)
    depth_pv_extension = 14;
  else
    depth_pv_extension = 16;
  return depth_pv_extension;
}


x86 assembly (clang, -O0):
<get_pv_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1120 <get_pv_extension+0x20>
cmpl   $0x9,-0x4(%rbp)
jg     112c <get_pv_extension+0x2c>
movl   $0xffffffff,-0xc(%rbp)
jmp    1184 <get_pv_extension+0x84>
cmpl   $0xc,-0x4(%rbp)
jg     1142 <get_pv_extension+0x42>
movl   $0xa,-0xc(%rbp)
jmp    117f <get_pv_extension+0x7f>
cmpl   $0x12,-0x4(%rbp)
jg     1158 <get_pv_extension+0x58>
movl   $0xc,-0xc(%rbp)
jmp    117a <get_pv_extension+0x7a>
cmpl   $0x18,-0x4(%rbp)
jg     116e <get_pv_extension+0x6e>
movl   $0xe,-0xc(%rbp)
jmp    1175 <get_pv_extension+0x75>
movl   $0x10,-0xc(%rbp)
jmp    117a <get_pv_extension+0x7a>
jmp    117f <get_pv_extension+0x7f>
jmp    1184 <get_pv_extension+0x84>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pv_extension>:
mov    $0xffffffff,%eax
cmp    $0xa,%edi
jl     112f <get_pv_extension+0x2f>
cmp    %esi,%edi
jge    112f <get_pv_extension+0x2f>
mov    $0xa,%eax
cmp    $0xd,%edi
jb     112f <get_pv_extension+0x2f>
mov    $0xc,%eax
cmp    $0x13,%edi
jb     112f <get_pv_extension+0x2f>
xor    %eax,%eax
cmp    $0x19,%edi
setae  %al
add    %eax,%eax
add    $0xe,%eax
ret

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

LLVM IR (-O2):
define i32 @get_pv_extension(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = icmp slt i32 %0, 10
%5 = or i1 %4, %3
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = icmp ult i32 %0, 13
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp ult i32 %0, 19
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ult i32 %0, 25
%12 = select i1 %11, i32 14, i32 16
br label %13
13: ; preds = %10, %8, %6, %2
%14 = phi i32 [ -1, %2 ], [ 10, %6 ], [ 12, %8 ], [ %12, %10 ]
ret i32 %14
}