#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*/ *popen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, char *, char, char *);
FILE *measurement_open_html_table_pipe(void) {
  char sys_string[1024];
  char *heading_comma_string;
  char *justify_string;
  heading_comma_string =
      "station,datatype,measurement_date,measurement_time,measurement_value";
  justify_string = "left,left,left,left,right";
  sprintf(sys_string,
          "queue_top_bottom_lines.e %d |"
          "html_table.e '' '%s' '%c' '%s'",
          50, heading_comma_string, '|', justify_string);
  return popen(sys_string, "w");
}


x86 assembly (clang, -O0):
<measurement_open_html_table_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    0xece(%rip),%rax
mov    %rax,-0x408(%rbp)
lea    0xf05(%rip),%rax
mov    %rax,-0x410(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x408(%rbp),%rcx
mov    -0x410(%rbp),%r9
lea    0xefc(%rip),%rsi
mov    $0x32,%edx
mov    $0x7c,%r8d
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
lea    0xf1a(%rip),%rsi
call   1030 <popen@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_open_html_table_pipe>:
push   %rbx
sub    $0x400,%rsp
lea    0xf30(%rip),%rsi
lea    0xeca(%rip),%rcx
lea    0xf08(%rip),%r9
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%edx
mov    $0x7c,%r8d
call   1040 <sprintf@plt>
lea    0xf41(%rip),%rsi
mov    %rbx,%rdi
call   1030 <popen@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"station,datatype,measurement_date,measurement_time,measurement_value\00"
@.str.1 = [26 x i8] c"left,left,left,left,right\00"
@.str.2 = [60 x i8] c"queue_top_bottom_lines.e %d |html_table.e '' '%s' '%c' '%s'\00"
@.str.3 = [2 x i8] c"w\00"
define i32* @measurement_open_html_table_pipe() {
%1 = alloca [1024 x i8]
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 50, i8* %5, i8 signext 124, i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%9 = call i32* @popen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32* %9
}

LLVM IR (-O2):
@.str = [69 x i8] c"station,datatype,measurement_date,measurement_time,measurement_value\00"
@.str.1 = [26 x i8] c"left,left,left,left,right\00"
@.str.2 = [60 x i8] c"queue_top_bottom_lines.e %d |html_table.e '' '%s' '%c' '%s'\00"
@.str.3 = [2 x i8] c"w\00"
define noalias i32* @measurement_open_html_table_pipe() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8 signext 124, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32* @popen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32* %4
}