#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;
  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   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1050 <putenv@plt>
lea    0xedc(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1182 <main+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1252 <main+0x122>
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1050 <putenv@plt>
lea    0xe99(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11c5 <main+0x95>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1252 <main+0x122>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1050 <putenv@plt>
lea    0xee4(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1208 <main+0xd8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1252 <main+0x122>
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
call   1050 <putenv@plt>
lea    0xea1(%rip),%rdi
call   1050 <putenv@plt>
mov    $0x0,%al
call   1030 <one_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    124b <main+0x11b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1252 <main+0x122>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1050 <putenv@plt>
lea    0xec9(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     11f4 <main+0xc4>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
call   1050 <putenv@plt>
lea    0xe96(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     11f4 <main+0xc4>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5a(%rip),%rdi
call   1050 <putenv@plt>
lea    0xe99(%rip),%rdi
call   1050 <putenv@plt>
xor    %eax,%eax
call   1040 <one_test@plt>
test   %eax,%eax
js     11f4 <main+0xc4>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
call   1050 <putenv@plt>
lea    0xe6a(%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 = [33 x i8] c"using default import and export\0A\00"
@.str.1 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=0\00"
@.str.2 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=0\00"
@.str.3 = [46 x i8] c"using minimalistic import and default export\0A\00"
@.str.4 = [25 x i8] c"HWLOC_NO_LIBXML_IMPORT=1\00"
@.str.5 = [46 x i8] c"using default import and minimalistic export\0A\00"
@.str.6 = [25 x i8] c"HWLOC_NO_LIBXML_EXPORT=1\00"
@.str.7 = [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 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 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 (...) @one_test()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %39
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (...) @one_test()
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = load i32, i32* %2
store i32 %19, i32* %1
br label %39
20: ; preds = %11
%21 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 (...) @one_test()
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = load i32, i32* %2
store i32 %28, i32* %1
br label %39
29: ; preds = %20
%30 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%31 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @putenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 (...) @one_test()
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %29
%37 = load i32, i32* %2
store i32 %37, i32* %1
br label %39
38: ; preds = %29
store i32 0, i32* %1
br label %39
39: ; preds = %38, %36, %27, %18, %9
%40 = load i32, i32* %1
ret i32 %40
}

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