#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 */
typedef int /*<<< orphan*/ src;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *A = "src or dst is A";
  char *NA = "src or dst is not A";
  char src[5];
  char dst[sizeof(src)];
  read(0, src, sizeof(src));
  strcpy(dst, src);
  if (dst[1] == 'A' || src[1] == 'A') {
    printf(A);
  }
  if (dst[1] != 'A' && src[1] != 'A') {
    printf(NA);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x1d(%rbp),%rsi
xor    %edi,%edi
mov    $0x5,%edx
call   1050 <read@plt>
lea    -0x22(%rbp),%rdi
lea    -0x1d(%rbp),%rsi
call   1030 <strcpy@plt>
movsbl -0x21(%rbp),%eax
cmp    $0x41,%eax
je     118c <main+0x5c>
movsbl -0x1c(%rbp),%eax
cmp    $0x41,%eax
jne    1195 <main+0x65>
mov    -0x10(%rbp),%rdi
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
cmp    $0x41,%eax
je     11b8 <main+0x88>
movsbl -0x1c(%rbp),%eax
cmp    $0x41,%eax
je     11b8 <main+0x88>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1050 <read@plt>
lea    0x6(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x7(%rsp),%al
cmp    $0x41,%al
je     1167 <main+0x37>
mov    0xc(%rsp),%cl
cmp    $0x41,%cl
jne    117b <main+0x4b>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    0x7(%rsp),%al
mov    0xc(%rsp),%cl
cmp    $0x41,%al
je     1190 <main+0x60>
cmp    $0x41,%cl
je     1190 <main+0x60>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"src or dst is A\00"
@.str.1 = [20 x i8] c"src or dst is not A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%7 = call i32 @read(i32 0, i8* %6, i32 5)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 65
br i1 %14, label %20, label %15
15: ; preds = %0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 65
br i1 %19, label %20, label %23
20: ; preds = %15, %0
%21 = load i8*, i8** %2
%22 = call i32 @printf(i8* %21)
br label %23
23: ; preds = %20, %15
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 65
br i1 %27, label %28, label %36
28: ; preds = %23
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 65
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i32 @printf(i8* %34)
br label %36
36: ; preds = %33, %28, %23
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"src or dst is A\00"
@.str.1 = [20 x i8] c"src or dst is not A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %3, i32 5)
%6 = call i32 @strcpy(i8* %4, i8* %3)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 65
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 65
%13 = select i1 %9, i1 true, i1 %12
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%16 = load i8, i8* %7
%17 = load i8, i8* %10
br label %18
18: ; preds = %0, %14
%19 = phi i8 [ %11, %0 ], [ %17, %14 ]
%20 = phi i8 [ %8, %0 ], [ %16, %14 ]
%21 = icmp ne i8 %20, 65
%22 = icmp ne i8 %19, 65
%23 = select i1 %21, i1 %22, i1 false
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %18
ret i32 0
}