#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 atoi(int);
int lr_eval_string(char *);
int /*<<< orphan*/ lr_output_message(char *, int);
int /*<<< orphan*/ lr_save_string(char *, char *);
ConvertParamToInteger() {
  int Number;
  lr_save_string("1234", "NumericParameter");
  lr_output_message("[%s]", lr_eval_string("{NumericParameter}"));
  Number = atoi(lr_eval_string("{NumericParameter}"));
  lr_output_message("New integer is [%i]", Number);
  return 0;
}


x86 assembly (clang, -O0):
<ConvertParamToInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xeb9(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <lr_output_message@plt>
lea    0xe9f(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1040 <lr_output_message@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertParamToInteger>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <lr_eval_string@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <lr_output_message@plt>
mov    %rbx,%rdi
call   1030 <lr_eval_string@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1040 <lr_output_message@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
@.str.1 = [17 x i8] c"NumericParameter\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [19 x i8] c"{NumericParameter}\00"
@.str.4 = [20 x i8] c"New integer is [%i]\00"
define i32 @ConvertParamToInteger() {
%1 = alloca i32
%2 = call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @lr_output_message(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = call i32 @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @atoi(i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
@.str.1 = [17 x i8] c"NumericParameter\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [19 x i8] c"{NumericParameter}\00"
@.str.4 = [20 x i8] c"New integer is [%i]\00"
define i32 @ConvertParamToInteger() {
%1 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @lr_output_message(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = tail call i32 @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @atoi(i32 %4)
%6 = tail call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %5)
ret i32 0
}