#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 *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  if (1)
    printf("Beginning master.c\n");
  char *repo = (char *)malloc(256 * sizeof(char));
  char *dest = (char *)malloc(256 * sizeof(char));
  printf("Which repository?\n");
  scanf("%s", repo);
  printf("Which sub-directory?\n");
  scanf("%s", dest);
  char *cmd = (char *)malloc(256 * sizeof(char));
  strcpy(cmd, "cp slave.c ");
  strcat(cmd, repo);
  strcat(cmd, "/");
  strcat(cmd, dest);
  system(cmd);
  strcpy(cmd, "cd ");
  strcat(cmd, repo);
  strcat(cmd, " && git pull");
  system(cmd);
  if (1)
    printf("Running slave.\n");
  strcpy(cmd, "cd ");
  strcat(cmd, repo);
  strcat(cmd, "/");
  strcat(cmd, dest);
  strcat(cmd, " && git pull && ");
  strcat(cmd, "gcc slave.c -o slave && ");
  strcat(cmd, "./slave");
  system(cmd);
  if (1)
    printf("Removing slave.\n");
  strcpy(cmd, "cd ");
  strcat(cmd, repo);
  strcat(cmd, "/");
  strcat(cmd, dest);
  strcat(cmd, " && ");
  strcat(cmd, "rm slave.c && rm slave");
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xe76(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe70(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe5d(%rip),%rdi
call   1070 <scanf@plt>
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
mov    -0x20(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
lea    0xe02(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xde1(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
lea    0xdc5(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd62(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5e(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe2b(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
lea    0xe1d(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xdfa(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
lea    0xd9f(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xda1(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xdab(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xdfc(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
lea    0xd57(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xd55(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Beginning master.c\0A\00"
@.str.1 = [19 x i8] c"Which repository?\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [22 x i8] c"Which sub-directory?\0A\00"
@.str.4 = [12 x i8] c"cp slave.c \00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [4 x i8] c"cd \00"
@.str.7 = [13 x i8] c" && git pull\00"
@.str.8 = [16 x i8] c"Running slave.\0A\00"
@.str.9 = [17 x i8] c" && git pull && \00"
@.str.10 = [25 x i8] c"gcc slave.c -o slave && \00"
@.str.11 = [8 x i8] c"./slave\00"
@.str.12 = [17 x i8] c"Removing slave.\0A\00"
@.str.13 = [5 x i8] c" && \00"
@.str.14 = [23 x i8] c"rm slave.c && rm slave\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @malloc(i32 256)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
%8 = call i64 @malloc(i32 256)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%14 = load i8*, i8** %3
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i64 @malloc(i32 256)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%20 = load i8*, i8** %4
%21 = load i8*, i8** %2
%22 = call i32 @strcat(i8* %20, i8* %21)
%23 = load i8*, i8** %4
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%25 = load i8*, i8** %4
%26 = load i8*, i8** %3
%27 = call i32 @strcat(i8* %25, i8* %26)
%28 = load i8*, i8** %4
%29 = call i32 @system(i8* %28)
%30 = load i8*, i8** %4
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%32 = load i8*, i8** %4
%33 = load i8*, i8** %2
%34 = call i32 @strcat(i8* %32, i8* %33)
%35 = load i8*, i8** %4
%36 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%37 = load i8*, i8** %4
%38 = call i32 @system(i8* %37)
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%40 = load i8*, i8** %4
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%42 = load i8*, i8** %4
%43 = load i8*, i8** %2
%44 = call i32 @strcat(i8* %42, i8* %43)
%45 = load i8*, i8** %4
%46 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%47 = load i8*, i8** %4
%48 = load i8*, i8** %3
%49 = call i32 @strcat(i8* %47, i8* %48)
%50 = load i8*, i8** %4
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%52 = load i8*, i8** %4
%53 = call i32 @strcat(i8* %52, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%54 = load i8*, i8** %4
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%56 = load i8*, i8** %4
%57 = call i32 @system(i8* %56)
%58 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%59 = load i8*, i8** %4
%60 = call i32 @strcpy(i8* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%61 = load i8*, i8** %4
%62 = load i8*, i8** %2
%63 = call i32 @strcat(i8* %61, i8* %62)
%64 = load i8*, i8** %4
%65 = call i32 @strcat(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%66 = load i8*, i8** %4
%67 = load i8*, i8** %3
%68 = call i32 @strcat(i8* %66, i8* %67)
%69 = load i8*, i8** %4
%70 = call i32 @strcat(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%71 = load i8*, i8** %4
%72 = call i32 @strcat(i8* %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%73 = load i8*, i8** %4
%74 = call i32 @system(i8* %73)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [12 x i8] c"cp slave.c \00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [4 x i8] c"cd \00"
@.str.7 = [13 x i8] c" && git pull\00"
@.str.9 = [17 x i8] c" && git pull && \00"
@.str.10 = [25 x i8] c"gcc slave.c -o slave && \00"
@.str.11 = [8 x i8] c"./slave\00"
@.str.13 = [5 x i8] c" && \00"
@.str.14 = [23 x i8] c"rm slave.c && rm slave\00"
@str = [19 x i8] c"Beginning master.c\00"
@str.15 = [18 x i8] c"Which repository?\00"
@str.16 = [21 x i8] c"Which sub-directory?\00"
@str.17 = [15 x i8] c"Running slave.\00"
@str.18 = [16 x i8] c"Removing slave.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @malloc(i32 256)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%10 = tail call i64 @malloc(i32 256)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 @strcat(i8* %11, i8* %3)
%14 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @strcat(i8* %11, i8* %5)
%16 = tail call i32 @system(i8* %11)
%17 = tail call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%18 = tail call i32 @strcat(i8* %11, i8* %3)
%19 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%20 = tail call i32 @system(i8* %11)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.17, i64 0, i64 0))
%22 = tail call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%23 = tail call i32 @strcat(i8* %11, i8* %3)
%24 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%25 = tail call i32 @strcat(i8* %11, i8* %5)
%26 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%27 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%28 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%29 = tail call i32 @system(i8* %11)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.18, i64 0, i64 0))
%31 = tail call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%32 = tail call i32 @strcat(i8* %11, i8* %3)
%33 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%34 = tail call i32 @strcat(i8* %11, i8* %5)
%35 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%36 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%37 = tail call i32 @system(i8* %11)
ret i32 0
}