int GuiButtonListbox__InsertButton_SkipSkills(int this, int skillbutton,
                                              int index, int nSkill) {
  int (*GuiButtonListbox__InsertButton)(int, int, int, int) = (void *)0x84B0640;
  switch (nSkill) {
  case 6:
  case 8:
  case 9:
  case 14:
  case 15:
    return 0;
  }
  return GuiButtonListbox__InsertButton(this, skillbutton, index, nSkill);
}


x86 assembly (clang, -O0):
<GuiButtonListbox__InsertButton_SkipSkills>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movq   $0x84b0640,-0x20(%rbp)
08
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x6,%eax
je     1158 <GuiButtonListbox__InsertButton_SkipSkills+0x58>
jmp    1130 <GuiButtonListbox__InsertButton_SkipSkills+0x30>
mov    -0x24(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x2,%eax
jb     1158 <GuiButtonListbox__InsertButton_SkipSkills+0x58>
jmp    1144 <GuiButtonListbox__InsertButton_SkipSkills+0x44>
mov    -0x24(%rbp),%eax
add    $0xfffffff2,%eax
sub    $0x1,%eax
ja     1164 <GuiButtonListbox__InsertButton_SkipSkills+0x64>
jmp    1158 <GuiButtonListbox__InsertButton_SkipSkills+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1179 <GuiButtonListbox__InsertButton_SkipSkills+0x79>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GuiButtonListbox__InsertButton_SkipSkills>:
lea    -0x6(%rcx),%r8d
cmp    $0xa,%r8d
jae    1115 <GuiButtonListbox__InsertButton_SkipSkills+0x15>
mov    $0x30d,%eax
bt     %r8d,%eax
jb     111c <GuiButtonListbox__InsertButton_SkipSkills+0x1c>
mov    $0x84b0640,%eax
jmp    *%rax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @GuiButtonListbox__InsertButton_SkipSkills(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 (i32, i32, i32, i32)*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 (i32, i32, i32, i32)* inttoptr (i64 139134528 to i32 (i32, i32, i32, i32)*), i32 (i32, i32, i32, i32)** %10
%11 = load i32, i32* %9
switch i32 %11, label %13 [
i32 6, label %12
i32 8, label %12
i32 9, label %12
i32 14, label %12
i32 15, label %12
]
12: ; preds = %4, %4, %4, %4, %4
store i32 0, i32* %5
br label %20
13: ; preds = %4
%14 = load i32 (i32, i32, i32, i32)*, i32 (i32, i32, i32, i32)** %10
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = call i32 %14(i32 %15, i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %5
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @GuiButtonListbox__InsertButton_SkipSkills(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %3, -6
%6 = icmp ult i32 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %9, %4
%8 = tail call i32 inttoptr (i64 139134528 to i32 (i32, i32, i32, i32)*)(i32 %0, i32 %1, i32 %2, i32 %3)
br label %14
9: ; preds = %4
%10 = trunc i32 %5 to i16
%11 = lshr i16 781, %10
%12 = and i16 %11, 1
%13 = icmp eq i16 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %9, %7
%15 = phi i32 [ %8, %7 ], [ 0, %9 ]
ret i32 %15
}