#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*/ PadToX(char *, char *, int, char *);
char *lr_eval_string(char *);
int /*<<< orphan*/ lr_output_message(char *, char *);
Action() {
  char *cShortValue = "123";
  char cPaddedValue[8] = "";
  int iShortValue = 123;
  int i;
  lr_output_message("Short value is %s", cShortValue);
  PadToX(cShortValue, "pPaddedParameter", 8, "0");
  lr_output_message("Padded value is %s", lr_eval_string("{pPaddedParameter}"));
  PadToX(cShortValue, "pPaddedParameter", 8, "x");
  lr_output_message("Padded value is %s", lr_eval_string("{pPaddedParameter}"));
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
movl   $0x7b,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1040 <lr_output_message@plt>
mov    -0x8(%rbp),%rdi
lea    0xe91(%rip),%rsi
mov    $0x8,%edx
lea    0xe96(%rip),%rcx
call   1060 <PadToX@plt>
lea    0xe9f(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rsi
lea    0xe7d(%rip),%rdi
call   1040 <lr_output_message@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x8,%edx
lea    0xe87(%rip),%rcx
call   1060 <PadToX@plt>
lea    0xe68(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %rax,%rsi
lea    0xe46(%rip),%rdi
call   1040 <lr_output_message@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xeba(%rip),%rbx
mov    %rbx,%rsi
call   1040 <lr_output_message@plt>
lea    0xec1(%rip),%r14
lea    0xecb(%rip),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1050 <PadToX@plt>
lea    0xec9(%rip),%r15
mov    %r15,%rdi
call   1030 <lr_eval_string@plt>
lea    0xea7(%rip),%r12
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <lr_output_message@plt>
lea    0xebb(%rip),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1050 <PadToX@plt>
mov    %r15,%rdi
call   1030 <lr_eval_string@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <lr_output_message@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [18 x i8] c"Short value is %s\00"
@.str.2 = [17 x i8] c"pPaddedParameter\00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [19 x i8] c"Padded value is %s\00"
@.str.5 = [19 x i8] c"{pPaddedParameter}\00"
@.str.6 = [2 x i8] c"x\00"
define i32 @Action() {
%1 = alloca i8*
%2 = alloca [8 x i8]
%3 = alloca i32
%4 = alloca i32
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = bitcast [8 x i8]* %2 to i8*
store i32 123, i32* %3
%6 = load i8*, i8** %1
%7 = call i32 @lr_output_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @PadToX(i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%10 = call i8* @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %1
%13 = call i32 @PadToX(i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%14 = call i8* @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [18 x i8] c"Short value is %s\00"
@.str.2 = [17 x i8] c"pPaddedParameter\00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [19 x i8] c"Padded value is %s\00"
@.str.5 = [19 x i8] c"{pPaddedParameter}\00"
@.str.6 = [2 x i8] c"x\00"
define i32 @Action() {
%1 = tail call i32 @lr_output_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PadToX(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%5 = tail call i32 @PadToX(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%6 = tail call i8* @lr_eval_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %6)
ret i32 0
}