#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*/ getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
int main() {
  char buf0[50];
  strncpy(buf0, getenv("USER"), 30);
  printf("You know, you really need to be more important to do things.\n");
  printf("%s\n", buf0);
  if (strncmp(buf0, "root", 4) == 0) {
    printf("Wow, maybe you are that important. Level Cleared!\n");
  } else {
    printf("You should really talk to someone more important.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xea2(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
mov    $0x1e,%edx
call   1040 <strncpy@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x4,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    11c5 <main+0x85>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11d3 <main+0x93>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1e,%edx
call   1040 <strncpy@plt>
lea    0xea0(%rip),%rdi
call   1060 <puts@plt>
mov    %rbx,%rdi
call   1060 <puts@plt>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
lea    0xee4(%rip),%rax
lea    0xeab(%rip),%rdi
cmove  %rax,%rdi
call   1060 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"USER\00"
@.str.1 = [62 x i8] c"You know, you really need to be more important to do things.\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [5 x i8] c"root\00"
@.str.4 = [51 x i8] c"Wow, maybe you are that important. Level Cleared!\0A\00"
@.str.5 = [51 x i8] c"You should really talk to someone more important.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strncpy(i8* %3, i32 %4, i32 30)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"USER\00"
@.str.3 = [5 x i8] c"root\00"
@str = [61 x i8] c"You know, you really need to be more important to do things.\00"
@str.6 = [50 x i8] c"You should really talk to someone more important.\00"
@str.7 = [50 x i8] c"Wow, maybe you are that important. Level Cleared!\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strncpy(i8* %2, i32 %3, i32 30)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
%7 = call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @str.6, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}