#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 */
char *getenv(char *);
unsigned short verbosity_from_env(char *name) {
  char *value = getenv(name);
  if (!value)
    return 1;
  switch (*value) {
  case '0':
  case 'n':
  case 'N':
  case 'f':
  case 'F':
    return (0);
    break;
  case 'o':
  case 'O':
    switch (*(value + 1)) {
    case 'f':
    case 'F':
      return (0);
      break;
    default:
      return (1);
    }
    break;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<verbosity_from_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113f <verbosity_from_env+0x2f>
movw   $0x1,-0x2(%rbp)
jmp    11fd <verbosity_from_env+0xed>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x30,%eax
je     11bd <verbosity_from_env+0xad>
jmp    1157 <verbosity_from_env+0x47>
mov    -0x1c(%rbp),%eax
sub    $0x46,%eax
je     11bd <verbosity_from_env+0xad>
jmp    1168 <verbosity_from_env+0x58>
mov    -0x1c(%rbp),%eax
sub    $0x4e,%eax
je     11bd <verbosity_from_env+0xad>
jmp    1179 <verbosity_from_env+0x69>
mov    -0x1c(%rbp),%eax
sub    $0x4f,%eax
je     11c8 <verbosity_from_env+0xb8>
jmp    118a <verbosity_from_env+0x7a>
mov    -0x1c(%rbp),%eax
sub    $0x66,%eax
je     11bd <verbosity_from_env+0xad>
jmp    119b <verbosity_from_env+0x8b>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
je     11bd <verbosity_from_env+0xad>
jmp    11ac <verbosity_from_env+0x9c>
mov    -0x1c(%rbp),%eax
sub    $0x6f,%eax
je     11c8 <verbosity_from_env+0xb8>
jmp    11f7 <verbosity_from_env+0xe7>
movw   $0x0,-0x2(%rbp)
jmp    11fd <verbosity_from_env+0xed>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
or     $0x20,%eax
sub    $0x66,%eax
je     11e1 <verbosity_from_env+0xd1>
jmp    11ec <verbosity_from_env+0xdc>
movw   $0x0,-0x2(%rbp)
jmp    11fd <verbosity_from_env+0xed>
movw   $0x1,-0x2(%rbp)
jmp    11fd <verbosity_from_env+0xed>
movw   $0x1,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verbosity_from_env>:
push   %rax
call   1030 <getenv@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     113f <verbosity_from_env+0x2f>
movsbl (%rcx),%edx
add    $0xffffffd0,%edx
cmp    $0x3f,%edx
ja     113f <verbosity_from_env+0x2f>
movabs $0x4040000040400001,%rsi
bt     %rdx,%rsi
jae    1141 <verbosity_from_env+0x31>
xor    %eax,%eax
pop    %rcx
ret
movabs $0x8000000080000000,%rsi
bt     %rdx,%rsi
jae    113f <verbosity_from_env+0x2f>
mov    0x1(%rcx),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x46,%cl
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @verbosity_from_env(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i16 1, i16* %2
br label %23
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %22 [
i32 48, label %14
i32 110, label %14
i32 78, label %14
i32 102, label %14
i32 70, label %14
i32 111, label %15
i32 79, label %15
]
14: ; preds = %10, %10, %10, %10, %10
store i16 0, i16* %2
br label %23
15: ; preds = %10, %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %21 [
i32 102, label %20
i32 70, label %20
]
20: ; preds = %15, %15
store i16 0, i16* %2
br label %23
21: ; preds = %15
store i16 1, i16* %2
br label %23
22: ; preds = %10
store i16 1, i16* %2
br label %23
23: ; preds = %22, %21, %20, %14, %9
%24 = load i16, i16* %2
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @verbosity_from_env(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
switch i32 %6, label %13 [
i32 48, label %14
i32 110, label %14
i32 78, label %14
i32 102, label %14
i32 70, label %14
i32 111, label %7
i32 79, label %7
]
7: ; preds = %4, %4
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = load i8, i8* %8
%10 = and i8 %9, -33
%11 = icmp ne i8 %10, 70
%12 = zext i1 %11 to i16
br label %14
13: ; preds = %4
br label %14
14: ; preds = %7, %4, %4, %4, %4, %4, %1, %13
%15 = phi i16 [ 1, %13 ], [ 1, %1 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ %12, %7 ]
ret i16 %15
}