#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 *strcpy(char *, char *);
scalar_t__ strlen(char *);
void strcpy_effects(char *x, char *y) {
  char a = x[0];
  clang_analyzer_eval(strcpy(x, y) == x);
  clang_analyzer_eval(strlen(x) == strlen(y));
  clang_analyzer_eval(a == x[0]);
}


x86 assembly (clang, -O0):
<strcpy_effects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
movsbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_effects>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%bpl
call   1030 <strcpy@plt>
mov    $0x1,%edi
call   1050 <clang_analyzer_eval@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
call   1050 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    (%rbx),%bpl
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @strcpy_effects(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = icmp eq i8* %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @clang_analyzer_eval(i32 %14)
%16 = load i8*, i8** %3
%17 = call i64 @strlen(i8* %16)
%18 = load i8*, i8** %4
%19 = call i64 @strlen(i8* %18)
%20 = icmp eq i64 %17, %19
%21 = zext i1 %20 to i32
%22 = call i32 @clang_analyzer_eval(i32 %21)
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %24, %28
%30 = zext i1 %29 to i32
%31 = call i32 @clang_analyzer_eval(i32 %30)
ret void
}

LLVM IR (-O2):
define void @strcpy_effects(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = tail call i8* @strcpy(i8* %0, i8* dereferenceable(1) %1)
%5 = tail call i32 @clang_analyzer_eval(i32 1)
%6 = tail call i64 @strlen(i8* %0)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @clang_analyzer_eval(i32 %9)
%11 = load i8, i8* %0
%12 = icmp eq i8 %3, %11
%13 = zext i1 %12 to i32
%14 = tail call i32 @clang_analyzer_eval(i32 %13)
ret void
}