void measurement_update(char *station, char *datatype, char *date, char *time,
                        double value) {
  char sys_string[4096];
  sprintf(sys_string,
          "echo \"update %s				 "
          "      set measurement_value = %lf		 "
          "      where station = '%s'			 "
          "	 and datatype = '%s'			 "
          "	 and measurement_date = '%s'		 "
          "	 and measurement_time = '%s';\"		|"
          "sql.e 2>&1					|"
          "html_paragraph_wrapper.e		 	 ",
          "measurement", value, station, datatype, date, time);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<measurement_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
lea    -0x1030(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xe9d(%rip),%rsi
lea    0xf75(%rip),%rdx
mov    %rax,(%rsp)
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    -0x1030(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
cmp    $0x0,%eax
je     1191 <measurement_update+0x71>
jmp    1191 <measurement_update+0x71>
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_update>:
push   %rbx
sub    $0x1010,%rsp
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rax
mov    %rcx,(%rsp)
lea    0xec4(%rip),%rsi
lea    0xf9c(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rcx
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
add    $0x1010,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [223 x i8] c"echo \22update %s\09\09\09\09 set measurement_value = %lf\09\09 where station = '%s'\09\09\09 \09 and datatype = '%s'\09\09\09 \09 and measurement_date = '%s'\09\09 \09 and measurement_time = '%s';\22\09\09|sql.e 2>&1\09\09\09\09\09|html_paragraph_wrapper.e\09\09 \09 \00"
@.str.1 = [12 x i8] c"measurement\00"
define void @measurement_update(i8* %0, i8* %1, i8* %2, i8* %3, double %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca double
%11 = alloca [4096 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store double %4, double* %10
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%13 = load double, double* %10
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %13, i8* %14, i8* %15, i8* %16, i8* %17)
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %5
br label %23
23: ; preds = %22, %5
ret void
}

LLVM IR (-O2):
@.str = [223 x i8] c"echo \22update %s\09\09\09\09 set measurement_value = %lf\09\09 where station = '%s'\09\09\09 \09 and datatype = '%s'\09\09\09 \09 and measurement_date = '%s'\09\09 \09 and measurement_time = '%s';\22\09\09|sql.e 2>&1\09\09\09\09\09|html_paragraph_wrapper.e\09\09 \09 \00"
@.str.1 = [12 x i8] c"measurement\00"
define void @measurement_update(i8* %0, i8* %1, i8* %2, i8* %3, double %4) {
%6 = alloca [4096 x i8]
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %4, i8* %0, i8* %1, i8* %2, i8* %3)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %7)
ret void
}