#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*/ lr_save_string(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
Action() {
  int iIteration;
  char cStringName[64];
  lr_save_string("One", "sColumn_1");
  lr_save_string("Two", "sColumn_2");
  lr_save_string("Three", "sColumn_3");
  lr_save_string("Four", "sColumn_4");
  lr_save_string("Five", "sColumn_5");
  lr_save_string("Six", "sColumn_6");
  iIteration = atoi(lr_eval_string("{pIteration}"));
  sprintf(cStringName, "{sColumn_%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    0xea1(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe9c(%rip),%rdi
lea    0xe99(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe97(%rip),%rdi
lea    0xe96(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe94(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe90(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe8c(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe87(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe76(%rip),%rsi
call   1070 <sprintf@plt>
lea    0xe5d(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rsi
lea    -0x50(%rbp),%rdx
lea    0xe64(%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    0xe65(%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    0xea2(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe9d(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe98(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe95(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe91(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe8d(%rip),%rdi
lea    0xe8a(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xe88(%rip),%r14
mov    %r14,%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
lea    0xe7e(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1070 <sprintf@plt>
mov    %r14,%rdi
call   1030 <lr_eval_string@plt>
lea    0xe6f(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <lr_output_message@plt>
mov    %rbx,%rdi
call   1030 <lr_eval_string@plt>
lea    0xe7a(%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 = [4 x i8] c"One\00"
@.str.1 = [10 x i8] c"sColumn_1\00"
@.str.2 = [4 x i8] c"Two\00"
@.str.3 = [10 x i8] c"sColumn_2\00"
@.str.4 = [6 x i8] c"Three\00"
@.str.5 = [10 x i8] c"sColumn_3\00"
@.str.6 = [5 x i8] c"Four\00"
@.str.7 = [10 x i8] c"sColumn_4\00"
@.str.8 = [5 x i8] c"Five\00"
@.str.9 = [10 x i8] c"sColumn_5\00"
@.str.10 = [4 x i8] c"Six\00"
@.str.11 = [10 x i8] c"sColumn_6\00"
@.str.12 = [13 x i8] c"{pIteration}\00"
@.str.13 = [13 x i8] c"{sColumn_%d}\00"
@.str.14 = [37 x i8] c"Iteration is [%s], String used is %s\00"
@.str.15 = [20 x i8] c"Value of %s is [%s]\00"
define i32 @Action() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @lr_save_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%7 = call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%8 = call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%9 = call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %1
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%12 = load i32, i32* %1
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %12)
%14 = call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%16 = call i32 @lr_output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0), i8* %14, i8* %15)
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%19 = call i8* @lr_eval_string(i8* %18)
%20 = call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i8* %17, i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"One\00"
@.str.1 = [10 x i8] c"sColumn_1\00"
@.str.2 = [4 x i8] c"Two\00"
@.str.3 = [10 x i8] c"sColumn_2\00"
@.str.4 = [6 x i8] c"Three\00"
@.str.5 = [10 x i8] c"sColumn_3\00"
@.str.6 = [5 x i8] c"Four\00"
@.str.7 = [10 x i8] c"sColumn_4\00"
@.str.8 = [5 x i8] c"Five\00"
@.str.9 = [10 x i8] c"sColumn_5\00"
@.str.10 = [4 x i8] c"Six\00"
@.str.11 = [10 x i8] c"sColumn_6\00"
@.str.12 = [13 x i8] c"{pIteration}\00"
@.str.13 = [13 x i8] c"{sColumn_%d}\00"
@.str.14 = [37 x i8] c"Iteration is [%s], String used is %s\00"
@.str.15 = [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 i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%7 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%8 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%9 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%10 = tail call i32 @atoi(i8* %9)
%11 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %10)
%12 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%13 = call i32 @lr_output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0), i8* %12, i8* %2)
%14 = call i8* @lr_eval_string(i8* %2)
%15 = call i32 @lr_output_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i8* %2, i8* %14)
ret i32 0
}