#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void cExec(char *file) {
  char *exec = (char *)malloc(256 * sizeof(char));
  strcpy(exec, "gcc ");
  strcat(exec, file);
  strcat(exec, " -o program && ./program > latesttest.txt");
  printf("%s\n", exec);
  system(exec);
}


x86 assembly (clang, -O0):
<cExec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cExec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"gcc \00"
@.str.1 = [42 x i8] c" -o program && ./program > latesttest.txt\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @cExec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 256)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @system(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"gcc \00"
@.str.1 = [42 x i8] c" -o program && ./program > latesttest.txt\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @cExec(i8* %0) {
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %3, i8* %0)
%6 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = tail call i32 @system(i8* %3)
ret void
}