#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*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, char *,
                           char *, char *);
scalar_t__ get_line(char *, int /*<<< orphan*/ *);
char *get_table_name(char *, char *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ piece(char *, char, char *, int);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
void update_validation_columns(char *application_name, char *station,
                               char *where_clause) {
  char sys_string[1024];
  FILE *input_pipe;
  FILE *update_pipe;
  char expanded_where_clause[1024];
  char *select;
  char input_buffer[1024];
  char measurement_date_string[128];
  char measurement_time_string[128];
  char piece_buffer[128];
  char *table_name;
  table_name = get_table_name(application_name, "measurement");
  sprintf(sys_string, "update_statement.e %s %s '^^'", table_name,
          "station,measurement_date,measurement_time,datatype");
  update_pipe = popen(sys_string, "w");
  sprintf(expanded_where_clause, "%s and datatype = 'salinity'", where_clause);
  select = "measurement_date,measurement_time,last_validation_date,last_person_"
           "validating,last_validation_process,measurement_update_method";
  sprintf(sys_string,
          "get_folder_data	application=%s		"
          "			select=%s		"
          "			folder=measurement	"
          "			where=\"%s\"		",
          application_name, select, expanded_where_clause);
  input_pipe = popen(sys_string, "r");
  while (get_line(input_buffer, input_pipe)) {
    piece(measurement_date_string, '^', input_buffer, 0);
    piece(measurement_time_string, '^', input_buffer, 1);
    piece(piece_buffer, '^', input_buffer, 2);
    if (*piece_buffer) {
      fprintf(update_pipe, "%s^%s^%s^%s^last_validation_date^%s\n", station,
              measurement_date_string, measurement_time_string,
              "oxygen_solubility", piece_buffer);
    }
    piece(piece_buffer, '^', input_buffer, 3);
    if (*piece_buffer) {
      fprintf(update_pipe, "%s^%s^%s^%s^last_person_validating^%s\n", station,
              measurement_date_string, measurement_time_string,
              "oxygen_solubility", piece_buffer);
    }
    piece(piece_buffer, '^', input_buffer, 4);
    if (*piece_buffer) {
      fprintf(update_pipe, "%s^%s^%s^%s^last_validation_process^%s\n", station,
              measurement_date_string, measurement_time_string,
              "oxygen_solubility", piece_buffer);
    }
    piece(piece_buffer, '^', input_buffer, 5);
    if (*piece_buffer) {
      fprintf(update_pipe, "%s^%s^%s^%s^measurement_update_method^%s\n",
              station, measurement_date_string, measurement_time_string,
              "oxygen_solubility", piece_buffer);
    }
  }
  pclose(input_pipe);
  pclose(update_pipe);
}


x86 assembly (clang, -O0):
<update_validation_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0xdd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1060 <get_table_name@plt>
mov    %rax,-0xdc8(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0xdc8(%rbp),%rdx
lea    0xe59(%rip),%rsi
lea    0xe70(%rip),%rcx
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x420(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1070 <popen@plt>
mov    %rax,-0x430(%rbp)
lea    -0x830(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    0xe81(%rip),%rax
mov    %rax,-0x838(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x838(%rbp),%rcx
lea    -0x830(%rbp),%r8
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x420(%rbp),%rdi
lea    0xf19(%rip),%rsi
call   1070 <popen@plt>
mov    %rax,-0x428(%rbp)
lea    -0xc40(%rbp),%rdi
mov    -0x428(%rbp),%rsi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     1420 <update_validation_columns+0x2b0>
lea    -0xcc0(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
xor    %ecx,%ecx
call   1090 <piece@plt>
lea    -0xd40(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x1,%ecx
call   1090 <piece@plt>
lea    -0xdc0(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x2,%ecx
call   1090 <piece@plt>
cmpb   $0x0,-0xdc0(%rbp)
je     12f8 <update_validation_columns+0x188>
mov    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0xcc0(%rbp),%rcx
lea    -0xd40(%rbp),%r8
lea    -0xdc0(%rbp),%rax
lea    0xe6a(%rip),%rsi
lea    0xe88(%rip),%r9
mov    %rax,(%rsp)
call   1050 <fprintf@plt>
lea    -0xdc0(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x3,%ecx
call   1090 <piece@plt>
cmpb   $0x0,-0xdc0(%rbp)
je     1359 <update_validation_columns+0x1e9>
mov    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0xcc0(%rbp),%rcx
lea    -0xd40(%rbp),%r8
lea    -0xdc0(%rbp),%rax
lea    0xe40(%rip),%rsi
lea    0xe27(%rip),%r9
mov    %rax,(%rsp)
call   1050 <fprintf@plt>
lea    -0xdc0(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x4,%ecx
call   1090 <piece@plt>
cmpb   $0x0,-0xdc0(%rbp)
je     13ba <update_validation_columns+0x24a>
mov    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0xcc0(%rbp),%rcx
lea    -0xd40(%rbp),%r8
lea    -0xdc0(%rbp),%rax
lea    0xe06(%rip),%rsi
lea    0xdc6(%rip),%r9
mov    %rax,(%rsp)
call   1050 <fprintf@plt>
lea    -0xdc0(%rbp),%rdi
lea    -0xc40(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x5,%ecx
call   1090 <piece@plt>
cmpb   $0x0,-0xdc0(%rbp)
je     141b <update_validation_columns+0x2ab>
mov    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0xcc0(%rbp),%rcx
lea    -0xd40(%rbp),%r8
lea    -0xdc0(%rbp),%rax
lea    0xdcd(%rip),%rsi
lea    0xd65(%rip),%r9
mov    %rax,(%rsp)
call   1050 <fprintf@plt>
jmp    1243 <update_validation_columns+0xd3>
mov    -0x428(%rbp),%rdi
call   1040 <pclose@plt>
mov    -0x430(%rbp),%rdi
call   1040 <pclose@plt>
add    $0xdd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_validation_columns>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd98,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe6f(%rip),%rsi
call   1060 <get_table_name@plt>
lea    0xe6f(%rip),%rsi
lea    0xe86(%rip),%rcx
lea    0x990(%rsp),%rbp
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <sprintf@plt>
lea    0xe9d(%rip),%rsi
mov    %rbp,%rdi
call   1070 <popen@plt>
mov    %rax,%r13
lea    0xe8d(%rip),%rsi
lea    0x590(%rsp),%r12
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <sprintf@plt>
lea    0xf0e(%rip),%rsi
lea    0xe87(%rip),%rcx
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1080 <sprintf@plt>
lea    0xf44(%rip),%rsi
mov    %rbp,%rdi
call   1070 <popen@plt>
lea    0x190(%rsp),%rdi
mov    %rax,0x8(%rsp)
mov    %rax,%rsi
call   1030 <get_line@plt>
test   %rax,%rax
je     13a2 <update_validation_columns+0x232>
lea    0x110(%rsp),%r12
lea    0x190(%rsp),%rbx
lea    0x90(%rsp),%rbp
lea    0x10(%rsp),%r15
jmp    1276 <update_validation_columns+0x106>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    0x8(%rsp),%rsi
call   1030 <get_line@plt>
test   %rax,%rax
je     13a2 <update_validation_columns+0x232>
mov    %r12,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1090 <piece@plt>
mov    %rbp,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1090 <piece@plt>
mov    %r15,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
call   1090 <piece@plt>
cmpb   $0x0,0x10(%rsp)
je     12dc <update_validation_columns+0x16c>
mov    %r15,(%rsp)
mov    %r13,%rdi
lea    0xe8b(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
lea    0xea0(%rip),%r9
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x3,%ecx
call   1090 <piece@plt>
cmpb   $0x0,0x10(%rsp)
je     131b <update_validation_columns+0x1ab>
mov    %r15,(%rsp)
mov    %r13,%rdi
lea    0xe83(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
lea    0xe61(%rip),%r9
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x4,%ecx
call   1090 <piece@plt>
cmpb   $0x0,0x10(%rsp)
je     135a <update_validation_columns+0x1ea>
mov    %r15,(%rsp)
mov    %r13,%rdi
lea    0xe6b(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
lea    0xe22(%rip),%r9
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1090 <piece@plt>
cmpb   $0x0,0x10(%rsp)
je     1260 <update_validation_columns+0xf0>
mov    %r15,(%rsp)
mov    %r13,%rdi
lea    0xe50(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
lea    0xddf(%rip),%r9
call   1050 <fprintf@plt>
jmp    1260 <update_validation_columns+0xf0>
mov    0x8(%rsp),%rdi
call   1040 <pclose@plt>
mov    %r13,%rdi
call   1040 <pclose@plt>
add    $0xd98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"measurement\00"
@.str.1 = [30 x i8] c"update_statement.e %s %s '^^'\00"
@.str.2 = [51 x i8] c"station,measurement_date,measurement_time,datatype\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [29 x i8] c"%s and datatype = 'salinity'\00"
@.str.5 = [128 x i8] c"measurement_date,measurement_time,last_validation_date,last_person_validating,last_validation_process,measurement_update_method\00"
@.str.6 = [84 x i8] c"get_folder_data\09application=%s\09\09\09\09\09select=%s\09\09\09\09\09folder=measurement\09\09\09\09where=\22%s\22\09\09\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [37 x i8] c"%s^%s^%s^%s^last_validation_date^%s\0A\00"
@.str.9 = [18 x i8] c"oxygen_solubility\00"
@.str.10 = [39 x i8] c"%s^%s^%s^%s^last_person_validating^%s\0A\00"
@.str.11 = [40 x i8] c"%s^%s^%s^%s^last_validation_process^%s\0A\00"
@.str.12 = [42 x i8] c"%s^%s^%s^%s^measurement_update_method^%s\0A\00"
define void @update_validation_columns(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [1024 x i8]
%11 = alloca i8*
%12 = alloca [1024 x i8]
%13 = alloca [128 x i8]
%14 = alloca [128 x i8]
%15 = alloca [128 x i8]
%16 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%17 = load i8*, i8** %4
%18 = call i8* @get_table_name(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %18, i8** %16
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%20 = load i8*, i8** %16
%21 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%23 = call i32* @popen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %23, i32** %9
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%25 = load i8*, i8** %6
%26 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %24, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %25)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.5, i64 0, i64 0), i8** %11
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%28 = load i8*, i8** %4
%29 = load i8*, i8** %11
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%31 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %27, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.6, i64 0, i64 0), i8* %28, i8* %29, i8* %30)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%33 = call i32* @popen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %33, i32** %8
br label %34
34: ; preds = %101, %3
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%36 = load i32*, i32** %8
%37 = call i64 @get_line(i8* %35, i32* %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %102
39: ; preds = %34
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%42 = call i32 @piece(i8* %40, i8 signext 94, i8* %41, i32 0)
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%45 = call i32 @piece(i8* %43, i8 signext 94, i8* %44, i32 1)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%48 = call i32 @piece(i8* %46, i8 signext 94, i8* %47, i32 2)
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%50 = load i8, i8* %49
%51 = icmp ne i8 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %39
%53 = load i32*, i32** %9
%54 = load i8*, i8** %5
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%58 = call i32 @fprintf(i32* %53, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %54, i8* %55, i8* %56, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %52, %39
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%61 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%62 = call i32 @piece(i8* %60, i8 signext 94, i8* %61, i32 3)
%63 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%64 = load i8, i8* %63
%65 = icmp ne i8 %64, 0
br i1 %65, label %66, label %73
66: ; preds = %59
%67 = load i32*, i32** %9
%68 = load i8*, i8** %5
%69 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%72 = call i32 @fprintf(i32* %67, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i8* %68, i8* %69, i8* %70, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %66, %59
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%76 = call i32 @piece(i8* %74, i8 signext 94, i8* %75, i32 4)
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%78 = load i8, i8* %77
%79 = icmp ne i8 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %73
%81 = load i32*, i32** %9
%82 = load i8*, i8** %5
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%84 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%86 = call i32 @fprintf(i32* %81, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i8* %82, i8* %83, i8* %84, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %85)
br label %87
87: ; preds = %80, %73
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%90 = call i32 @piece(i8* %88, i8 signext 94, i8* %89, i32 5)
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%92 = load i8, i8* %91
%93 = icmp ne i8 %92, 0
br i1 %93, label %94, label %101
94: ; preds = %87
%95 = load i32*, i32** %9
%96 = load i8*, i8** %5
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%98 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%100 = call i32 @fprintf(i32* %95, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i8* %96, i8* %97, i8* %98, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %94, %87
br label %34
102: ; preds = %34
%103 = load i32*, i32** %8
%104 = call i32 @pclose(i32* %103)
%105 = load i32*, i32** %9
%106 = call i32 @pclose(i32* %105)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"measurement\00"
@.str.1 = [30 x i8] c"update_statement.e %s %s '^^'\00"
@.str.2 = [51 x i8] c"station,measurement_date,measurement_time,datatype\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [29 x i8] c"%s and datatype = 'salinity'\00"
@.str.5 = [128 x i8] c"measurement_date,measurement_time,last_validation_date,last_person_validating,last_validation_process,measurement_update_method\00"
@.str.6 = [84 x i8] c"get_folder_data\09application=%s\09\09\09\09\09select=%s\09\09\09\09\09folder=measurement\09\09\09\09where=\22%s\22\09\09\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [37 x i8] c"%s^%s^%s^%s^last_validation_date^%s\0A\00"
@.str.9 = [18 x i8] c"oxygen_solubility\00"
@.str.10 = [39 x i8] c"%s^%s^%s^%s^last_person_validating^%s\0A\00"
@.str.11 = [40 x i8] c"%s^%s^%s^%s^last_validation_process^%s\0A\00"
@.str.12 = [42 x i8] c"%s^%s^%s^%s^measurement_update_method^%s\0A\00"
define void @update_validation_columns(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = alloca [128 x i8]
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%16 = tail call i8* @get_table_name(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32* @popen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%20 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @.str.6, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%21 = call i32* @popen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%22 = call i64 @get_line(i8* %12, i32* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %53, label %24
24: ; preds = %3, %50
%25 = call i32 @piece(i8* %13, i8 signext 94, i8* %12, i32 0)
%26 = call i32 @piece(i8* %14, i8 signext 94, i8* %12, i32 1)
%27 = call i32 @piece(i8* %15, i8 signext 94, i8* %12, i32 2)
%28 = load i8, i8* %15
%29 = icmp eq i8 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %24
%31 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %1, i8* %13, i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %15)
br label %32
32: ; preds = %30, %24
%33 = call i32 @piece(i8* %15, i8 signext 94, i8* %12, i32 3)
%34 = load i8, i8* %15
%35 = icmp eq i8 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i8* %1, i8* %13, i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %15)
br label %38
38: ; preds = %36, %32
%39 = call i32 @piece(i8* %15, i8 signext 94, i8* %12, i32 4)
%40 = load i8, i8* %15
%41 = icmp eq i8 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i8* %1, i8* %13, i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %15)
br label %44
44: ; preds = %42, %38
%45 = call i32 @piece(i8* %15, i8 signext 94, i8* %12, i32 5)
%46 = load i8, i8* %15
%47 = icmp eq i8 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i8* %1, i8* %13, i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %15)
br label %50
50: ; preds = %48, %44
%51 = call i64 @get_line(i8* %12, i32* %21)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %24
53: ; preds = %50, %3
%54 = call i32 @pclose(i32* %21)
%55 = call i32 @pclose(i32* %18)
ret void
}