int main(void) {
  int i;
  unsigned int a[32];
  unsigned short b[32];
  check_vect();
  for (i = 0; i < 32; i++) {
    a[i] = 0;
    b[i] = i;
    __asm__ volatile("");
  }
  foo(a, b, 32);
  bar(a, b, 32);
  baz(a, b, 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1199 <main+0x59>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    %ax,%cx
movslq -0x8(%rbp),%rax
mov    %cx,-0xd0(%rbp,%rax,2)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main+0x20>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1060 <foo@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <bar@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <baz@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <check_vect@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movl   $0x0,0x40(%rsp,%rbx,4)
mov    %bx,(%rsp,%rbx,2)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1160 <main+0x20>
lea    0x40(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <foo@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   1050 <bar@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [32 x i32]
%2 = alloca [32 x i16]
%3 = bitcast [32 x i32]* %1 to i8*
%4 = bitcast [32 x i16]* %2 to i8*
%5 = tail call i32 (...) @check_vect()
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %11, %6 ]
%8 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 %7
store i32 0, i32* %8
%9 = trunc i64 %7 to i16
%10 = getelementptr inbounds [32 x i16], [32 x i16]* %2, i64 0, i64 %7
store i16 %9, i16* %10
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, 32
br i1 %12, label %13, label %6
13: ; preds = %6
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%15 = getelementptr inbounds [32 x i16], [32 x i16]* %2, i64 0, i64 0
%16 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @foo to i32 (i32*, i16*, i32, ...)*)(i32* %14, i16* %15, i32 32)
%17 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @bar to i32 (i32*, i16*, i32, ...)*)(i32* %14, i16* %15, i32 32)
%18 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @baz to i32 (i32*, i16*, i32, ...)*)(i32* %14, i16* %15, i32 32)
ret i32 0
}