#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*/ echo(char *);
int /*<<< orphan*/ removeChar(char *, char);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void validateEcho(int numParm, char *arr[]) {
  char finalRes[1024];
  strcpy(finalRes, "");
  int coo = 0;
  for (int i = 1; i < numParm; i++) {
    char re[1024];
    strcpy(re, arr[i]);
    strcat(finalRes, re);
    strcat(finalRes, " ");
  }
  removeChar(finalRes, '\"');
  removeChar(finalRes, '\'');
  echo(finalRes);
}


x86 assembly (clang, -O0):
<validateEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0x414(%rbp)
movl   $0x1,-0x418(%rbp)
mov    -0x418(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11dd <validateEcho+0x9d>
lea    -0x820(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x418(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    -0x820(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    1179 <validateEcho+0x39>
lea    -0x410(%rbp),%rdi
mov    $0x22,%esi
call   1050 <removeChar@plt>
lea    -0x410(%rbp),%rdi
mov    $0x27,%esi
call   1050 <removeChar@plt>
lea    -0x410(%rbp),%rdi
call   1030 <echo@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateEcho>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x808,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xea4(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
cmp    $0x2,%ebx
jl     11bb <validateEcho+0x7b>
mov    %ebx,%r13d
mov    $0x1,%ebp
lea    0x400(%rsp),%r15
mov    %rsp,%rbx
lea    0xe7c(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbp,8),%rsi
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1190 <validateEcho+0x50>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1050 <removeChar@plt>
mov    %rbx,%rdi
mov    $0x27,%esi
call   1050 <removeChar@plt>
mov    %rbx,%rdi
call   1030 <echo@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
define void @validateEcho(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = zext i32 %0 to i64
br label %15
11: ; preds = %15, %2
%12 = call i32 @removeChar(i8* %5, i8 signext 34)
%13 = call i32 @removeChar(i8* %5, i8 signext 39)
%14 = call i32 @echo(i8* %5)
ret void
15: ; preds = %8, %15
%16 = phi i64 [ 1, %8 ], [ %22, %15 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @strcpy(i8* %9, i8* %18)
%20 = call i32 @strcat(i8* %5, i8* %9)
%21 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = add nuw nsw i64 %16, 1
%23 = icmp eq i64 %22, %10
br i1 %23, label %11, label %15
}