#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 atoi(char *);
int /*<<< orphan*/ close(int);
char *getenv(char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ unsetenv(char *);
int /*<<< orphan*/ write(int, char *, int);
__attribute__((constructor)) void ___init__(void) {
  char *p = getenv("WITH_OVERLAYFS_DISCARD_COMM");
  if (!p) {
    return;
  }
  int fd = atoi(p);
  unsetenv("WITH_OVERLAYFS_DISCARD_COMM");
  unsetenv("LD_PRELOAD");
  char q[1];
  write(fd, q, 1);
  read(fd, q, 1);
  close(fd);
}


x86 assembly (clang, -O0):
<___init__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1188 <___init__+0x28>
jmp    11d6 <___init__+0x76>
mov    -0x8(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0xc(%rbp)
lea    0xe65(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xe75(%rip),%rdi
call   1070 <unsetenv@plt>
mov    -0xc(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    -0xc(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1060 <read@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___init__>:
push   %r14
push   %rbx
push   %rax
lea    0xe95(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11c1 <___init__+0x61>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
lea    0xe7a(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xe8a(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0x7(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1060 <read@plt>
mov    %ebx,%edi
call   1050 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"WITH_OVERLAYFS_DISCARD_COMM\00"
@.str.1 = [11 x i8] c"LD_PRELOAD\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @___init__, i8* null }]
define void @___init__() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca [1 x i8]
%4 = call i8* @getenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
br label %21
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %2
%11 = call i32 @unsetenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%15 = call i32 @write(i32 %13, i8* %14, i32 1)
%16 = load i32, i32* %2
%17 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%18 = call i32 @read(i32 %16, i8* %17, i32 1)
%19 = load i32, i32* %2
%20 = call i32 @close(i32 %19)
br label %21
21: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"WITH_OVERLAYFS_DISCARD_COMM\00"
@.str.1 = [11 x i8] c"LD_PRELOAD\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @___init__, i8* null }]
define void @___init__() {
%1 = alloca [1 x i8]
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %0
%5 = tail call i32 @atoi(i8* %2)
%6 = tail call i32 @unsetenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%9 = call i32 @write(i32 %5, i8* %8, i32 1)
%10 = call i32 @read(i32 %5, i8* %8, i32 1)
%11 = tail call i32 @close(i32 %5)
br label %12
12: ; preds = %0, %4
ret void
}