#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*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
char *testmem(char *, int);
void memprmulti() {
  int i, j;
  const char *p, *q;
  unsigned char b[2][0x100];
  for (i = 0; i < sizeof b / sizeof b[0]; ++i)
    for (j = 0; j < sizeof b[i] / sizeof b[i][0]; ++j)
      b[i][j] = i + j;
  p = testmem((char *)b[0], sizeof b[0]);
  q = testmem((char *)b[1], sizeof b[1]);
  fprintf(stderr, "[\n%s]\n[\n%s]\n", p, q);
}


x86 assembly (clang, -O0):
<memprmulti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x2,%rax
jae    1199 <memprmulti+0x79>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x100,%rax
jae    1186 <memprmulti+0x66>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %al,%dl
movslq -0x4(%rbp),%rcx
lea    -0x220(%rbp),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <memprmulti+0x27>
jmp    118b <memprmulti+0x6b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <memprmulti+0x12>
lea    -0x220(%rbp),%rdi
mov    $0x100,%esi
call   1040 <testmem@plt>
mov    %rax,-0x10(%rbp)
lea    -0x220(%rbp),%rdi
add    $0x100,%rdi
mov    $0x100,%esi
call   1040 <testmem@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe1e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memprmulti>:
push   %r14
push   %rbx
sub    $0x208,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xef1(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
lea    0x100(%rsp),%r14
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xef1(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xefb(%rip),%xmm0
movaps %xmm0,0x1b0(%rsp)
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x1c0(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,0x1d0(%rsp)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x1e0(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x1f0(%rsp)
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <testmem@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <testmem@plt>
mov    0x2cc3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeda(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"[\0A%s]\0A[\0A%s]\0A\00"
define void @memprmulti() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2 x [256 x i8]]
store i32 0, i32* %1
br label %6
6: ; preds = %30, %0
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 2
br i1 %9, label %10, label %33
10: ; preds = %6
store i32 0, i32* %2
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp ult i64 %13, 256
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
%19 = trunc i32 %18 to i8
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %5, i64 0, i64 %21
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 %24
store i8 %19, i8* %25
br label %26
26: ; preds = %15
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %11
29: ; preds = %11
br label %30
30: ; preds = %29
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %6
33: ; preds = %6
%34 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %5, i64 0, i64 0
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %34, i64 0, i64 0
%36 = call i8* @testmem(i8* %35, i32 256)
store i8* %36, i8** %3
%37 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %5, i64 0, i64 1
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %37, i64 0, i64 0
%39 = call i8* @testmem(i8* %38, i32 256)
store i8* %39, i8** %4
%40 = load i32, i32* @stderr
%41 = load i8*, i8** %3
%42 = load i8*, i8** %4
%43 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %41, i8* %42)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"[\0A%s]\0A[\0A%s]\0A\00"
define void @memprmulti() {
%1 = alloca [2 x [256 x i8]]
%2 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [2 x [256 x i8]]* %1 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %3
%4 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 16
%5 = bitcast i8* %4 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %5
%6 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 32
%7 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, <16 x i8>* %7
%8 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 48
%9 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, <16 x i8>* %9
%10 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 64
%11 = bitcast i8* %10 to <16 x i8>*
store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, <16 x i8>* %11
%12 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 80
%13 = bitcast i8* %12 to <16 x i8>*
store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, <16 x i8>* %13
%14 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 96
%15 = bitcast i8* %14 to <16 x i8>*
store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, <16 x i8>* %15
%16 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 112
%17 = bitcast i8* %16 to <16 x i8>*
store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, <16 x i8>* %17
%18 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 128
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> <i8 -128, i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113>, <16 x i8>* %19
%20 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 144
%21 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 -112, i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97>, <16 x i8>* %21
%22 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 160
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> <i8 -96, i8 -95, i8 -94, i8 -93, i8 -92, i8 -91, i8 -90, i8 -89, i8 -88, i8 -87, i8 -86, i8 -85, i8 -84, i8 -83, i8 -82, i8 -81>, <16 x i8>* %23
%24 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 176
%25 = bitcast i8* %24 to <16 x i8>*
store <16 x i8> <i8 -80, i8 -79, i8 -78, i8 -77, i8 -76, i8 -75, i8 -74, i8 -73, i8 -72, i8 -71, i8 -70, i8 -69, i8 -68, i8 -67, i8 -66, i8 -65>, <16 x i8>* %25
%26 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 192
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> <i8 -64, i8 -63, i8 -62, i8 -61, i8 -60, i8 -59, i8 -58, i8 -57, i8 -56, i8 -55, i8 -54, i8 -53, i8 -52, i8 -51, i8 -50, i8 -49>, <16 x i8>* %27
%28 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 208
%29 = bitcast i8* %28 to <16 x i8>*
store <16 x i8> <i8 -48, i8 -47, i8 -46, i8 -45, i8 -44, i8 -43, i8 -42, i8 -41, i8 -40, i8 -39, i8 -38, i8 -37, i8 -36, i8 -35, i8 -34, i8 -33>, <16 x i8>* %29
%30 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 224
%31 = bitcast i8* %30 to <16 x i8>*
store <16 x i8> <i8 -32, i8 -31, i8 -30, i8 -29, i8 -28, i8 -27, i8 -26, i8 -25, i8 -24, i8 -23, i8 -22, i8 -21, i8 -20, i8 -19, i8 -18, i8 -17>, <16 x i8>* %31
%32 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 240
%33 = bitcast i8* %32 to <16 x i8>*
store <16 x i8> <i8 -16, i8 -15, i8 -14, i8 -13, i8 -12, i8 -11, i8 -10, i8 -9, i8 -8, i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1>, <16 x i8>* %33
%34 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 0
%35 = bitcast i8* %34 to <16 x i8>*
store <16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, <16 x i8>* %35
%36 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 16
%37 = bitcast i8* %36 to <16 x i8>*
store <16 x i8> <i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31, i8 32>, <16 x i8>* %37
%38 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 32
%39 = bitcast i8* %38 to <16 x i8>*
store <16 x i8> <i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47, i8 48>, <16 x i8>* %39
%40 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 48
%41 = bitcast i8* %40 to <16 x i8>*
store <16 x i8> <i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63, i8 64>, <16 x i8>* %41
%42 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 64
%43 = bitcast i8* %42 to <16 x i8>*
store <16 x i8> <i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79, i8 80>, <16 x i8>* %43
%44 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 80
%45 = bitcast i8* %44 to <16 x i8>*
store <16 x i8> <i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95, i8 96>, <16 x i8>* %45
%46 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 96
%47 = bitcast i8* %46 to <16 x i8>*
store <16 x i8> <i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111, i8 112>, <16 x i8>* %47
%48 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 112
%49 = bitcast i8* %48 to <16 x i8>*
store <16 x i8> <i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127, i8 -128>, <16 x i8>* %49
%50 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 128
%51 = bitcast i8* %50 to <16 x i8>*
store <16 x i8> <i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113, i8 -112>, <16 x i8>* %51
%52 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 144
%53 = bitcast i8* %52 to <16 x i8>*
store <16 x i8> <i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97, i8 -96>, <16 x i8>* %53
%54 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 160
%55 = bitcast i8* %54 to <16 x i8>*
store <16 x i8> <i8 -95, i8 -94, i8 -93, i8 -92, i8 -91, i8 -90, i8 -89, i8 -88, i8 -87, i8 -86, i8 -85, i8 -84, i8 -83, i8 -82, i8 -81, i8 -80>, <16 x i8>* %55
%56 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 176
%57 = bitcast i8* %56 to <16 x i8>*
store <16 x i8> <i8 -79, i8 -78, i8 -77, i8 -76, i8 -75, i8 -74, i8 -73, i8 -72, i8 -71, i8 -70, i8 -69, i8 -68, i8 -67, i8 -66, i8 -65, i8 -64>, <16 x i8>* %57
%58 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 192
%59 = bitcast i8* %58 to <16 x i8>*
store <16 x i8> <i8 -63, i8 -62, i8 -61, i8 -60, i8 -59, i8 -58, i8 -57, i8 -56, i8 -55, i8 -54, i8 -53, i8 -52, i8 -51, i8 -50, i8 -49, i8 -48>, <16 x i8>* %59
%60 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 208
%61 = bitcast i8* %60 to <16 x i8>*
store <16 x i8> <i8 -47, i8 -46, i8 -45, i8 -44, i8 -43, i8 -42, i8 -41, i8 -40, i8 -39, i8 -38, i8 -37, i8 -36, i8 -35, i8 -34, i8 -33, i8 -32>, <16 x i8>* %61
%62 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 224
%63 = bitcast i8* %62 to <16 x i8>*
store <16 x i8> <i8 -31, i8 -30, i8 -29, i8 -28, i8 -27, i8 -26, i8 -25, i8 -24, i8 -23, i8 -22, i8 -21, i8 -20, i8 -19, i8 -18, i8 -17, i8 -16>, <16 x i8>* %63
%64 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 240
%65 = bitcast i8* %64 to <16 x i8>*
store <16 x i8> <i8 -15, i8 -14, i8 -13, i8 -12, i8 -11, i8 -10, i8 -9, i8 -8, i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1, i8 0>, <16 x i8>* %65
%66 = call i8* @testmem(i8* %2, i32 256)
%67 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 0
%68 = call i8* @testmem(i8* %67, i32 256)
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %66, i8* %68)
ret void
}