#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 scalar_t__ wint_t;
typedef int wctype_t;

/* Variables and functions */
scalar_t__ WEOF;
int __ismask(scalar_t__);
int iswblank(scalar_t__);
int iswctype(wint_t wc, wctype_t t) {
  if (wc == WEOF)
    return 0;
  if (t == 0xFF) {
    return iswblank(wc);
  }
  return (wc < (wint_t)0x100 ? __ismask(wc) & t : 0);
}


x86 assembly (clang, -O0):
<iswctype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
jne    114f <iswctype+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    119f <iswctype+0x7f>
cmpl   $0xff,-0x14(%rbp)
jne    116d <iswctype+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <iswblank@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <iswctype+0x7f>
cmpq   $0x100,-0x10(%rbp)
jge    118f <iswctype+0x6f>
mov    -0x10(%rbp),%rdi
call   1040 <__ismask@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <iswctype+0x79>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <iswctype+0x79>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswctype>:
push   %rbx
mov    0x2eb8(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
je     114f <iswctype+0x2f>
mov    %esi,%ebx
cmp    $0xff,%esi
jne    113f <iswctype+0x1f>
pop    %rbx
jmp    1030 <iswblank@plt>
cmp    $0xff,%rdi
jg     114f <iswctype+0x2f>
call   1040 <__ismask@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@WEOF = global i64 0
define i32 @iswctype(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @WEOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %27
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 255
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = call i32 @iswblank(i64 %14)
store i32 %15, i32* %3
br label %27
16: ; preds = %10
%17 = load i64, i64* %4
%18 = icmp slt i64 %17, 256
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i64, i64* %4
%21 = call i32 @__ismask(i64 %20)
%22 = load i32, i32* %5
%23 = and i32 %21, %22
br label %25
24: ; preds = %16
br label %25
25: ; preds = %24, %19
%26 = phi i32 [ %23, %19 ], [ 0, %24 ]
store i32 %26, i32* %3
br label %27
27: ; preds = %25, %13, %9
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@WEOF = global i64 0
define i32 @iswctype(i64 %0, i32 %1) {
%3 = load i64, i64* @WEOF
%4 = icmp eq i64 %3, %0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = icmp eq i32 %1, 255
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @iswblank(i64 %0)
br label %14
9: ; preds = %5
%10 = icmp slt i64 %0, 256
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = tail call i32 @__ismask(i64 %0)
%13 = and i32 %12, %1
br label %14
14: ; preds = %11, %9, %2, %7
%15 = phi i32 [ %8, %7 ], [ 0, %2 ], [ %13, %11 ], [ 0, %9 ]
ret i32 %15
}