#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*/ printf(char *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
char *strcpy(char *, char *);
int test_strcpy(void) {
  char dest[10];
  do {
    if (!(dest == strcpy(dest, "hello"))) {
      printf("expression '%s' untrue at %d\n",
             "dest == strcpy(dest, \"hello\")", 126);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, "hello"))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"hello\")", 127);
      return 0;
    }
  } while (0);
  do {
    if (!(dest == strcpy(dest, ""))) {
      printf("expression '%s' untrue at %d\n", "dest == strcpy(dest, \"\")",
             129);
      return 0;
    }
  } while (0);
  do {
    if (!(dest[0] == 0)) {
      printf("expression '%s' untrue at %d\n", "dest[0] == 0", 130);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1184 <test_strcpy+0x54>
lea    0xe9f(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x7e,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1268 <test_strcpy+0x138>
jmp    1189 <test_strcpy+0x59>
jmp    118e <test_strcpy+0x5e>
lea    -0xe(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11cb <test_strcpy+0x9b>
lea    0xe58(%rip),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x7f,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1268 <test_strcpy+0x138>
jmp    11d0 <test_strcpy+0xa0>
jmp    11d5 <test_strcpy+0xa5>
lea    -0xe(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     1221 <test_strcpy+0xf1>
lea    0xe02(%rip),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x81,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1268 <test_strcpy+0x138>
jmp    1226 <test_strcpy+0xf6>
jmp    122b <test_strcpy+0xfb>
movsbl -0xe(%rbp),%eax
cmp    $0x0,%eax
je     125c <test_strcpy+0x12c>
lea    0xdc7(%rip),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x82,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1268 <test_strcpy+0x138>
jmp    1261 <test_strcpy+0x131>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strcpy>:
sub    $0x18,%rsp
movw   $0x6f,0x10(%rsp)
movl   $0x6c6c6568,0xc(%rsp)
6c
mov    $0x1,%al
test   %al,%al
jne    1148 <test_strcpy+0x38>
lea    0xed6(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x7f,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [30 x i8] c"dest == strcpy(dest, \22hello\22)\00"
@.str.3 = [23 x i8] c"!strcmp(dest, \22hello\22)\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [25 x i8] c"dest == strcpy(dest, \22\22)\00"
@.str.6 = [13 x i8] c"dest[0] == 0\00"
define i32 @test_strcpy() {
%1 = alloca i32
%2 = alloca [10 x i8]
br label %3
3: ; preds = %0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i8* @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %4, %6
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 126)
store i32 0, i32* %1
br label %38
10: ; preds = %3
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 127)
store i32 0, i32* %1
br label %38
18: ; preds = %12
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%23 = call i8* @strcpy(i8* %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i8* %21, %23
br i1 %24, label %27, label %25
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 129)
store i32 0, i32* %1
br label %38
27: ; preds = %20
br label %28
28: ; preds = %27
br label %29
29: ; preds = %28
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 130)
store i32 0, i32* %1
br label %38
36: ; preds = %29
br label %37
37: ; preds = %36
store i32 1, i32* %1
br label %38
38: ; preds = %37, %34, %25, %16, %8
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.3 = [23 x i8] c"!strcmp(dest, \22hello\22)\00"
define i32 @test_strcpy() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 127)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 0, %5 ], [ 1, %0 ]
ret i32 %8
}