#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 strlen(char *);
int /*<<< orphan*/ system(char *);
main() {
  char command[70];
  int i;
  char num[3];
  strcpy(command, "wget http://192.168.2.2/xampp/scene2/episode2.");
  int change = strlen(command) + 1;
  strcpy(num, "10");
  strcat(command, num);
  strcat(command, "_xvid.avi");
  for (i = 0; i <= 9; i++) {
    system(command);
    command[change]++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
lea    -0x57(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    -0x57(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1060 <strcat@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x9,-0x54(%rbp)
jg     11d2 <main+0x92>
lea    -0x50(%rbp),%rdi
call   1050 <system@plt>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x50(%rbp,%rax,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11a2 <main+0x62>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xeb0(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movslq %eax,%r15
lea    0xec0(%rip),%rsi
lea    0xd(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
addb   $0x1,0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [47 x i8] c"wget http://192.168.2.2/xampp/scene2/episode2.\00"
@.str.1 = [3 x i8] c"10\00"
@.str.2 = [10 x i8] c"_xvid.avi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [70 x i8]
%3 = alloca i32
%4 = alloca [3 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 0
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %18
18: ; preds = %29, %0
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 9
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 0
%23 = call i32 @system(i8* %22)
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [70 x i8], [70 x i8]* %2, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = add i8 %27, 1
store i8 %28, i8* %26
br label %29
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %18
32: ; preds = %18
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [47 x i8] c"wget http://192.168.2.2/xampp/scene2/episode2.\00"
@.str.1 = [3 x i8] c"10\00"
@.str.2 = [10 x i8] c"_xvid.avi\00"
define i32 @main() {
%1 = alloca [70 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strlen(i8* %3)
%7 = add nsw i32 %6, 1
%8 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @strcat(i8* %3, i8* %4)
%10 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%11 = sext i32 %7 to i64
%12 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 %11
%13 = call i32 @system(i8* %3)
%14 = load i8, i8* %12
%15 = add i8 %14, 1
store i8 %15, i8* %12
%16 = call i32 @system(i8* %3)
%17 = load i8, i8* %12
%18 = add i8 %17, 1
store i8 %18, i8* %12
%19 = call i32 @system(i8* %3)
%20 = load i8, i8* %12
%21 = add i8 %20, 1
store i8 %21, i8* %12
%22 = call i32 @system(i8* %3)
%23 = load i8, i8* %12
%24 = add i8 %23, 1
store i8 %24, i8* %12
%25 = call i32 @system(i8* %3)
%26 = load i8, i8* %12
%27 = add i8 %26, 1
store i8 %27, i8* %12
%28 = call i32 @system(i8* %3)
%29 = load i8, i8* %12
%30 = add i8 %29, 1
store i8 %30, i8* %12
%31 = call i32 @system(i8* %3)
%32 = load i8, i8* %12
%33 = add i8 %32, 1
store i8 %33, i8* %12
%34 = call i32 @system(i8* %3)
%35 = load i8, i8* %12
%36 = add i8 %35, 1
store i8 %36, i8* %12
%37 = call i32 @system(i8* %3)
%38 = load i8, i8* %12
%39 = add i8 %38, 1
store i8 %39, i8* %12
%40 = call i32 @system(i8* %3)
ret i32 0
}