#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*/ abort();
scalar_t__ memcmp(char *, char *, int);
void __attribute__((no)) bar(void *x, void *y) {
  struct S {
    char w[8];
  } *p = x, *q = y;
  if (memcmp(p->w, "zyxwvut", 8) != 0)
    abort();
  if (memcmp(q[0].w, "abcdefg", 8) != 0)
    abort();
  if (memcmp(q[1].w, "ABCDEFG", 8) != 0)
    abort();
  if (memcmp(q[2].w, "zyxwvut", 8) != 0)
    abort();
  if (memcmp(q[3].w, "zyxwvut", 8) != 0)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     1166 <bar+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     118c <bar+0x6c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rdi
add    $0x8,%rdi
lea    0xe75(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     11b6 <bar+0x96>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rdi
add    $0x10,%rdi
lea    0xe3b(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     11e0 <bar+0xc0>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rdi
add    $0x18,%rdi
lea    0xe11(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     120a <bar+0xea>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    11a6 <bar+0x86>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    11a6 <bar+0x86>
lea    0x8(%rbx),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    11a6 <bar+0x86>
lea    0x10(%rbx),%rdi
lea    0xe88(%rip),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    11a6 <bar+0x86>
add    $0x18,%rbx
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    11a6 <bar+0x86>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.S = type { [8 x i8] }
@.str = [8 x i8] c"zyxwvut\00"
@.str.1 = [8 x i8] c"abcdefg\00"
@.str.2 = [8 x i8] c"ABCDEFG\00"
define void @bar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.S*
%6 = alloca %struct.S*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.S*
store %struct.S* %8, %struct.S** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.S*
store %struct.S* %10, %struct.S** %6
%11 = load %struct.S*, %struct.S** %5
%12 = getelementptr inbounds %struct.S, %struct.S* %11, i32 0, i32 0
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%14 = call i64 @memcmp(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
%19 = load %struct.S*, %struct.S** %6
%20 = getelementptr inbounds %struct.S, %struct.S* %19, i64 0
%21 = getelementptr inbounds %struct.S, %struct.S* %20, i32 0, i32 0
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 0
%23 = call i64 @memcmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %18
%28 = load %struct.S*, %struct.S** %6
%29 = getelementptr inbounds %struct.S, %struct.S* %28, i64 1
%30 = getelementptr inbounds %struct.S, %struct.S* %29, i32 0, i32 0
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %30, i64 0, i64 0
%32 = call i64 @memcmp(i8* %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 8)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %27
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %27
%37 = load %struct.S*, %struct.S** %6
%38 = getelementptr inbounds %struct.S, %struct.S* %37, i64 2
%39 = getelementptr inbounds %struct.S, %struct.S* %38, i32 0, i32 0
%40 = getelementptr inbounds [8 x i8], [8 x i8]* %39, i64 0, i64 0
%41 = call i64 @memcmp(i8* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %36
%44 = call i32 (...) @abort()
unreachable
45: ; preds = %36
%46 = load %struct.S*, %struct.S** %6
%47 = getelementptr inbounds %struct.S, %struct.S* %46, i64 3
%48 = getelementptr inbounds %struct.S, %struct.S* %47, i32 0, i32 0
%49 = getelementptr inbounds [8 x i8], [8 x i8]* %48, i64 0, i64 0
%50 = call i64 @memcmp(i8* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %45
%53 = call i32 (...) @abort()
unreachable
54: ; preds = %45
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"zyxwvut\00"
@.str.1 = [8 x i8] c"abcdefg\00"
@.str.2 = [8 x i8] c"ABCDEFG\00"
define void @bar(i8* %0, i8* %1) {
%3 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %1, i64 8
%14 = tail call i64 @memcmp(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 8)
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %12
%19 = getelementptr inbounds i8, i8* %1, i64 16
%20 = tail call i64 @memcmp(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %18
%25 = getelementptr inbounds i8, i8* %1, i64 24
%26 = tail call i64 @memcmp(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 (...) @abort()
unreachable
30: ; preds = %24
ret void
}