#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 */
char *extendEnvironmentVar(char *);
int /*<<< orphan*/ printf(char *, ...);
void userCommand_L1_echo(char **givenData) {
  int i = -1;
  while (givenData[i++] != NULL) {
    if (givenData[i] != NULL) {
      givenData[i] = extendEnvironmentVar(givenData[i]);
      printf("%s ", givenData[i]);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<userCommand_L1_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11a2 <userCommand_L1_echo+0x82>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     119d <userCommand_L1_echo+0x7d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <extendEnvironmentVar@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1133 <userCommand_L1_echo+0x13>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userCommand_L1_echo>:
push   %r14
push   %rbx
push   %rax
cmpq   $0x0,-0x8(%rdi)
je     1177 <userCommand_L1_echo+0x47>
mov    %rdi,%rbx
lea    0xebb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1177 <userCommand_L1_echo+0x47>
call   1050 <extendEnvironmentVar@plt>
mov    %rax,(%rbx)
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmpq   $0x0,(%rbx)
lea    0x8(%rbx),%rbx
jne    1150 <userCommand_L1_echo+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @userCommand_L1_echo(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 -1, i32* %3
br label %4
4: ; preds = %36, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %37
12: ; preds = %4
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %36
19: ; preds = %12
%20 = load i8**, i8*** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i8* @extendEnvironmentVar(i8* %24)
%26 = load i8**, i8*** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
store i8* %25, i8** %29
%30 = load i8**, i8*** %2
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %19, %12
br label %4
37: ; preds = %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @userCommand_L1_echo(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 -1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %16, label %5
5: ; preds = %1, %10
%6 = phi i64 [ %14, %10 ], [ 0, %1 ]
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %5
%11 = tail call i8* @extendEnvironmentVar(i8* %8)
store i8* %11, i8** %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %7
%14 = add nuw i64 %6, 1
%15 = icmp eq i8* %13, null
br i1 %15, label %16, label %5
16: ; preds = %5, %10, %1
%17 = tail call i32 @putchar(i32 10)
ret void
}