int test1(void) {
  unsigned char a[200];
  initialize_array(a, 200);
  __asm__("" :::);
  if (a[0] != a[200 - 1] || a[0] != 0)
    return 0;
  if (a[200 / 2 - 1] != a[200 / 2] ||
      a[200 / 2 - 1] != ((unsigned char)(200 / 2 - 1)))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
mov    $0xc8,%esi
mov    $0x0,%al
call   1030 <initialize_array@plt>
movzbl -0xd0(%rbp),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <test1+0x41>
movzbl -0xd0(%rbp),%eax
cmp    $0x0,%eax
je     115d <test1+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    118d <test1+0x7d>
movzbl -0x6d(%rbp),%eax
movzbl -0x6c(%rbp),%ecx
cmp    %ecx,%eax
jne    117a <test1+0x6a>
movzbl -0x6d(%rbp),%eax
cmp    $0x63,%eax
je     1186 <test1+0x76>
movl   $0x0,-0x4(%rbp)
jmp    118d <test1+0x7d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
sub    $0xd0,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdi
mov    $0xc8,%esi
xor    %eax,%eax
call   1030 <initialize_array@plt>
mov    0xc7(%rsp),%al
or     (%rsp),%al
jne    1149 <test1+0x39>
mov    0x63(%rsp),%al
mov    0x64(%rsp),%cl
xor    $0x63,%al
xor    $0x63,%cl
xor    %ebx,%ebx
or     %al,%cl
sete   %bl
mov    %ebx,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test1() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @initialize_array to i32 (i8*, i32, ...)*)(i8* %3, i32 200)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 199
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %7, %10
br i1 %11, label %17, label %12
12: ; preds = %0
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12, %0
store i32 0, i32* %1
br label %33
18: ; preds = %12
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 99
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 100
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp ne i32 %21, %24
br i1 %25, label %31, label %26
26: ; preds = %18
%27 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 99
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = icmp ne i32 %29, 99
br i1 %30, label %31, label %32
31: ; preds = %26, %18
store i32 0, i32* %1
br label %33
32: ; preds = %26
store i32 1, i32* %1
br label %33
33: ; preds = %32, %31, %17
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @test1() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @initialize_array to i32 (i8*, i32, ...)*)(i8* %2, i32 200)
%4 = load i8, i8* %2
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 199
%6 = load i8, i8* %5
%7 = or i8 %6, %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %0
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 99
%11 = load i8, i8* %10
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 100
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, 99
%15 = icmp eq i8 %13, 99
%16 = and i1 %14, %15
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %9, %0
%19 = phi i32 [ 0, %0 ], [ %17, %9 ]
ret i32 %19
}