#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 */
char *get_heading(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *get_heading_sys_string(char *application_name, char *datatype,
                             char *output_filename, char *units_converted) {
  static char sys_string[1024];
  char *heading;
  heading = get_heading(application_name, datatype, units_converted);
  sprintf(sys_string, "echo \"%s\" >> %s", heading, output_filename);
  return sys_string;
}


x86 assembly (clang, -O0):
<get_heading_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <get_heading@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0x2ee4(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ed1(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_heading_sys_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rcx,%rdx
call   1030 <get_heading@plt>
lea    0x2f0a(%rip),%r14
lea    0xec3(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_heading_sys_string.sys_string = internal global [1024 x i8] zeroinitializer
@.str = [16 x i8] c"echo \22%s\22 >> %s\00"
define i8* @get_heading_sys_string(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = call i8* @get_heading(i8* %10, i8* %11, i8* %12)
store i8* %13, i8** %9
%14 = load i8*, i8** %9
%15 = load i8*, i8** %7
%16 = call i32 @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_heading_sys_string.sys_string, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_heading_sys_string.sys_string, i64 0, i64 0)
}

LLVM IR (-O2):
@get_heading_sys_string.sys_string = internal global [1024 x i8] zeroinitializer
@.str = [16 x i8] c"echo \22%s\22 >> %s\00"
define i8* @get_heading_sys_string(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* @get_heading(i8* %0, i8* %1, i8* %3)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_heading_sys_string.sys_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %2)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_heading_sys_string.sys_string, i64 0, i64 0)
}