#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*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  volatile int group;
  char buffer[64];
  group = 0;
  if (argc == 2) {
    strcpy(buffer, argv[1]);
    if (group == 0x726f6f74) {
      printf("Hello, root %s\n", argv[1]);
    } else {
      printf("Hello, user (%08x) %s\n", group, argv[1]);
    }
  } else {
    printf("Usage : <username>\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    119f <main+0x7f>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
cmp    $0x726f6f74,%eax
jne    1181 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119a <main+0x7a>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ad <main+0x8d>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movl   $0x0,0xc(%rsp)
cmp    $0x2,%edi
jne    1172 <main+0x42>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
cmp    $0x726f6f74,%eax
jne    1180 <main+0x50>
mov    0x8(%rbx),%rsi
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1196 <main+0x66>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
jmp    1196 <main+0x66>
mov    0xc(%rsp),%esi
mov    0x8(%rbx),%rdx
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, root %s\0A\00"
@.str.1 = [23 x i8] c"Hello, user (%08x) %s\0A\00"
@.str.2 = [20 x i8] c"Usage : <username>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* %6
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %30
10: ; preds = %2
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strcpy(i8* %11, i8* %14)
%16 = load volatile i32, i32* %6
%17 = icmp eq i32 %16, 1919905652
br i1 %17, label %18, label %23
18: ; preds = %10
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %29
23: ; preds = %10
%24 = load volatile i32, i32* %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %24, i8* %27)
br label %29
29: ; preds = %23, %18
br label %32
30: ; preds = %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %29
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, root %s\0A\00"
@.str.1 = [23 x i8] c"Hello, user (%08x) %s\0A\00"
@str = [19 x i8] c"Usage : <username>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [64 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
store volatile i32 0, i32* %3
%7 = icmp eq i32 %0, 2
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %6, i8* %10)
%12 = load volatile i32, i32* %3
%13 = icmp eq i32 %12, 1919905652
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %9
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %23
17: ; preds = %8
%18 = load volatile i32, i32* %3
%19 = load i8*, i8** %9
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %18, i8* %19)
br label %23
21: ; preds = %2
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %14, %17, %21
ret i32 0
}