#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*/ printf(char *, ...);
int /*<<< orphan*/ vcpfr_free();
int vcpfr_read_char(char *);
float vcpfr_read_float(char *);
int vcpfr_read_int(char *);
char *vcpfr_read_string(char *);
int /*<<< orphan*/ vcpfr_show_file_content();
int main() {
  printf("START property file reading and parsing test \n");
  vcpfr_show_file_content();
  int age = vcpfr_read_int("age");
  printf("Age: %d\n", age);
  float weight = vcpfr_read_float("weight");
  printf("Weight: %f\n", weight);
  int gender = vcpfr_read_char("gender");
  printf("Gender: %c\n", gender);
  char *name = vcpfr_read_string("name");
  printf("Name: %s\n", name);
  vcpfr_free();
  printf("END test \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <vcpfr_show_file_content@plt>
lea    0xe9b(%rip),%rdi
call   1030 <vcpfr_read_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
call   1070 <vcpfr_read_float@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
call   1040 <vcpfr_read_char@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
call   1090 <vcpfr_read_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <vcpfr_free@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeba(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <vcpfr_show_file_content@plt>
lea    0xe65(%rip),%rdi
call   1030 <vcpfr_read_int@plt>
lea    0xe5d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe56(%rip),%rdi
call   1080 <vcpfr_read_float@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1040 <vcpfr_read_char@plt>
lea    0xe46(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe42(%rip),%rdi
call   10a0 <vcpfr_read_string@plt>
lea    0xe3b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1090 <vcpfr_free@plt>
lea    0xe5b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"START property file reading and parsing test \0A\00"
@.str.1 = [4 x i8] c"age\00"
@.str.2 = [9 x i8] c"Age: %d\0A\00"
@.str.3 = [7 x i8] c"weight\00"
@.str.4 = [12 x i8] c"Weight: %f\0A\00"
@.str.5 = [7 x i8] c"gender\00"
@.str.6 = [12 x i8] c"Gender: %c\0A\00"
@.str.7 = [5 x i8] c"name\00"
@.str.8 = [10 x i8] c"Name: %s\0A\00"
@.str.9 = [11 x i8] c"END test \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @vcpfr_show_file_content()
%7 = call i32 @vcpfr_read_int(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call float @vcpfr_read_float(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store float %10, float* %2
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), double %12)
%14 = call i32 @vcpfr_read_char(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = call i8* @vcpfr_read_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %18)
%20 = call i32 (...) @vcpfr_free()
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"age\00"
@.str.2 = [9 x i8] c"Age: %d\0A\00"
@.str.3 = [7 x i8] c"weight\00"
@.str.4 = [12 x i8] c"Weight: %f\0A\00"
@.str.5 = [7 x i8] c"gender\00"
@.str.6 = [12 x i8] c"Gender: %c\0A\00"
@.str.7 = [5 x i8] c"name\00"
@.str.8 = [10 x i8] c"Name: %s\0A\00"
@str = [46 x i8] c"START property file reading and parsing test \00"
@str.10 = [10 x i8] c"END test \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @vcpfr_show_file_content()
%3 = tail call i32 @vcpfr_read_int(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call float @vcpfr_read_float(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), double %6)
%8 = tail call i32 @vcpfr_read_char(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %8)
%10 = tail call i8* @vcpfr_read_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %10)
%12 = tail call i32 (...) @vcpfr_free()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}