#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 */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
#define BIO_CTRL_DUP 138
#define BIO_CTRL_EOF 137
#define BIO_CTRL_FLUSH 136
#define BIO_CTRL_GET 135
#define BIO_CTRL_GET_CLOSE 134
#define BIO_CTRL_INFO 133
#define BIO_CTRL_PENDING 132
#define BIO_CTRL_RESET 131
#define BIO_CTRL_SET 130
#define BIO_CTRL_SET_CLOSE 129
#define BIO_CTRL_WPENDING 128
long null_ctrl(BIO *b, int cmd, long num, void *ptr) {
  long ret = 1;
  switch (cmd) {
  case BIO_CTRL_RESET:
  case BIO_CTRL_EOF:
  case BIO_CTRL_SET:
  case BIO_CTRL_SET_CLOSE:
  case BIO_CTRL_FLUSH:
  case BIO_CTRL_DUP:
    ret = 1;
    break;
  case BIO_CTRL_GET_CLOSE:
  case BIO_CTRL_INFO:
  case BIO_CTRL_GET:
  case BIO_CTRL_PENDING:
  case BIO_CTRL_WPENDING:
  default:
    ret = 0;
    break;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<null_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x80,%eax
je     1180 <null_ctrl+0x80>
jmp    1131 <null_ctrl+0x31>
mov    -0x2c(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x3,%eax
jb     1173 <null_ctrl+0x73>
jmp    1147 <null_ctrl+0x47>
mov    -0x2c(%rbp),%eax
add    $0xffffff7c,%eax
sub    $0x4,%eax
jb     1180 <null_ctrl+0x80>
jmp    115d <null_ctrl+0x5d>
mov    -0x2c(%rbp),%eax
add    $0xffffff78,%eax
sub    $0x2,%eax
ja     1185 <null_ctrl+0x85>
jmp    1173 <null_ctrl+0x73>
movq   $0x1,-0x28(%rbp)
jmp    118d <null_ctrl+0x8d>
jmp    1185 <null_ctrl+0x85>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_ctrl>:
add    $0xffffff7f,%esi
cmp    $0x9,%esi
ja     111a <null_ctrl+0x1a>
movslq %esi,%rax
lea    0xeeb(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @null_ctrl(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
store i64 1, i64* %9
%10 = load i32, i32* %6
switch i32 %10, label %13 [
i32 131, label %11
i32 137, label %11
i32 130, label %11
i32 129, label %11
i32 136, label %11
i32 138, label %11
i32 134, label %12
i32 133, label %12
i32 135, label %12
i32 132, label %12
i32 128, label %12
]
11: ; preds = %4, %4, %4, %4, %4, %4
store i64 1, i64* %9
br label %14
12: ; preds = %4, %4, %4, %4, %4
br label %13
13: ; preds = %4, %12
store i64 0, i64* %9
br label %14
14: ; preds = %13, %11
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
@switch.table.null_ctrl = [10 x i64] [i64 1, i64 1, i64 1, i64 0, i64 0, i64 0, i64 0, i64 1, i64 1, i64 1]
define i64 @null_ctrl(i32* nocapture readnone %0, i32 %1, i64 %2, i8* nocapture readnone %3) {
%5 = add i32 %1, -129
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds [10 x i64], [10 x i64]* @switch.table.null_ctrl, i64 0, i64 %8
%10 = load i64, i64* %9
br label %11
11: ; preds = %4, %7
%12 = phi i64 [ %10, %7 ], [ 0, %4 ]
ret i64 %12
}