#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*/ a;

/* Variables and functions */
int /*<<< orphan*/ bar(unsigned char *);
void fn3(void) {
  unsigned char a[16], b[16], c[16];
  int i;
  bar(b);
  for (i = 0; i < (int)(sizeof(a) / sizeof(a[0])); i++) {
    c[i + 8] = b[i];
    a[i + 8] = b[i + 8];
  }
  bar(a);
  bar(c);
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rdi
call   1030 <bar@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x10,-0x34(%rbp)
jge    116c <fn3+0x5c>
movslq -0x34(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x34(%rbp),%eax
add    $0x8,%eax
cltq
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x8,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x34(%rbp),%eax
add    $0x8,%eax
cltq
mov    %cl,-0x10(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1128 <fn3+0x18>
lea    -0x10(%rbp),%rdi
call   1030 <bar@plt>
lea    -0x30(%rbp),%rdi
call   1030 <bar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
sub    $0x38,%rsp
mov    %rsp,%rdi
call   1030 <bar@plt>
movaps (%rsp),%xmm0
movups %xmm0,0x18(%rsp)
movups 0x8(%rsp),%xmm0
movups %xmm0,0x28(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <bar@plt>
lea    0x10(%rsp),%rdi
call   1030 <bar@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @fn3() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @bar(i8* %5)
store i32 0, i32* %4
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %17
store i8 %14, i8* %18
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 %26
store i8 %23, i8* %27
br label %28
28: ; preds = %10
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %7
31: ; preds = %7
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%33 = call i32 @bar(i8* %32)
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%35 = call i32 @bar(i8* %34)
ret void
}

LLVM IR (-O2):
define void @fn3() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%8 = call i32 @bar(i8* %6)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 8
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 8
%12 = call i32 @bar(i8* %5)
%13 = call i32 @bar(i8* %7)
ret void
}