#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*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         char *);
int g_logv(char *p) {
  switch (*p) {
  case '\0':
  case '1':
  case 'y':
  case 'Y':
  case 't':
  case 'T':
    return 1;
  case '0':
  case 'n':
  case 'N':
  case 'f':
  case 'F':
    break;
  default:
    error(0, 0, "Unknown logical '%s' - false assumed", p);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<g_logv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     11dd <g_logv+0xcd>
jmp    1133 <g_logv+0x23>
mov    -0x14(%rbp),%eax
sub    $0x30,%eax
je     11e9 <g_logv+0xd9>
jmp    1144 <g_logv+0x34>
mov    -0x14(%rbp),%eax
sub    $0x31,%eax
je     11dd <g_logv+0xcd>
jmp    1155 <g_logv+0x45>
mov    -0x14(%rbp),%eax
sub    $0x46,%eax
je     11e9 <g_logv+0xd9>
jmp    1166 <g_logv+0x56>
mov    -0x14(%rbp),%eax
sub    $0x4e,%eax
je     11e9 <g_logv+0xd9>
jmp    1177 <g_logv+0x67>
mov    -0x14(%rbp),%eax
sub    $0x54,%eax
je     11dd <g_logv+0xcd>
jmp    1188 <g_logv+0x78>
mov    -0x14(%rbp),%eax
sub    $0x59,%eax
je     11dd <g_logv+0xcd>
jmp    1199 <g_logv+0x89>
mov    -0x14(%rbp),%eax
sub    $0x66,%eax
je     11e9 <g_logv+0xd9>
jmp    11aa <g_logv+0x9a>
mov    -0x14(%rbp),%eax
sub    $0x6e,%eax
je     11e9 <g_logv+0xd9>
jmp    11bb <g_logv+0xab>
mov    -0x14(%rbp),%eax
sub    $0x74,%eax
je     11dd <g_logv+0xcd>
jmp    11cc <g_logv+0xbc>
mov    -0x14(%rbp),%eax
sub    $0x79,%eax
jne    11ee <g_logv+0xde>
jmp    11dd <g_logv+0xcd>
movl   $0x1,-0x4(%rbp)
jmp    1209 <g_logv+0xf9>
jmp    1202 <g_logv+0xf2>
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
lea    0xe05(%rip),%rdx
mov    %esi,%edi
call   1030 <error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_logv>:
push   %rax
mov    %rdi,%rcx
movsbl (%rdi),%edx
mov    $0x1,%eax
lea    -0x30(%rdx),%esi
cmp    $0x49,%esi
ja     1138 <g_logv+0x28>
lea    0xed5(%rip),%rdx
movslq (%rdx,%rsi,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
xor    %eax,%eax
pop    %rcx
ret
test   %edx,%edx
je     1136 <g_logv+0x26>
lea    0xfe5(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <error@plt>
jmp    1134 <g_logv+0x24>

LLVM IR (-O0):
@.str = [37 x i8] c"Unknown logical '%s' - false assumed\00"
define i32 @g_logv(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %9 [
i32 0, label %7
i32 49, label %7
i32 121, label %7
i32 89, label %7
i32 116, label %7
i32 84, label %7
i32 48, label %8
i32 110, label %8
i32 78, label %8
i32 102, label %8
i32 70, label %8
]
7: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %13
8: ; preds = %1, %1, %1, %1, %1
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @error(i32 0, i32 0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %8
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [37 x i8] c"Unknown logical '%s' - false assumed\00"
define i32 @g_logv(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %4 [
i32 0, label %7
i32 49, label %7
i32 121, label %7
i32 89, label %7
i32 116, label %7
i32 84, label %7
i32 48, label %6
i32 110, label %6
i32 78, label %6
i32 102, label %6
i32 70, label %6
]
4: ; preds = %1
%5 = tail call i32 @error(i32 0, i32 0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %1, %1, %1, %1, %4
br label %7
7: ; preds = %1, %1, %1, %1, %1, %1, %6
%8 = phi i32 [ 0, %6 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}