#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *popen(char *, char *);
int main(int argc, char **argv) {
  FILE *gplot = popen("gnuplot -persist", "w");
  fprintf(gplot, "set term png\n");
  fprintf(gplot, "set output 'Plot_Data.png'\n");
  fprintf(gplot, "set multiplot layout 1,2 rowsfirst \n");
  fprintf(gplot, "set title 'x1(t)'\n");
  fprintf(gplot, "unset key\n");
  fprintf(gplot, "plot 'Data.txt' using 1:2\n");
  fprintf(gplot, "set title 'x2(t)'\n");
  fprintf(gplot, "unset key\n");
  fprintf(gplot, "plot 'Data.txt' using 1:3\n");
  close(gplot);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xed4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,%rbx
lea    0xec2(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
lea    0xeb7(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeba(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xec6(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xec0(%rip),%r14
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeb1(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe96(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"gnuplot -persist\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [14 x i8] c"set term png\0A\00"
@.str.3 = [28 x i8] c"set output 'Plot_Data.png'\0A\00"
@.str.4 = [37 x i8] c"set multiplot layout 1,2 rowsfirst \0A\00"
@.str.5 = [19 x i8] c"set title 'x1(t)'\0A\00"
@.str.6 = [11 x i8] c"unset key\0A\00"
@.str.7 = [27 x i8] c"plot 'Data.txt' using 1:2\0A\00"
@.str.8 = [19 x i8] c"set title 'x2(t)'\0A\00"
@.str.9 = [27 x i8] c"plot 'Data.txt' using 1:3\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32* @popen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %5
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32*, i32** %5
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32*, i32** %5
%16 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%17 = load i32*, i32** %5
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%19 = load i32*, i32** %5
%20 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%21 = load i32*, i32** %5
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%23 = load i32*, i32** %5
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%25 = load i32*, i32** %5
%26 = call i32 @close(i32* %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"gnuplot -persist\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [14 x i8] c"set term png\0A\00"
@.str.3 = [28 x i8] c"set output 'Plot_Data.png'\0A\00"
@.str.4 = [37 x i8] c"set multiplot layout 1,2 rowsfirst \0A\00"
@.str.5 = [19 x i8] c"set title 'x1(t)'\0A\00"
@.str.6 = [11 x i8] c"unset key\0A\00"
@.str.7 = [27 x i8] c"plot 'Data.txt' using 1:2\0A\00"
@.str.8 = [19 x i8] c"set title 'x2(t)'\0A\00"
@.str.9 = [27 x i8] c"plot 'Data.txt' using 1:3\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @popen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 13, i64 1, i32* %3)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i64 27, i64 1, i32* %3)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i64 36, i64 1, i32* %3)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 18, i64 1, i32* %3)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 10, i64 1, i32* %3)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i64 26, i64 1, i32* %3)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i64 18, i64 1, i32* %3)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 10, i64 1, i32* %3)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i64 26, i64 1, i32* %3)
%13 = tail call i32 @close(i32* %3)
ret i32 0
}