#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(char *);
char *lr_eval_string(char *);
int /*<<< orphan*/ lr_output_message(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
Action() {
  int iIteration;
  char cStringName[64];
  iIteration = atoi(lr_eval_string("{pIteration}"));
  sprintf(cStringName, "{pColumn_%d}", iIteration);
  lr_output_message("Iteration is [%s], String used is %s",
                    lr_eval_string("{pIteration}"), cStringName);
  lr_output_message("Value of %s is [%s]", cStringName,
                    lr_eval_string(cStringName));
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea0(%rip),%rsi
call   1060 <sprintf@plt>
lea    0xe87(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rsi
lea    -0x50(%rbp),%rdx
lea    0xe8e(%rip),%rdi
call   1040 <lr_output_message@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <lr_eval_string@plt>
mov    -0x58(%rbp),%rsi
mov    %rax,%rdx
lea    0xe8f(%rip),%rdi
call   1040 <lr_output_message@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rdi
call   1050 <atoi@plt>
lea    0xea8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1030 <lr_eval_string@plt>
lea    0xe99(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <lr_output_message@plt>
mov    %rbx,%rdi
call   1030 <lr_eval_string@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <lr_output_message@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"{pIteration}\00"
@.str.1 = [13 x i8] c"{pColumn_%d}\00"
@.str.2 = [37 x i8] c"Iteration is [%s], String used is %s\00"
@.str.3 = [20 x i8] c"Value of %s is [%s]\00"
define i32 @Action() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @atoi(i8* %3)
store i32 %4, i32* %1
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* %1
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = call i32 @lr_output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%13 = call i8* @lr_eval_string(i8* %12)
%14 = call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %11, i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"{pIteration}\00"
@.str.1 = [13 x i8] c"{pColumn_%d}\00"
@.str.2 = [37 x i8] c"Iteration is [%s], String used is %s\00"
@.str.3 = [20 x i8] c"Value of %s is [%s]\00"
define i32 @Action() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @atoi(i8* %3)
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @lr_output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %2)
%8 = call i8* @lr_eval_string(i8* %2)
%9 = call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %2, i8* %8)
ret i32 0
}