#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ intToChar(int, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void plot_number(int j) {
  char filename[50] = "";
  char format[17] = ".txt'  using 1:2\n";
  char indice[2] = "";
  intToChar(j, indice);
  strcat(filename, "plot 'Data");
  strcat(filename, indice);
  strcat(filename, format);
  char plotname[50] = "";
  char formatplot[17] = ".png '\n";
  char indiceplot[2] = "";
  intToChar(j, indiceplot);
  strcat(plotname, "set output 'Plot_Data ");
  strcat(plotname, indiceplot);
  strcat(plotname, formatplot);
  FILE *gplot = popen("gnuplot -persist", "w");
  fprintf(gplot, "set term png\n");
  fprintf(gplot, plotname);
  fprintf(gplot, "set xlabel 'Segundos\n");
  fprintf(gplot, "set ylabel 'Concentracion de Metano [ppm]'\n");
  fprintf(gplot, "set title 'Gas(t)'\n");
  fprintf(gplot, "unset key\n");
  fprintf(gplot, filename);
  fclose(gplot);
}


x86 assembly (clang, -O0):
<plot_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
mov    0xe7b(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe78(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe76(%rip),%al
mov    %al,-0x50(%rbp)
lea    -0x62(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x62(%rbp),%rsi
call   1070 <intToChar@plt>
lea    -0x40(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1080 <strcat@plt>
lea    -0x40(%rbp),%rdi
lea    -0x62(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
mov    0xe23(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe1d(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe18(%rip),%al
mov    %al,-0xb0(%rbp)
lea    -0xc2(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0xc2(%rbp),%rsi
call   1070 <intToChar@plt>
lea    -0xa0(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   1080 <strcat@plt>
lea    -0xa0(%rbp),%rdi
lea    -0xc2(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0xa0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1080 <strcat@plt>
lea    0xdd3(%rip),%rdi
lea    0xddd(%rip),%rsi
call   1060 <popen@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    0xdad(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <fprintf@plt>
mov    -0xd0(%rbp),%rdi
call   1030 <fclose@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_number>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movw   $0x0,0xc0(%rsp)
movaps 0xe64(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movb   $0xa,0x40(%rsp)
movw   $0x0,0xe(%rsp)
lea    0xe(%rsp),%r15
mov    %r15,%rsi
call   1060 <intToChar@plt>
lea    0xe70(%rip),%rsi
lea    0x90(%rsp),%r14
mov    %r14,%rdi
call   1070 <strcat@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
lea    0x30(%rsp),%rsi
mov    %r14,%rdi
call   1070 <strcat@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movw   $0x0,0x80(%rsp)
movaps 0xe14(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
movw   $0x0,0xc(%rsp)
lea    0xc(%rsp),%r12
mov    %ebx,%edi
mov    %r12,%rsi
call   1060 <intToChar@plt>
lea    0xe09(%rip),%rsi
lea    0x50(%rsp),%r15
mov    %r15,%rdi
call   1070 <strcat@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <strcat@plt>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1070 <strcat@plt>
lea    0xdf4(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0xdf1(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fprintf@plt>
lea    0xddb(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xdd8(%rip),%rdi
mov    $0x2b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xdeb(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xde6(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.plot_number.format = [17 x i8] c".txt' using 1:2\0A"
@.str = [11 x i8] c"plot 'Data\00"
@__const.plot_number.formatplot = [17 x i8] c".png '\0A\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [23 x i8] c"set output 'Plot_Data \00"
@.str.2 = [17 x i8] c"gnuplot -persist\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [14 x i8] c"set term png\0A\00"
@.str.5 = [22 x i8] c"set xlabel 'Segundos\0A\00"
@.str.6 = [44 x i8] c"set ylabel 'Concentracion de Metano [ppm]'\0A\00"
@.str.7 = [20 x i8] c"set title 'Gas(t)'\0A\00"
@.str.8 = [11 x i8] c"unset key\0A\00"
define void @plot_number(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = alloca [17 x i8]
%5 = alloca [2 x i8]
%6 = alloca [50 x i8]
%7 = alloca [17 x i8]
%8 = alloca [2 x i8]
%9 = alloca i32*
store i32 %0, i32* %2
%10 = bitcast [50 x i8]* %3 to i8*
%11 = bitcast [17 x i8]* %4 to i8*
%12 = bitcast [2 x i8]* %5 to i8*
%13 = load i32, i32* %2
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call i32 @intToChar(i32 %13, i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [17 x i8], [17 x i8]* %4, i64 0, i64 0
%23 = call i32 @strcat(i8* %21, i8* %22)
%24 = bitcast [50 x i8]* %6 to i8*
%25 = bitcast [17 x i8]* %7 to i8*
%26 = bitcast [2 x i8]* %8 to i8*
%27 = load i32, i32* %2
%28 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%29 = call i32 @intToChar(i32 %27, i8* %28)
%30 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%31 = call i32 @strcat(i8* %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%33 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%34 = call i32 @strcat(i8* %32, i8* %33)
%35 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%36 = getelementptr inbounds [17 x i8], [17 x i8]* %7, i64 0, i64 0
%37 = call i32 @strcat(i8* %35, i8* %36)
%38 = call i32* @popen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %38, i32** %9
%39 = load i32*, i32** %9
%40 = call i32 @fprintf(i32* %39, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%41 = load i32*, i32** %9
%42 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%43 = call i32 @fprintf(i32* %41, i8* %42)
%44 = load i32*, i32** %9
%45 = call i32 @fprintf(i32* %44, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%46 = load i32*, i32** %9
%47 = call i32 @fprintf(i32* %46, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32*, i32** %9
%49 = call i32 @fprintf(i32* %48, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%50 = load i32*, i32** %9
%51 = call i32 @fprintf(i32* %50, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%52 = load i32*, i32** %9
%53 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%54 = call i32 @fprintf(i32* %52, i8* %53)
%55 = load i32*, i32** %9
%56 = call i32 @fclose(i32* %55)
ret void
}

LLVM IR (-O2):
@__const.plot_number.format = [17 x i8] c".txt' using 1:2\0A"
@.str = [11 x i8] c"plot 'Data\00"
@__const.plot_number.formatplot = [17 x i8] c".png '\0A\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [23 x i8] c"set output 'Plot_Data \00"
@.str.2 = [17 x i8] c"gnuplot -persist\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [14 x i8] c"set term png\0A\00"
@.str.5 = [22 x i8] c"set xlabel 'Segundos\0A\00"
@.str.6 = [44 x i8] c"set ylabel 'Concentracion de Metano [ppm]'\0A\00"
@.str.7 = [20 x i8] c"set title 'Gas(t)'\0A\00"
@.str.8 = [11 x i8] c"unset key\0A\00"
define void @plot_number(i32 %0) {
%2 = alloca [50 x i8]
%3 = alloca [17 x i8]
%4 = alloca i16
%5 = alloca [50 x i8]
%6 = alloca [17 x i8]
%7 = alloca i16
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%10 = bitcast i16* %4 to i8*
store i16 0, i16* %4
%11 = call i32 @intToChar(i32 %0, i8* %10)
%12 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @strcat(i8* %8, i8* %10)
%14 = call i32 @strcat(i8* %8, i8* %9)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 0
%17 = bitcast i16* %7 to i8*
store i16 0, i16* %7
%18 = call i32 @intToChar(i32 %0, i8* %17)
%19 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @strcat(i8* %15, i8* %17)
%21 = call i32 @strcat(i8* %15, i8* %16)
%22 = call i32* @popen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i64 13, i64 1, i32* %22)
%24 = call i32 @fprintf(i32* %22, i8* %15)
%25 = call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i64 21, i64 1, i32* %22)
%26 = call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i64 43, i64 1, i32* %22)
%27 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i64 19, i64 1, i32* %22)
%28 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i64 10, i64 1, i32* %22)
%29 = call i32 @fprintf(i32* %22, i8* %8)
%30 = call i32 @fclose(i32* %22)
ret void
}