#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*/ clang_analyzer_eval(int);
char *memmove(char *, char *, int);
void memmove0() {
  char src[] = {1, 2, 3, 4};
  char dst[4] = {0};
  memmove(dst, src, 4);
  clang_analyzer_eval(memmove(dst, src, 4) == dst);
  clang_analyzer_eval(dst[0] != 0);
}


x86 assembly (clang, -O0):
<memmove0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memmove@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memmove@plt>
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove0>:
push   %r14
push   %rbx
push   %rax
movl   $0x4030201,0x4(%rsp)
04
movl   $0x0,(%rsp)
mov    %rsp,%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memmove@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memmove@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmpb   $0x0,(%rsp)
setne  %dil
call   1040 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.memmove0.src = [4 x i8] c"\01\02\03\04"
define void @memmove0() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = call i8* @memmove(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%10 = call i8* @memmove(i8* %8, i8* %9, i32 4)
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @clang_analyzer_eval(i32 %19)
ret void
}

LLVM IR (-O2):
define void @memmove0() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i8* @memmove(i8* %4, i8* %3, i32 4)
%6 = call i8* @memmove(i8* %4, i8* %3, i32 4)
%7 = icmp eq i8* %6, %4
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i8, i8* %4
%11 = icmp ne i8 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
ret void
}