#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 one_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putenv(char *);
int main(void) {
  int err;
  putenv("HWLOC_LIBXML_CLEANUP=1");
  printf("using default import and export\n");
  putenv("HWLOC_NO_LIBXML_IMPORT=0");
  putenv("HWLOC_NO_LIBXML_EXPORT=0");
  err = one_test();
  if (err < 0)
    return err;
  printf("using minimalistic import and default export\n");
  putenv("HWLOC_NO_LIBXML_IMPORT=1");
  putenv("HWLOC_NO_LIBXML_EXPORT=0");
  err = one_test();
  if (err < 0)
    return err;
  printf("using default import and minimalistic export\n");
  putenv("HWLOC_NO_LIBXML_IMPORT=0");
  putenv("HWLOC_NO_LIBXML_EXPORT=1");
  err = one_test();
  if (err < 0)
    return err;
  printf("using minimalistic import and export\n");
  putenv("HWLOC_NO_LIBXML_IMPORT=1");
  putenv("HWLOC_NO_LIBXML_EXPORT=1");
  err = one_test();
  if (err < 0)
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <putenv@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1050 <putenv@plt>
lea    0xee7(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    118e <main+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    125e <main+0x12e>
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1050 <putenv@plt>
lea    0xea4(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11d1 <main+0xa1>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    125e <main+0x12e>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xe54(%rip),%rdi
call   1050 <putenv@plt>
lea    0xeef(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1214 <main+0xe4>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    125e <main+0x12e>
lea    0xedd(%rip),%rdi
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
call   1050 <putenv@plt>
lea    0xeac(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1257 <main+0x127>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    125e <main+0x12e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <putenv@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
call   1050 <putenv@plt>
lea    0xed4(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     1200 <main+0xd0>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
call   1050 <putenv@plt>
lea    0xea1(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     1200 <main+0xd0>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xe65(%rip),%rdi
call   1050 <putenv@plt>
lea    0xea4(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     1200 <main+0xd0>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%rdi
call   1050 <putenv@plt>
lea    0xe75(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
mov    %eax,%ecx
sar    $0x1f,%eax
and    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"HWLOC_LIBXML_CLEANUP=1\00"
@.str.1 = [33 x i8] c"using default import and export\0A\00"
@.str.2 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=0\00"
@.str.3 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=0\00"
@.str.4 = [46 x i8] c"using minimalistic import and default export\0A\00"
@.str.5 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=1\00"
@.str.6 = [46 x i8] c"using default import and minimalistic export\0A\00"
@.str.7 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=1\00"
@.str.8 = [38 x i8] c"using minimalistic import and export\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @putenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (...) @one_test()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %40
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (...) @one_test()
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i32, i32* %2
store i32 %20, i32* %1
br label %40
21: ; preds = %12
%22 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%25 = call i32 (...) @one_test()
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %21
%29 = load i32, i32* %2
store i32 %29, i32* %1
br label %40
30: ; preds = %21
%31 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0))
%32 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (...) @one_test()
store i32 %34, i32* %2
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %30
%38 = load i32, i32* %2
store i32 %38, i32* %1
br label %40
39: ; preds = %30
store i32 0, i32* %1
br label %40
40: ; preds = %39, %37, %28, %19, %10
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [23 x i8] c"HWLOC_LIBXML_CLEANUP=1\00"
@.str.2 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=0\00"
@.str.3 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=0\00"
@.str.5 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=1\00"
@.str.7 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=1\00"
@str = [32 x i8] c"using default import and export\00"
@str.9 = [45 x i8] c"using minimalistic import and default export\00"
@str.10 = [45 x i8] c"using default import and minimalistic export\00"
@str.11 = [37 x i8] c"using minimalistic import and export\00"
define i32 @main() {
%1 = tail call i32 @putenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @one_test()
%6 = icmp slt i32 %5, 0
br i1 %6, label %26, label %7
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.9, i64 0, i64 0))
%9 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 (...) @one_test()
%12 = icmp slt i32 %11, 0
br i1 %12, label %26, label %13
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.10, i64 0, i64 0))
%15 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%17 = tail call i32 (...) @one_test()
%18 = icmp slt i32 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %13
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.11, i64 0, i64 0))
%21 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%22 = tail call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%23 = tail call i32 (...) @one_test()
%24 = icmp slt i32 %23, 0
%25 = select i1 %24, i32 %23, i32 0
br label %26
26: ; preds = %19, %13, %7, %0
%27 = phi i32 [ %5, %0 ], [ %11, %7 ], [ %17, %13 ], [ %25, %19 ]
ret i32 %27
}