void test_ptr_memmove() {
  char **pp[5];
  pp[0] = "A";
  pp[1] = "B";
  pp[2] = "C";
  pp[3] = "D";
  pp[4] = "E";
  memmove(pp, pp + 1, sizeof(char *) * 4);
  assertTrue("strcmp(pp[0], \"B\") == 0", strcmp(pp[0], "B") == 0);
  ;
  assertTrue("strcmp(pp[1], \"C\") == 0", strcmp(pp[1], "C") == 0);
  ;
  assertTrue("strcmp(pp[2], \"D\") == 0", strcmp(pp[2], "D") == 0);
  ;
  assertTrue("strcmp(pp[3], \"E\") == 0", strcmp(pp[3], "E") == 0);
  ;
  assertTrue("strcmp(pp[4], \"E\") == 0", strcmp(pp[4], "E") == 0);
  ;
}


x86 assembly (clang, -O0):
<test_ptr_memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x30(%rbp),%rax
lea    -0x30(%rbp),%rcx
add    $0x8,%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm1
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    -0x30(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
mov    -0x28(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
mov    -0x20(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
mov    -0x10(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ptr_memmove>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xed0(%rip),%rax
mov    %rax,(%rsp)
lea    0xec7(%rip),%rsi
mov    %rsi,0x8(%rsp)
lea    0xebd(%rip),%rbx
mov    %rbx,0x10(%rsp)
lea    0xeb3(%rip),%r15
mov    %r15,0x18(%rsp)
lea    0xea9(%rip),%r14
mov    %r14,0x20(%rsp)
movups 0x8(%rsp),%xmm0
movaps %xmm0,(%rsp)
movups 0x18(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
mov    (%rsp),%rdi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1030 <assertTrue@plt>
mov    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1030 <assertTrue@plt>
mov    0x10(%rsp),%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe65(%rip),%rdi
xor    %eax,%eax
call   1030 <assertTrue@plt>
mov    0x18(%rsp),%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1030 <assertTrue@plt>
lea    0xe64(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [2 x i8] c"D\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [24 x i8] c"strcmp(pp[0], \22B\22) == 0\00"
@.str.6 = [24 x i8] c"strcmp(pp[1], \22C\22) == 0\00"
@.str.7 = [24 x i8] c"strcmp(pp[2], \22D\22) == 0\00"
@.str.8 = [24 x i8] c"strcmp(pp[3], \22E\22) == 0\00"
@.str.9 = [24 x i8] c"strcmp(pp[4], \22E\22) == 0\00"
define void @test_ptr_memmove() {
%1 = alloca [5 x i8**]
%2 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 0
store i8** bitcast ([2 x i8]* @.str to i8**), i8*** %2
%3 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 1
store i8** bitcast ([2 x i8]* @.str.1 to i8**), i8*** %3
%4 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 2
store i8** bitcast ([2 x i8]* @.str.2 to i8**), i8*** %4
%5 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 3
store i8** bitcast ([2 x i8]* @.str.3 to i8**), i8*** %5
%6 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 4
store i8** bitcast ([2 x i8]* @.str.4 to i8**), i8*** %6
%7 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 0
%8 = bitcast i8*** %7 to i8*
%9 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 0
%10 = getelementptr inbounds i8**, i8*** %9, i64 1
%11 = bitcast i8*** %10 to i8*
%12 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 0
%13 = load i8**, i8*** %12
%14 = bitcast i8** %13 to i8*
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 1
%20 = load i8**, i8*** %19
%21 = bitcast i8** %20 to i8*
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 2
%27 = load i8**, i8*** %26
%28 = bitcast i8** %27 to i8*
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 3
%34 = load i8**, i8*** %33
%35 = bitcast i8** %34 to i8*
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
%38 = zext i1 %37 to i32
%39 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 4
%41 = load i8**, i8*** %40
%42 = bitcast i8** %41 to i8*
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %45)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [2 x i8] c"D\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [24 x i8] c"strcmp(pp[0], \22B\22) == 0\00"
@.str.6 = [24 x i8] c"strcmp(pp[1], \22C\22) == 0\00"
@.str.7 = [24 x i8] c"strcmp(pp[2], \22D\22) == 0\00"
@.str.8 = [24 x i8] c"strcmp(pp[3], \22E\22) == 0\00"
@.str.9 = [24 x i8] c"strcmp(pp[4], \22E\22) == 0\00"
define void @test_ptr_memmove() {
%1 = alloca [5 x i8**]
%2 = bitcast [5 x i8**]* %1 to i8*
%3 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 0
store i8** bitcast ([2 x i8]* @.str to i8**), i8*** %3
%4 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 1
store i8** bitcast ([2 x i8]* @.str.1 to i8**), i8*** %4
%5 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 2
store i8** bitcast ([2 x i8]* @.str.2 to i8**), i8*** %5
%6 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 3
store i8** bitcast ([2 x i8]* @.str.3 to i8**), i8*** %6
%7 = getelementptr inbounds [5 x i8**], [5 x i8**]* %1, i64 0, i64 4
store i8** bitcast ([2 x i8]* @.str.4 to i8**), i8*** %7
%8 = bitcast i8*** %4 to i8*
%9 = bitcast [5 x i8**]* %1 to i8**
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = bitcast i8*** %4 to i8**
%16 = load i8*, i8** %15
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %19)
%21 = bitcast i8*** %5 to i8**
%22 = load i8*, i8** %21
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %22, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
%26 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %25)
%27 = bitcast i8*** %6 to i8**
%28 = load i8*, i8** %27
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %28, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %31)
%33 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 1)
ret void
}