#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  char out[200];
  char src[250];
  strcpy(out, "");
  strcpy(src, "php5 /quack/quack/src/repl/QuackRepl.php --ast");
  int i;
  for (i = 1; i < argc; i++) {
    strcat(out, " ");
    strcat(out, argv[i]);
  }
  strcat(src, out);
  system(src);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1e0(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x1e4(%rbp)
mov    -0x1e4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ca <main+0x9a>
lea    -0xe0(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strcat@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1e4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1050 <strcat@plt>
mov    -0x1e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e4(%rbp)
jmp    1179 <main+0x49>
lea    -0x1e0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x1e0(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d0,%rsp
mov    %rsi,%r15
mov    %edi,%ebx
lea    0xee4(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xea5(%rip),%rsi
lea    0xd0(%rsp),%rdi
call   1030 <strcpy@plt>
cmp    $0x2,%ebx
jl     11a0 <main+0x70>
mov    %ebx,%r12d
mov    $0x1,%ebx
lea    0xeb3(%rip),%r14
mov    %rsp,%r13
nop
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    (%r15,%rbx,8),%rsi
mov    %r13,%rdi
call   1050 <strcat@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1180 <main+0x50>
lea    0xd0(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [47 x i8] c"php5 /quack/quack/src/repl/QuackRepl.php --ast\00"
@.str.2 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
%7 = alloca [250 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %8
br label %13
13: ; preds = %27, %2
%14 = load i32, i32* %8
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%21 = load i8**, i8*** %5
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @strcat(i8* %20, i8* %25)
br label %27
27: ; preds = %17
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %13
30: ; preds = %13
%31 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%32 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%33 = call i32 @strcat(i8* %31, i8* %32)
%34 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%35 = call i32 @system(i8* %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [47 x i8] c"php5 /quack/quack/src/repl/QuackRepl.php --ast\00"
@.str.2 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [200 x i8]
%4 = alloca [250 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [250 x i8], [250 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 1, %10 ], [ %18, %12 ]
%14 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds i8*, i8** %1, i64 %13
%16 = load i8*, i8** %15
%17 = call i32 @strcat(i8* %5, i8* %16)
%18 = add nuw nsw i64 %13, 1
%19 = icmp eq i64 %18, %11
br i1 %19, label %20, label %12
20: ; preds = %12, %2
%21 = call i32 @strcat(i8* %6, i8* %5)
%22 = call i32 @system(i8* %6)
ret i32 0
}