int ntlibc_iscntrl(int c) {
  if (c == 0x07) {
    return 0;
  }
  if (c == 0x08) {
    return 0;
  }
  if (c == 0x09) {
    return 0;
  }
  if (c == 0x0a) {
    return 0;
  }
  if (c == 0x0b) {
    return 0;
  }
  if (c == 0x0c) {
    return 0;
  }
  if (c == 0x0d) {
    return 0;
  }
  if ((0x00 <= c) && (c <= 0x1f)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ntlibc_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    111d <ntlibc_iscntrl+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0x8,-0x8(%rbp)
jne    1133 <ntlibc_iscntrl+0x33>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0x9,-0x8(%rbp)
jne    1149 <ntlibc_iscntrl+0x49>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0xa,-0x8(%rbp)
jne    115f <ntlibc_iscntrl+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0xb,-0x8(%rbp)
jne    1175 <ntlibc_iscntrl+0x75>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0xc,-0x8(%rbp)
jne    118b <ntlibc_iscntrl+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
cmpl   $0xd,-0x8(%rbp)
jne    11a1 <ntlibc_iscntrl+0xa1>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     11c2 <ntlibc_iscntrl+0xc2>
cmpl   $0x1f,-0x8(%rbp)
jg     11c2 <ntlibc_iscntrl+0xc2>
movl   $0x1,-0x4(%rbp)
jmp    11c9 <ntlibc_iscntrl+0xc9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_iscntrl>:
lea    -0xe(%rdi),%eax
cmp    $0xfffffff9,%eax
setb   %al
cmp    $0x20,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ntlibc_iscntrl(i32 %0) {
%2 = add i32 %0, -14
%3 = icmp ult i32 %2, -7
%4 = icmp ult i32 %0, 32
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}