int main(void) {
  int i;
  unsigned int a[32];
  unsigned short b[32];
  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)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1182 <main+0x52>
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    1149 <main+0x19>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <foo@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1040 <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    %eax,%eax
nopl   0x0(%rax)
movl   $0x0,0x40(%rsp,%rax,4)
mov    %ax,(%rsp,%rax,2)
add    $0x1,%rax
cmp    $0x20,%rax
jne    1140 <main+0x10>
lea    0x40(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   1040 <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
store i32 0, i32* %2
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i16
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [32 x i16], [32 x i16]* %4, i64 0, i64 %15
store i16 %13, i16* %16
br label %17
17: ; preds = %8
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
%21 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%22 = getelementptr inbounds [32 x i16], [32 x i16]* %4, i64 0, i64 0
%23 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @foo to i32 (i32*, i16*, i32, ...)*)(i32* %21, i16* %22, i32 32)
%24 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%25 = getelementptr inbounds [32 x i16], [32 x i16]* %4, i64 0, i64 0
%26 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @bar to i32 (i32*, i16*, i32, ...)*)(i32* %24, i16* %25, i32 32)
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%28 = getelementptr inbounds [32 x i16], [32 x i16]* %4, i64 0, i64 0
%29 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @baz to i32 (i32*, i16*, i32, ...)*)(i32* %27, i16* %28, 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*
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %10, %5 ]
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 %6
store i32 0, i32* %7
%8 = trunc i64 %6 to i16
%9 = getelementptr inbounds [32 x i16], [32 x i16]* %2, i64 0, i64 %6
store i16 %8, i16* %9
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 32
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%14 = getelementptr inbounds [32 x i16], [32 x i16]* %2, i64 0, i64 0
%15 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @foo to i32 (i32*, i16*, i32, ...)*)(i32* %13, i16* %14, i32 32)
%16 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @bar to i32 (i32*, i16*, i32, ...)*)(i32* %13, i16* %14, i32 32)
%17 = call i32 (i32*, i16*, i32, ...) bitcast (i32 (...)* @baz to i32 (i32*, i16*, i32, ...)*)(i32* %13, i16* %14, i32 32)
ret i32 0
}