#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*/ free(char *);
char *ice_config_get(char *, char *);
char *ice_config_load(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char *content_test = ice_config_load("config_map.cfg");
  puts(content_test);
  char *var1_test = ice_config_get("MONITOR=", content_test);
  printf("Example get MONITOR \n Result:%s \n", var1_test);
  free(var1_test);
  var1_test = NULL;
  free(content_test);
  content_test = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <ice_config_load@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <puts@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1060 <ice_config_get@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
call   1040 <ice_config_load@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <puts@plt>
lea    0xe9d(%rip),%rdi
mov    %r14,%rsi
call   1060 <ice_config_get@plt>
mov    %rax,%rbx
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"config_map.cfg\00"
@.str.1 = [9 x i8] c"MONITOR=\00"
@.str.2 = [34 x i8] c"Example get MONITOR \0A Result:%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @ice_config_load(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @puts(i8* %5)
%7 = load i8*, i8** %2
%8 = call i8* @ice_config_get(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
store i8* null, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
store i8* null, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"config_map.cfg\00"
@.str.1 = [9 x i8] c"MONITOR=\00"
@.str.2 = [34 x i8] c"Example get MONITOR \0A Result:%s \0A\00"
define i32 @main() {
%1 = tail call i8* @ice_config_load(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
%3 = tail call i8* @ice_config_get(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
%6 = tail call i32 @free(i8* %1)
ret i32 0
}