#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 *, char *, ...);
char *get_sys_string(char *application_name, char *station, char *datatype) {
  static char sys_string[1024];
  char where_clause[1024];
  char *select;
  select = "measurement_date,measurement_time";
  sprintf(where_clause, "station = '%s' and datatype = '%s'", station,
          datatype);
  sprintf(sys_string,
          "get_folder_data	application=%s			"
          "			select=%s			"
          "			folder=measurement		"
          "			where=\"%s\"			",
          application_name, select, where_clause);
  return sys_string;
}


x86 assembly (clang, -O0):
<get_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdx
mov    -0x428(%rbp),%rcx
lea    -0x420(%rbp),%r8
lea    0x2ed5(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ec0(%rip),%rax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sys_string>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xef6(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x2f00(%rip),%r15
lea    0xefe(%rip),%rsi
lea    0xeb2(%rip),%rcx
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %r15,%rax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@get_sys_string.sys_string = internal global [1024 x i8] zeroinitializer
@.str = [34 x i8] c"measurement_date,measurement_time\00"
@.str.1 = [35 x i8] c"station = '%s' and datatype = '%s'\00"
@.str.2 = [88 x i8] c"get_folder_data\09application=%s\09\09\09\09\09\09select=%s\09\09\09\09\09\09folder=measurement\09\09\09\09\09where=\22%s\22\09\09\09\00"
define i8* @get_sys_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %8
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_sys_string.sys_string, i64 0, i64 0), i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %14, i8* %15)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_sys_string.sys_string, i64 0, i64 0)
}

LLVM IR (-O2):
@get_sys_string.sys_string = internal global [1024 x i8] zeroinitializer
@.str = [34 x i8] c"measurement_date,measurement_time\00"
@.str.1 = [35 x i8] c"station = '%s' and datatype = '%s'\00"
@.str.2 = [88 x i8] c"get_folder_data\09application=%s\09\09\09\09\09\09select=%s\09\09\09\09\09\09folder=measurement\09\09\09\09\09where=\22%s\22\09\09\09\00"
define i8* @get_sys_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_sys_string.sys_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_sys_string.sys_string, i64 0, i64 0)
}