int main() {
  char input;
  char input2;
  char input3;
  char input4;
  char input5;
  char input6;
  char input7;
  printf("Do you really want to install Lua?");
  scanf("%s", input);
  if (strcmp(input, "yes")) {
    printf("What Lua version?");
    scanf("%s", input2);
    printf("Downloading...");
    strcat(input3, "wget ");
    strcat(input3, "www.lua.org/ftp/lua-");
    strcat(input3, input2);
    strcat(input3, ".tar.gz");
    system(input3);
    printf("Downloaded, compiling..");
    strcat(input4, "cd lua-");
    strcat(input4, input2);
    system(input4);
    system("cd src");
    printf("What operating system are you running? (lowercase)");
    scanf("%s", input6);
    printf("Compiling..");
    strcat(input7, "make ");
    strcat(input7, input6);
    system(input7);
    printf("Compiled.");
  }
  if (strcmp(input, "no")) {
    printf("I just wasted my time programming this then. Bye.");
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
movsbq -0x5(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     12c2 <main+0x172>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x6(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbq -0x7(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1070 <strcat@plt>
movsbq -0x7(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <strcat@plt>
movsbq -0x7(%rbp),%rdi
movsbq -0x6(%rbp),%rsi
call   1070 <strcat@plt>
movsbq -0x7(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1070 <strcat@plt>
movsbl -0x7(%rbp),%edi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbq -0x8(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1070 <strcat@plt>
movsbq -0x8(%rbp),%rdi
movsbq -0x6(%rbp),%rsi
call   1070 <strcat@plt>
movsbl -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0xa(%rbp),%esi
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbq -0xb(%rbp),%rdi
lea    0xe3f(%rip),%rsi
call   1070 <strcat@plt>
movsbq -0xb(%rbp),%rdi
movsbq -0xa(%rbp),%rsi
call   1070 <strcat@plt>
movsbl -0xb(%rbp),%edi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbq -0x5(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     12f1 <main+0x1a1>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xead(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xea0(%rip),%rsi
xor    %edi,%edi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12a6 <main+0x146>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe79(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
movabs $0x2d61756c2f7074,%rcx
mov    %rcx,0xd(%rax)
movups 0xe6b(%rip),%xmm0
movups %xmm0,(%rax)
xor    %edi,%edi
xor    %esi,%esi
call   1080 <strcat@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
movabs $0x7a672e7261742e,%rcx
mov    %rcx,(%rax)
xor    %edi,%edi
xor    %eax,%eax
call   1040 <system@plt>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
movabs $0x2d61756c206463,%rcx
mov    %rcx,(%rax)
xor    %edi,%edi
xor    %esi,%esi
call   1080 <strcat@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <system@plt>
lea    0xe34(%rip),%rdi
xor    %eax,%eax
call   1040 <system@plt>
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe46(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
movl   $0x656b616d,(%rax)
movw   $0x20,0x4(%rax)
xor    %edi,%edi
xor    %esi,%esi
call   1080 <strcat@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <system@plt>
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe21(%rip),%rsi
xor    %edi,%edi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12c6 <main+0x166>
lea    0xe12(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Do you really want to install Lua?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [18 x i8] c"What Lua version?\00"
@.str.4 = [15 x i8] c"Downloading...\00"
@.str.5 = [6 x i8] c"wget \00"
@.str.6 = [21 x i8] c"www.lua.org/ftp/lua-\00"
@.str.7 = [8 x i8] c".tar.gz\00"
@.str.8 = [24 x i8] c"Downloaded, compiling..\00"
@.str.9 = [8 x i8] c"cd lua-\00"
@.str.10 = [7 x i8] c"cd src\00"
@.str.11 = [51 x i8] c"What operating system are you running? (lowercase)\00"
@.str.12 = [12 x i8] c"Compiling..\00"
@.str.13 = [6 x i8] c"make \00"
@.str.14 = [10 x i8] c"Compiled.\00"
@.str.15 = [3 x i8] c"no\00"
@.str.16 = [50 x i8] c"I just wasted my time programming this then. Bye.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8, i8* %2
%14 = sext i8 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %82
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%24 = load i8, i8* %4
%25 = sext i8 %24 to i64
%26 = inttoptr i64 %25 to i8*
%27 = call i8* @strcat(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%28 = load i8, i8* %4
%29 = sext i8 %28 to i64
%30 = inttoptr i64 %29 to i8*
%31 = call i8* @strcat(i8* %30, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%32 = load i8, i8* %4
%33 = sext i8 %32 to i64
%34 = inttoptr i64 %33 to i8*
%35 = load i8, i8* %3
%36 = sext i8 %35 to i64
%37 = inttoptr i64 %36 to i8*
%38 = call i8* @strcat(i8* %34, i8* %37)
%39 = load i8, i8* %4
%40 = sext i8 %39 to i64
%41 = inttoptr i64 %40 to i8*
%42 = call i8* @strcat(i8* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%43 = load i8, i8* %4
%44 = sext i8 %43 to i32
%45 = call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%47 = load i8, i8* %5
%48 = sext i8 %47 to i64
%49 = inttoptr i64 %48 to i8*
%50 = call i8* @strcat(i8* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%51 = load i8, i8* %5
%52 = sext i8 %51 to i64
%53 = inttoptr i64 %52 to i8*
%54 = load i8, i8* %3
%55 = sext i8 %54 to i64
%56 = inttoptr i64 %55 to i8*
%57 = call i8* @strcat(i8* %53, i8* %56)
%58 = load i8, i8* %5
%59 = sext i8 %58 to i32
%60 = call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 %59)
%61 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
%63 = load i8, i8* %7
%64 = sext i8 %63 to i32
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%67 = load i8, i8* %8
%68 = sext i8 %67 to i64
%69 = inttoptr i64 %68 to i8*
%70 = call i8* @strcat(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%71 = load i8, i8* %8
%72 = sext i8 %71 to i64
%73 = inttoptr i64 %72 to i8*
%74 = load i8, i8* %7
%75 = sext i8 %74 to i64
%76 = inttoptr i64 %75 to i8*
%77 = call i8* @strcat(i8* %73, i8* %76)
%78 = load i8, i8* %8
%79 = sext i8 %78 to i32
%80 = call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %82
82: ; preds = %18, %0
%83 = load i8, i8* %2
%84 = sext i8 %83 to i64
%85 = inttoptr i64 %84 to i8*
%86 = call i32 @strcmp(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %82
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %1
br label %90
90: ; preds = %88, %82
%91 = load i32, i32* %1
ret i32 %91
}

LLVM IR (-O2):
@.str = [35 x i8] c"Do you really want to install Lua?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [18 x i8] c"What Lua version?\00"
@.str.4 = [15 x i8] c"Downloading...\00"
@.str.6 = [21 x i8] c"www.lua.org/ftp/lua-\00"
@.str.8 = [24 x i8] c"Downloaded, compiling..\00"
@.str.10 = [7 x i8] c"cd src\00"
@.str.11 = [51 x i8] c"What operating system are you running? (lowercase)\00"
@.str.12 = [12 x i8] c"Compiling..\00"
@.str.13 = [6 x i8] c"make \00"
@.str.14 = [10 x i8] c"Compiled.\00"
@.str.15 = [3 x i8] c"no\00"
@.str.16 = [50 x i8] c"I just wasted my time programming this then. Bye.\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @strcmp(i8* dereferenceable(1) null, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %31, label %5
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i64 @strlen(i8* dereferenceable(1) null)
%10 = getelementptr i8, i8* null, i64 %9
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(21) %10, i8* align 1 dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i64 21, i1 false)
%11 = tail call i8* @strcat(i8* dereferenceable(1) null, i8* dereferenceable(1) null)
%12 = tail call i64 @strlen(i8* dereferenceable(1) null)
%13 = getelementptr i8, i8* null, i64 %12
%14 = bitcast i8* %13 to i64*
store i64 34453396343845934, i64* %14
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 0)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i64 @strlen(i8* dereferenceable(1) null)
%18 = getelementptr i8, i8* null, i64 %17
%19 = bitcast i8* %18 to i64*
store i64 12773530905109603, i64* %19
%20 = tail call i8* @strcat(i8* dereferenceable(1) null, i8* dereferenceable(1) null)
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 0)
%22 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%26 = tail call i64 @strlen(i8* dereferenceable(1) null)
%27 = getelementptr i8, i8* null, i64 %26
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %27, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i64 6, i1 false)
%28 = tail call i8* @strcat(i8* dereferenceable(1) null, i8* dereferenceable(1) null)
%29 = tail call i32 (i32, ...) bitcast (i32 (...)* @system to i32 (i32, ...)*)(i32 0)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %31
31: ; preds = %5, %0
%32 = tail call i32 @strcmp(i8* dereferenceable(1) null, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.16, i64 0, i64 0))
br label %36
36: ; preds = %31, %34
ret i32 0
}