#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strncmp(char *, char *, int);
void __attribute__((constructor)) init(int argc, char **argv, char **env) {
  int i;
  for (i = 0; env[i]; i++) {
    if (!strncmp(env[i], "FAKEUNAME_", sizeof("FAKEUNAME_") - 1)) {
      return;
    }
  }
  if (argc >= 1) {
    fprintf(stderr, "Running '%s' without changing anything.\n", argv[0]);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     118b <init+0x6b>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xea0(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1178 <init+0x58>
jmp    11b1 <init+0x91>
jmp    117d <init+0x5d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <init+0x1a>
cmpl   $0x1,-0x4(%rbp)
jl     11b1 <init+0x91>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe5f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
mov    (%rdx),%rdi
test   %rdi,%rdi
je     116d <init+0x4d>
mov    %rdx,%rbx
add    $0x8,%rbx
lea    0xebd(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1194 <init+0x74>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1150 <init+0x30>
test   %r15d,%r15d
jle    1194 <init+0x74>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xe86(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"FAKEUNAME_\00"
@stderr = global i32 0
@.str.1 = [41 x i8] c"Running '%s' without changing anything.\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (void (i32, i8**, i8**)* @init to void ()*), i8* null }]
define void @init(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 0, i32* %7
br label %8
8: ; preds = %25, %3
%9 = load i8**, i8*** %6
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %28
15: ; preds = %8
%16 = load i8**, i8*** %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @strncmp(i8* %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %15
br label %37
24: ; preds = %15
br label %25
25: ; preds = %24
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %8
28: ; preds = %8
%29 = load i32, i32* %4
%30 = icmp sge i32 %29, 1
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %23, %31, %28
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"FAKEUNAME_\00"
@stderr = global i32 0
@.str.1 = [41 x i8] c"Running '%s' without changing anything.\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (void (i32, i8**, i8**)* @init to void ()*), i8* null }]
define void @init(i32 %0, i8** nocapture %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %16, label %10
6: ; preds = %10
%7 = getelementptr inbounds i8*, i8** %2, i64 %15
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %3, %6
%11 = phi i64 [ %15, %6 ], [ 0, %3 ]
%12 = phi i8* [ %8, %6 ], [ %4, %3 ]
%13 = tail call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%14 = icmp eq i32 %13, 0
%15 = add nuw i64 %11, 1
br i1 %14, label %22, label %6
16: ; preds = %6, %3
%17 = icmp sgt i32 %0, 0
br i1 %17, label %18, label %22
18: ; preds = %16
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %1
%21 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %10, %16, %18
ret void
}