#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 */

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char *, int);
int DBFIsValueNULL(char chType, const char *pszValue) {
  int i;
  if (pszValue == NULL)
    return 1;
  switch (chType) {
  case 'N':
  case 'F':
    if (pszValue[0] == '*')
      return 1;
    for (i = 0; pszValue[i] != '\0'; i++) {
      if (pszValue[i] != ' ')
        return 0;
    }
    return 1;
  case 'D':
    if (pszValue[0] == '\0' || strncmp(pszValue, "00000000", 8) == 0 ||
        strncmp(pszValue, "        ", 8) == 0) {
      return 1;
    } else {
      return 0;
    }
  case 'L':
    if (pszValue[0] == '\0' || pszValue[0] == '?') {
      return 1;
    } else {
      return 0;
    }
  default:
    return strlen(pszValue) == 0;
  }
}


x86 assembly (clang, -O0):
<DBFIsValueNULL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <DBFIsValueNULL+0x29>
movl   $0x1,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
movsbl -0x5(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xa,%eax
ja     1287 <DBFIsValueNULL+0x167>
mov    -0x20(%rbp),%rax
lea    0xe96(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    118f <DBFIsValueNULL+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11df <DBFIsValueNULL+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11cc <DBFIsValueNULL+0xac>
movl   $0x0,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
jmp    11d1 <DBFIsValueNULL+0xb1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <DBFIsValueNULL+0x76>
movl   $0x1,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1237 <DBFIsValueNULL+0x117>
mov    -0x10(%rbp),%rdi
lea    0xe26(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1237 <DBFIsValueNULL+0x117>
mov    -0x10(%rbp),%rdi
lea    0xe11(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1243 <DBFIsValueNULL+0x123>
movl   $0x1,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
movl   $0x0,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     126f <DBFIsValueNULL+0x14f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
jne    127b <DBFIsValueNULL+0x15b>
movl   $0x1,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
movl   $0x0,-0x4(%rbp)
jmp    129e <DBFIsValueNULL+0x17e>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DBFIsValueNULL>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%bpl
test   %rsi,%rsi
je     11c8 <DBFIsValueNULL+0xa8>
mov    %rsi,%rbx
movsbl %dil,%eax
add    $0xffffffbc,%eax
ror    %eax
cmp    $0x5,%eax
ja     11a0 <DBFIsValueNULL+0x80>
lea    0xeb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%rbx),%al
cmp    $0x2a,%al
je     11c8 <DBFIsValueNULL+0xa8>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x20,%al
jne    11c2 <DBFIsValueNULL+0xa2>
movzbl (%rbx),%eax
jmp    1160 <DBFIsValueNULL+0x40>
cmpb   $0x0,(%rbx)
je     11c8 <DBFIsValueNULL+0xa8>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     11c8 <DBFIsValueNULL+0xa8>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncmp@plt>
jmp    11a8 <DBFIsValueNULL+0x88>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
sete   %bpl
jmp    11c8 <DBFIsValueNULL+0xa8>
mov    (%rbx),%al
test   %al,%al
sete   %cl
cmp    $0x3f,%al
sete   %bpl
or     %cl,%bpl
jmp    11c8 <DBFIsValueNULL+0xa8>
test   %al,%al
je     11c8 <DBFIsValueNULL+0xa8>
xor    %ebp,%ebp
movzbl %bpl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"00000000\00"
@.str.1 = [9 x i8] c" \00"
define i32 @DBFIsValueNULL(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %78
10: ; preds = %2
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
switch i32 %12, label %73 [
i32 78, label %13
i32 70, label %13
i32 68, label %43
i32 76, label %59
]
13: ; preds = %10, %10
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 1, i32* %3
br label %78
20: ; preds = %13
store i32 0, i32* %6
br label %21
21: ; preds = %39, %20
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %42
29: ; preds = %21
%30 = load i8*, i8** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 32
br i1 %36, label %37, label %38
37: ; preds = %29
store i32 0, i32* %3
br label %78
38: ; preds = %29
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %21
42: ; preds = %21
store i32 1, i32* %3
br label %78
43: ; preds = %10
%44 = load i8*, i8** %5
%45 = getelementptr inbounds i8, i8* %44, i64 0
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 0
br i1 %48, label %57, label %49
49: ; preds = %43
%50 = load i8*, i8** %5
%51 = call i32 @strncmp(i8* %50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%52 = icmp eq i32 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8*, i8** %5
%55 = call i32 @strncmp(i8* %54, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53, %49, %43
store i32 1, i32* %3
br label %78
58: ; preds = %53
store i32 0, i32* %3
br label %78
59: ; preds = %10
%60 = load i8*, i8** %5
%61 = getelementptr inbounds i8, i8* %60, i64 0
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 0
br i1 %64, label %71, label %65
65: ; preds = %59
%66 = load i8*, i8** %5
%67 = getelementptr inbounds i8, i8* %66, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 63
br i1 %70, label %71, label %72
71: ; preds = %65, %59
store i32 1, i32* %3
br label %78
72: ; preds = %65
store i32 0, i32* %3
br label %78
73: ; preds = %10
%74 = load i8*, i8** %5
%75 = call i32 @strlen(i8* %74)
%76 = icmp eq i32 %75, 0
%77 = zext i1 %76 to i32
store i32 %77, i32* %3
br label %78
78: ; preds = %73, %72, %71, %58, %57, %42, %37, %19, %9
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@.str = [9 x i8] c"00000000\00"
@.str.1 = [9 x i8] c" \00"
define i32 @DBFIsValueNULL(i8 signext %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %36, label %4
4: ; preds = %2
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, -68
%7 = tail call i32 @llvm.fshl.i32(i32 %6, i32 %6, i32 31)
switch i32 %7, label %32 [
i32 5, label %8
i32 1, label %8
i32 0, label %18
i32 4, label %27
]
8: ; preds = %4, %4
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 42
br i1 %10, label %36, label %11
11: ; preds = %8, %14
%12 = phi i8 [ %17, %14 ], [ %9, %8 ]
%13 = phi i64 [ %15, %14 ], [ 0, %8 ]
switch i8 %12, label %35 [
i8 0, label %36
i8 32, label %14
]
14: ; preds = %11
%15 = add nuw i64 %13, 1
%16 = getelementptr inbounds i8, i8* %1, i64 %15
%17 = load i8, i8* %16
br label %11
18: ; preds = %4
%19 = load i8, i8* %1
%20 = icmp eq i8 %19, 0
br i1 %20, label %36, label %21
21: ; preds = %18
%22 = tail call i32 @strncmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%23 = icmp eq i32 %22, 0
br i1 %23, label %36, label %24
24: ; preds = %21
%25 = tail call i32 @strncmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%26 = icmp eq i32 %25, 0
br label %36
27: ; preds = %4
%28 = load i8, i8* %1
%29 = icmp eq i8 %28, 0
%30 = icmp eq i8 %28, 63
%31 = or i1 %29, %30
br label %36
32: ; preds = %4
%33 = tail call i32 @strlen(i8* %1)
%34 = icmp eq i32 %33, 0
br label %36
35: ; preds = %11
br label %36
36: ; preds = %11, %35, %24, %27, %18, %21, %8, %2, %32
%37 = phi i1 [ %34, %32 ], [ true, %2 ], [ true, %8 ], [ true, %21 ], [ true, %18 ], [ %26, %24 ], [ %31, %27 ], [ false, %35 ], [ true, %11 ]
%38 = zext i1 %37 to i32
ret i32 %38
}