#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*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int system(char *);
int main() {
  char cmd[256];
  int r;
  strcpy(cmd, "./synth -i tst/msg0.txt -o tst/song0.wav");
  printf("%s\n", cmd);
  system(cmd);
  strcpy(cmd, "./ext -i tst/song0.wav -o tst/msg0.out");
  printf("%s\n", cmd);
  system(cmd);
  r = system("diff tst/msg0.txt tst/msg0.out");
  (!r) ? printf("pass\n\n") : printf("fail\n\n");
  strcpy(cmd, "./synth -i tst/msg1.txt -o tst/song1.wav");
  printf("%s\n", cmd);
  system(cmd);
  strcpy(cmd, "./ext -i tst/song1.wav -o tst/msg1.out");
  printf("%s\n", cmd);
  system(cmd);
  r = system("diff tst/msg1.txt tst/msg1.out");
  (!r) ? printf("pass\n\n") : printf("fail\n\n");
  strcpy(cmd, "./synth -i tst/msg2.txt -o tst/song2.wav");
  printf("%s\n", cmd);
  system(cmd);
  strcpy(cmd, "./ext -i tst/song2.wav -o tst/msg2.out");
  printf("%s\n", cmd);
  system(cmd);
  r = system("diff tst/msg2.txt tst/msg2.out");
  (!r) ? printf("pass\n\n") : printf("fail\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    -0x110(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    0xea3(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jne    11dc <main+0xac>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ea <main+0xba>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    -0x110(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    0xe78(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jne    1284 <main+0x154>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1292 <main+0x162>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    -0x110(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rsi
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
lea    0xe3f(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jne    132c <main+0x1fc>
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    133a <main+0x20a>
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xecc(%rip),%rdi
call   1050 <system@plt>
test   %eax,%eax
lea    0xfbb(%rip),%r15
lea    0xfba(%rip),%r14
mov    %r14,%rdi
cmove  %r15,%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xed5(%rip),%rdi
call   1050 <system@plt>
test   %eax,%eax
mov    %r14,%rdi
cmove  %r15,%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xeec(%rip),%rdi
call   1050 <system@plt>
test   %eax,%eax
cmove  %r15,%r14
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [41 x i8] c"./synth -i tst/msg0.txt -o tst/song0.wav\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [39 x i8] c"./ext -i tst/song0.wav -o tst/msg0.out\00"
@.str.3 = [31 x i8] c"diff tst/msg0.txt tst/msg0.out\00"
@.str.4 = [7 x i8] c"pass\0A\0A\00"
@.str.5 = [7 x i8] c"fail\0A\0A\00"
@.str.6 = [41 x i8] c"./synth -i tst/msg1.txt -o tst/song1.wav\00"
@.str.7 = [39 x i8] c"./ext -i tst/song1.wav -o tst/msg1.out\00"
@.str.8 = [31 x i8] c"diff tst/msg1.txt tst/msg1.out\00"
@.str.9 = [41 x i8] c"./synth -i tst/msg2.txt -o tst/song2.wav\00"
@.str.10 = [39 x i8] c"./ext -i tst/song2.wav -o tst/msg2.out\00"
@.str.11 = [31 x i8] c"diff tst/msg2.txt tst/msg2.out\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 @system(i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%15 = call i32 @system(i8* %14)
%16 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%30 = call i32 @system(i8* %29)
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%36 = call i32 @system(i8* %35)
%37 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
store i32 %37, i32* %3
%38 = load i32, i32* %3
%39 = icmp ne i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %23
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %44
42: ; preds = %23
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = phi i32 [ %41, %40 ], [ %43, %42 ]
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%51 = call i32 @system(i8* %50)
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%53 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0))
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %54)
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%57 = call i32 @system(i8* %56)
%58 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0))
store i32 %58, i32* %3
%59 = load i32, i32* %3
%60 = icmp ne i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %44
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %65
63: ; preds = %44
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %65
65: ; preds = %63, %61
%66 = phi i32 [ %62, %61 ], [ %64, %63 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"./synth -i tst/msg0.txt -o tst/song0.wav\00"
@.str.2 = [39 x i8] c"./ext -i tst/song0.wav -o tst/msg0.out\00"
@.str.3 = [31 x i8] c"diff tst/msg0.txt tst/msg0.out\00"
@.str.6 = [41 x i8] c"./synth -i tst/msg1.txt -o tst/song1.wav\00"
@.str.7 = [39 x i8] c"./ext -i tst/song1.wav -o tst/msg1.out\00"
@.str.8 = [31 x i8] c"diff tst/msg1.txt tst/msg1.out\00"
@.str.9 = [41 x i8] c"./synth -i tst/msg2.txt -o tst/song2.wav\00"
@.str.10 = [39 x i8] c"./ext -i tst/song2.wav -o tst/msg2.out\00"
@.str.11 = [31 x i8] c"diff tst/msg2.txt tst/msg2.out\00"
@str.13 = [6 x i8] c"pass\0A\00"
@str.16 = [6 x i8] c"fail\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* %2)
%5 = call i32 @system(i8* %2)
%6 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* %2)
%8 = call i32 @system(i8* %2)
%9 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.16, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @puts(i8* %2)
%15 = call i32 @system(i8* %2)
%16 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @puts(i8* %2)
%18 = call i32 @system(i8* %2)
%19 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.16, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%24 = call i32 @puts(i8* %2)
%25 = call i32 @system(i8* %2)
%26 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0))
%27 = call i32 @puts(i8* %2)
%28 = call i32 @system(i8* %2)
%29 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.16, i64 0, i64 0)
%32 = call i32 @puts(i8* dereferenceable(1) %31)
ret i32 0
}