#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int);
scalar_t__ getenv(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int MPE_Util_getenvbool(char *env_var, int default_value) {
  char *env_val;
  env_val = (char *)getenv(env_var);
  if (env_val != NULL) {
    if (strcmp(env_val, "true") == 0 || strcmp(env_val, "TRUE") == 0 ||
        strcmp(env_val, "yes") == 0 || strcmp(env_val, "YES") == 0)
      return 1;
    else if (strcmp(env_val, "false") == 0 || strcmp(env_val, "FALSE") == 0 ||
             strcmp(env_val, "no") == 0 || strcmp(env_val, "NO") == 0)
      return 0;
    else {
      fprintf(
          stderr,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/gnu3ra/SCC15HPCRepast/refs/heads/master/"
          "INSTALLATION/mpich2-1.4.1p1/src/mpe2/src/wrappers/src/log_mpi_util.c"
          ":MPE_Util_getenvbool() - \n"
          "\t"
          "Environment variable %s has invalid boolean "
          "value %s and will be set to %d.\n",
          env_var, env_val, default_value);
      fflush(stderr);
    }
  }
  return default_value;
}


x86 assembly (clang, -O0):
<MPE_Util_getenvbool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1288 <MPE_Util_getenvbool+0x148>
mov    -0x20(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <MPE_Util_getenvbool+0x8f>
mov    -0x20(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <MPE_Util_getenvbool+0x8f>
mov    -0x20(%rbp),%rdi
lea    0xe64(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <MPE_Util_getenvbool+0x8f>
mov    -0x20(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11db <MPE_Util_getenvbool+0x9b>
movl   $0x1,-0x4(%rbp)
jmp    128e <MPE_Util_getenvbool+0x14e>
mov    -0x20(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1243 <MPE_Util_getenvbool+0x103>
mov    -0x20(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1243 <MPE_Util_getenvbool+0x103>
mov    -0x20(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1243 <MPE_Util_getenvbool+0x103>
mov    -0x20(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    124f <MPE_Util_getenvbool+0x10f>
movl   $0x0,-0x4(%rbp)
jmp    128e <MPE_Util_getenvbool+0x14e>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xdb9(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    1283 <MPE_Util_getenvbool+0x143>
jmp    1288 <MPE_Util_getenvbool+0x148>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPE_Util_getenvbool>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <getenv@plt>
test   %rax,%rax
je     1236 <MPE_Util_getenvbool+0xf6>
mov    %rax,%rbp
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe83(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe70(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe5c(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe4c(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe3c(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe2e(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
lea    0xe1d(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1239 <MPE_Util_getenvbool+0xf9>
mov    0x2dc8(%rip),%rbx
mov    (%rbx),%edi
lea    0xe03(%rip),%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %r14d,%r8d
call   1050 <fprintf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [5 x i8] c"TRUE\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [4 x i8] c"YES\00"
@.str.4 = [6 x i8] c"false\00"
@.str.5 = [6 x i8] c"FALSE\00"
@.str.6 = [3 x i8] c"no\00"
@.str.7 = [3 x i8] c"NO\00"
@stderr = global i32 0
@.str.8 = [302 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gnu3ra/SCC15HPCRepast/refs/heads/master/INSTALLATION/mpich2-1.4.1p1/src/mpe2/src/wrappers/src/log_mpi_util.c:MPE_Util_getenvbool() - \0A\09Environment variable %s has invalid boolean value %s and will be set to %d.\0A\00"
define i32 @MPE_Util_getenvbool(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i64 @getenv(i8* %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %56
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %28, label %16
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %16
%21 = load i8*, i8** %6
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %20
%25 = load i8*, i8** %6
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %24, %20, %16, %12
store i32 1, i32* %3
br label %58
29: ; preds = %24
%30 = load i8*, i8** %6
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %45, label %33
33: ; preds = %29
%34 = load i8*, i8** %6
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %45, label %37
37: ; preds = %33
%38 = load i8*, i8** %6
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = load i8*, i8** %6
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %41, %37, %33, %29
store i32 0, i32* %3
br label %58
46: ; preds = %41
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %4
%49 = load i8*, i8** %6
%50 = load i32, i32* %5
%51 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str.8, i64 0, i64 0), i8* %48, i8* %49, i32 %50)
%52 = load i32, i32* @stderr
%53 = call i32 @fflush(i32 %52)
br label %54
54: ; preds = %46
br label %55
55: ; preds = %54
br label %56
56: ; preds = %55, %2
%57 = load i32, i32* %5
store i32 %57, i32* %3
br label %58
58: ; preds = %56, %45, %28
%59 = load i32, i32* %3
ret i32 %59
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [5 x i8] c"TRUE\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [4 x i8] c"YES\00"
@.str.4 = [6 x i8] c"false\00"
@.str.5 = [6 x i8] c"FALSE\00"
@.str.6 = [3 x i8] c"no\00"
@.str.7 = [3 x i8] c"NO\00"
@stderr = global i32 0
@.str.8 = [302 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gnu3ra/SCC15HPCRepast/refs/heads/master/INSTALLATION/mpich2-1.4.1p1/src/mpe2/src/wrappers/src/log_mpi_util.c:MPE_Util_getenvbool() - \0A\09Environment variable %s has invalid boolean value %s and will be set to %d.\0A\00"
define i32 @MPE_Util_getenvbool(i8* %0, i32 %1) {
%3 = tail call i64 @getenv(i8* %0)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %35, label %6
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %35, label %9
9: ; preds = %6
%10 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %35, label %12
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %35, label %15
15: ; preds = %12
%16 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %35, label %18
18: ; preds = %15
%19 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %35, label %21
21: ; preds = %18
%22 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %35, label %24
24: ; preds = %21
%25 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %35, label %27
27: ; preds = %24
%28 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str.8, i64 0, i64 0), i8* %0, i8* %4, i32 %1)
%33 = load i32, i32* @stderr
%34 = tail call i32 @fflush(i32 %33)
br label %35
35: ; preds = %2, %30, %18, %21, %24, %27, %6, %9, %12, %15
%36 = phi i32 [ 1, %15 ], [ 1, %12 ], [ 1, %9 ], [ 1, %6 ], [ 0, %27 ], [ 0, %24 ], [ 0, %21 ], [ 0, %18 ], [ %1, %30 ], [ %1, %2 ]
ret i32 %36
}