#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 *stpcpy(char *, char *);
size_t strlen(char *);
void stpcpy_effect(char *x, char *y) {
  char a = x[0];
  clang_analyzer_eval(stpcpy(x, y) == &x[strlen(y)]);
  clang_analyzer_eval(strlen(x) == strlen(y));
  clang_analyzer_eval(a == x[0]);
}


x86 assembly (clang, -O0):
<stpcpy_effect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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 <stpcpy@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
add    %rdx,%rcx
cmp    %rcx,%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    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy_effect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%bpl
call   1030 <stpcpy@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %rbx,%rax
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
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 @stpcpy_effect(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* @stpcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = icmp eq i8* %11, %15
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
%19 = load i8*, i8** %3
%20 = call i64 @strlen(i8* %19)
%21 = load i8*, i8** %4
%22 = call i64 @strlen(i8* %21)
%23 = icmp eq i64 %20, %22
%24 = zext i1 %23 to i32
%25 = call i32 @clang_analyzer_eval(i32 %24)
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %27, %31
%33 = zext i1 %32 to i32
%34 = call i32 @clang_analyzer_eval(i32 %33)
ret void
}

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