#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*/ int_fast64_t;

/* Variables and functions */
int /*<<< orphan*/ FETCH_MEMORY(int /*<<< orphan*/ *);
int /*<<< orphan*/ asprintf(char **, char *, char *, int /*<<< orphan*/);
void CONFIG_MEMORY(char *config_result[]) {
  int_fast64_t MemInfo[3];
  char *config_zero;
  FETCH_MEMORY(MemInfo);
  asprintf(&config_zero, "%s%ld", "graph_args --base 1024 -l 0 --upper-limit ",
           MemInfo[0]);
  config_result[0] = config_zero;
  config_result[1] = "graph_vlabel Bytes";
  config_result[2] = "graph_title Memory usage";
  config_result[3] = "graph_category system";
  config_result[4] = "graph_info This graph shows this machine memory.";
  config_result[5] = "graph_order used free";
  config_result[6] = "used.label used";
  config_result[7] = "used.draw STACK";
  config_result[8] = "used.info Used memory.";
  config_result[9] = "free.label free";
  config_result[10] = "free.draw STACK";
  config_result[11] = "free.info Free memory.";
}


x86 assembly (clang, -O0):
<CONFIG_MEMORY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <FETCH_MEMORY@plt>
mov    -0x14(%rbp),%ecx
lea    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
lea    0xebc(%rip),%rdx
call   1030 <asprintf@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
lea    0xecc(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
lea    0xed0(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
lea    0xeda(%rip),%rcx
mov    %rcx,0x18(%rax)
mov    -0x8(%rbp),%rax
lea    0xee1(%rip),%rcx
mov    %rcx,0x20(%rax)
mov    -0x8(%rbp),%rax
lea    0xf03(%rip),%rcx
mov    %rcx,0x28(%rax)
mov    -0x8(%rbp),%rax
lea    0xf0a(%rip),%rcx
mov    %rcx,0x30(%rax)
mov    -0x8(%rbp),%rax
lea    0xf0b(%rip),%rcx
mov    %rcx,0x38(%rax)
mov    -0x8(%rbp),%rax
lea    0xf0c(%rip),%rcx
mov    %rcx,0x40(%rax)
mov    -0x8(%rbp),%rax
lea    0xf14(%rip),%rcx
mov    %rcx,0x48(%rax)
mov    -0x8(%rbp),%rax
lea    0xf15(%rip),%rcx
mov    %rcx,0x50(%rax)
mov    -0x8(%rbp),%rax
lea    0xf16(%rip),%rcx
mov    %rcx,0x58(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONFIG_MEMORY>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
lea    0x14(%rsp),%rdi
call   1040 <FETCH_MEMORY@plt>
mov    0x14(%rsp),%ecx
lea    0xec3(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0x8(%rsp),%rdi
call   1030 <asprintf@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
lea    0xed4(%rip),%rax
mov    %rax,0x8(%rbx)
lea    0xedc(%rip),%rax
mov    %rax,0x10(%rbx)
lea    0xeea(%rip),%rax
mov    %rax,0x18(%rbx)
lea    0xef5(%rip),%rax
mov    %rax,0x20(%rbx)
lea    0xf1b(%rip),%rax
mov    %rax,0x28(%rbx)
lea    0xf26(%rip),%rax
mov    %rax,0x30(%rbx)
lea    0xf2b(%rip),%rax
mov    %rax,0x38(%rbx)
lea    0xf30(%rip),%rax
mov    %rax,0x40(%rbx)
lea    0xf3c(%rip),%rax
mov    %rax,0x48(%rbx)
lea    0xf41(%rip),%rax
mov    %rax,0x50(%rbx)
lea    0xf46(%rip),%rax
mov    %rax,0x58(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s%ld\00"
@.str.1 = [43 x i8] c"graph_args --base 1024 -l 0 --upper-limit \00"
@.str.2 = [19 x i8] c"graph_vlabel Bytes\00"
@.str.3 = [25 x i8] c"graph_title Memory usage\00"
@.str.4 = [22 x i8] c"graph_category system\00"
@.str.5 = [49 x i8] c"graph_info This graph shows this machine memory.\00"
@.str.6 = [22 x i8] c"graph_order used free\00"
@.str.7 = [16 x i8] c"used.label used\00"
@.str.8 = [16 x i8] c"used.draw STACK\00"
@.str.9 = [23 x i8] c"used.info Used memory.\00"
@.str.10 = [16 x i8] c"free.label free\00"
@.str.11 = [16 x i8] c"free.draw STACK\00"
@.str.12 = [23 x i8] c"free.info Free memory.\00"
define void @CONFIG_MEMORY(i8** %0) {
%2 = alloca i8**
%3 = alloca [3 x i32]
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 @FETCH_MEMORY(i32* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = load i32, i32* %7
%9 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 0
store i8* %10, i8** %12
%13 = load i8**, i8*** %2
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %14
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8** %16
%17 = load i8**, i8*** %2
%18 = getelementptr inbounds i8*, i8** %17, i64 3
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8** %18
%19 = load i8**, i8*** %2
%20 = getelementptr inbounds i8*, i8** %19, i64 4
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8** %20
%21 = load i8**, i8*** %2
%22 = getelementptr inbounds i8*, i8** %21, i64 5
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %22
%23 = load i8**, i8*** %2
%24 = getelementptr inbounds i8*, i8** %23, i64 6
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8** %24
%25 = load i8**, i8*** %2
%26 = getelementptr inbounds i8*, i8** %25, i64 7
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8** %26
%27 = load i8**, i8*** %2
%28 = getelementptr inbounds i8*, i8** %27, i64 8
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8** %28
%29 = load i8**, i8*** %2
%30 = getelementptr inbounds i8*, i8** %29, i64 9
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8** %30
%31 = load i8**, i8*** %2
%32 = getelementptr inbounds i8*, i8** %31, i64 10
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8** %32
%33 = load i8**, i8*** %2
%34 = getelementptr inbounds i8*, i8** %33, i64 11
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8** %34
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%ld\00"
@.str.1 = [43 x i8] c"graph_args --base 1024 -l 0 --upper-limit \00"
@.str.2 = [19 x i8] c"graph_vlabel Bytes\00"
@.str.3 = [25 x i8] c"graph_title Memory usage\00"
@.str.4 = [22 x i8] c"graph_category system\00"
@.str.5 = [49 x i8] c"graph_info This graph shows this machine memory.\00"
@.str.6 = [22 x i8] c"graph_order used free\00"
@.str.7 = [16 x i8] c"used.label used\00"
@.str.8 = [16 x i8] c"used.draw STACK\00"
@.str.9 = [23 x i8] c"used.info Used memory.\00"
@.str.10 = [16 x i8] c"free.label free\00"
@.str.11 = [16 x i8] c"free.draw STACK\00"
@.str.12 = [23 x i8] c"free.info Free memory.\00"
define void @CONFIG_MEMORY(i8** nocapture writeonly %0) {
%2 = alloca [3 x i32]
%3 = alloca i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = bitcast i8** %3 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @FETCH_MEMORY(i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %3
store i8* %10, i8** %0
%11 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds i8*, i8** %0, i64 3
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds i8*, i8** %0, i64 4
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds i8*, i8** %0, i64 5
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds i8*, i8** %0, i64 6
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds i8*, i8** %0, i64 7
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds i8*, i8** %0, i64 8
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds i8*, i8** %0, i64 9
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds i8*, i8** %0, i64 10
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds i8*, i8** %0, i64 11
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8** %21
ret void
}