#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':
    return strncmp(pszValue, "00000000", 8) == 0;
  case 'L':
    return pszValue[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    1244 <DBFIsValueNULL+0x124>
movsbl -0x5(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xa,%eax
ja     122d <DBFIsValueNULL+0x10d>
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    1244 <DBFIsValueNULL+0x124>
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    1244 <DBFIsValueNULL+0x124>
jmp    11d1 <DBFIsValueNULL+0xb1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <DBFIsValueNULL+0x76>
movl   $0x1,-0x4(%rbp)
jmp    1244 <DBFIsValueNULL+0x124>
mov    -0x10(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1244 <DBFIsValueNULL+0x124>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1244 <DBFIsValueNULL+0x124>
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   %rax
mov    $0x1,%al
test   %rsi,%rsi
je     1189 <DBFIsValueNULL+0x69>
movsbl %dil,%ecx
add    $0xffffffbc,%ecx
ror    %ecx
cmp    $0x5,%ecx
ja     117c <DBFIsValueNULL+0x5c>
lea    0xec3(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    (%rsi),%cl
cmp    $0x2a,%cl
je     1189 <DBFIsValueNULL+0x69>
nopl   (%rax)
add    $0x1,%rsi
cmp    $0x20,%cl
jne    118e <DBFIsValueNULL+0x6e>
movzbl (%rsi),%ecx
jmp    1150 <DBFIsValueNULL+0x30>
lea    0xeb3(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
jmp    1184 <DBFIsValueNULL+0x64>
cmpb   $0x3f,(%rsi)
jmp    1186 <DBFIsValueNULL+0x66>
mov    %rsi,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
sete   %al
movzbl %al,%eax
pop    %rcx
ret
test   %cl,%cl
je     1189 <DBFIsValueNULL+0x69>
xor    %eax,%eax
jmp    1189 <DBFIsValueNULL+0x69>

LLVM IR (-O0):
@.str = [9 x i8] c"00000000\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 %60
10: ; preds = %2
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
switch i32 %12, label %55 [
i32 78, label %13
i32 70, label %13
i32 68, label %43
i32 76, label %48
]
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 %60
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 %60
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 %60
43: ; preds = %10
%44 = load i8*, i8** %5
%45 = call i32 @strncmp(i8* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%46 = icmp eq i32 %45, 0
%47 = zext i1 %46 to i32
store i32 %47, i32* %3
br label %60
48: ; preds = %10
%49 = load i8*, i8** %5
%50 = getelementptr inbounds i8, i8* %49, i64 0
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 63
%54 = zext i1 %53 to i32
store i32 %54, i32* %3
br label %60
55: ; preds = %10
%56 = load i8*, i8** %5
%57 = call i32 @strlen(i8* %56)
%58 = icmp eq i32 %57, 0
%59 = zext i1 %58 to i32
store i32 %59, i32* %3
br label %60
60: ; preds = %55, %48, %43, %42, %37, %19, %9
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@.str = [9 x i8] c"00000000\00"
define i32 @DBFIsValueNULL(i8 signext %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %28, 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 %24 [
i32 5, label %8
i32 1, label %8
i32 0, label %18
i32 4, label %21
]
8: ; preds = %4, %4
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 42
br i1 %10, label %28, label %11
11: ; preds = %8, %14
%12 = phi i8 [ %17, %14 ], [ %9, %8 ]
%13 = phi i64 [ %15, %14 ], [ 0, %8 ]
switch i8 %12, label %27 [
i8 0, label %28
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 = tail call i32 @strncmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%20 = icmp eq i32 %19, 0
br label %28
21: ; preds = %4
%22 = load i8, i8* %1
%23 = icmp eq i8 %22, 63
br label %28
24: ; preds = %4
%25 = tail call i32 @strlen(i8* %1)
%26 = icmp eq i32 %25, 0
br label %28
27: ; preds = %11
br label %28
28: ; preds = %11, %27, %8, %2, %24, %21, %18
%29 = phi i1 [ %26, %24 ], [ %23, %21 ], [ %20, %18 ], [ true, %2 ], [ true, %8 ], [ false, %27 ], [ true, %11 ]
%30 = zext i1 %29 to i32
ret i32 %30
}