#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*/ sprintf(char *, char *, char *, ...);
scalar_t__ system(char *);
void cr10_parse(char *application_name, char *filename, char *station) {
  char replace_cr10_error_with_null_process[1024];
  char sys_string[4096];
  sprintf(replace_cr10_error_with_null_process, "%s",
          "sed 's/,6999\\.0*$/,/' | sed 's/,-6999\\.0*$/,/'");
  sprintf(sys_string,
          "cat %s						      	     |"
          "grep -v '^$'						     |"
          "dayofyear2date.e ',' %d %d y 			  	     |"
          "piece_inverse.e 1 ','					     |"
          "prepend_zeros_to_piece.e ',' %d 4			     |"
          "apply_position_translation_to_record %s %s \',\' 	     |"
          "validate_midnight 2 3 ','				     |"
          "%s							     |"
          "cat							      ",
          filename, 1, 2, 2, application_name, station,
          replace_cr10_error_with_null_process);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<cr10_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1440,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xebb(%rip),%rsi
lea    0xeb7(%rip),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x1420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r11
mov    -0x18(%rbp),%r10
lea    -0x420(%rbp),%rax
lea    0xebe(%rip),%rsi
mov    $0x1,%ecx
mov    $0x2,%r9d
mov    %r9d,%r8d
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x1420(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     11b2 <cr10_parse+0x92>
jmp    11b2 <cr10_parse+0x92>
add    $0x1440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cr10_parse>:
push   %r14
push   %rbx
sub    $0x1408,%rsp
mov    %rdx,%r10
mov    %rsi,%rdx
mov    %rdi,%r11
movups 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xece(%rip),%xmm0
movups %xmm0,0x1f(%rsp)
sub    $0x8,%rsp
lea    0x8(%rsp),%r14
lea    0xec9(%rip),%rsi
lea    0x408(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
push   %r14
push   %r10
push   %r11
call   1040 <sprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x1408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [47 x i8] c"sed 's/,6999\\.0*$/,/' | sed 's/,-6999\\.0*$/,/'\00"
@.str.2 = [285 x i8] c"cat %s\09\09\09\09\09\09 \09 |grep -v '^$'\09\09\09\09\09\09 |dayofyear2date.e ',' %d %d y \09\09\09 \09 |piece_inverse.e 1 ','\09\09\09\09\09 |prepend_zeros_to_piece.e ',' %d 4\09\09\09 |apply_position_translation_to_record %s %s ',' \09 |validate_midnight 2 3 ','\09\09\09\09 |%s\09\09\09\09\09\09\09 |cat\09\09\09\09\09\09\09 \00"
define void @cr10_parse(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca [4096 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32 1, i32 2, i32 2, i8* %13, i8* %14, i8* %15)
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%18 = call i64 @system(i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %3
br label %21
21: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"sed 's/,6999\\.0*$/,/' | sed 's/,-6999\\.0*$/,/'\00"
@.str.2 = [285 x i8] c"cat %s\09\09\09\09\09\09 \09 |grep -v '^$'\09\09\09\09\09\09 |dayofyear2date.e ',' %d %d y \09\09\09 \09 |piece_inverse.e 1 ','\09\09\09\09\09 |prepend_zeros_to_piece.e ',' %d 4\09\09\09 |apply_position_translation_to_record %s %s ',' \09 |validate_midnight 2 3 ','\09\09\09\09 |%s\09\09\09\09\09\09\09 |cat\09\09\09\09\09\09\09 \00"
define void @cr10_parse(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [4096 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%8 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([285 x i8], [285 x i8]* @.str.2, i64 0, i64 0), i8* %1, i32 1, i32 2, i32 2, i8* %0, i8* %2, i8* %6)
%9 = call i64 @system(i8* %7)
ret void
}