#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*/ Inst_Printf(char *, char *, char *, int);
void Move_Ret_To_Mem_L(char *name, int index) {
  Inst_Printf("addis",
              "r"
              "4"
              ",0,"
              "ha16("
              "_"
              "%s+%d"
              ")",
              name, index * 4);
  Inst_Printf("stw",
              "r"
              "3"
              ","
              "lo16("
              "_"
              "%s+%d"
              ")"
              "("
              "r"
              "4"
              ")",
              name, index * 4);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Mem_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
lea    0xed0(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <Inst_Printf@plt>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
lea    0xecb(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Mem_L>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%ebp
lea    0xedc(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <Inst_Printf@plt>
lea    0xedc(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"addis\00"
@.str.1 = [18 x i8] c"r4,0,ha16(_%s+%d)\00"
@.str.2 = [4 x i8] c"stw\00"
@.str.3 = [20 x i8] c"r3,lo16(_%s+%d)(r4)\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 4
%12 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"addis\00"
@.str.1 = [18 x i8] c"r4,0,ha16(_%s+%d)\00"
@.str.2 = [4 x i8] c"stw\00"
@.str.3 = [20 x i8] c"r3,lo16(_%s+%d)(r4)\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
%5 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %0, i32 %3)
ret void
}