void f(int *p) {
  int a[2], b[3], c[4];
  cat0(0);
  cat(0);
  cat(a);
  cat(b);
  cat(c);
  cat(p);
  vat(1, 0);
  vat(3, b);
  char d[4];
  cat((int *)d);
  cat(d);
  char e[12];
  cat((int *)e);
  cat(e);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1040 <cat0@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <vat@plt>
lea    -0x1c(%rbp),%rsi
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <vat@plt>
lea    -0x34(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x34(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <cat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
xor    %eax,%eax
call   1040 <cat0@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1050 <cat@plt>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1050 <cat@plt>
lea    0x18(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
lea    0x30(%rsp),%rdi
xor    %eax,%eax
call   1050 <cat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <vat@plt>
mov    $0x3,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <vat@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
lea    0x24(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cat@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
%3 = alloca [2 x i32]
%4 = alloca [3 x i32]
%5 = alloca [4 x i32]
%6 = alloca [4 x i8]
%7 = alloca [12 x i8]
store i32* %0, i32** %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @cat0 to i32 (i32, ...)*)(i32 0)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @cat to i32 (i32, ...)*)(i32 0)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%11 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %10)
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %12)
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%15 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %14)
%16 = load i32*, i32** %2
%17 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %16)
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vat to i32 (i32, i32, ...)*)(i32 1, i32 0)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%20 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @vat to i32 (i32, i32*, ...)*)(i32 3, i32* %19)
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%22 = bitcast i8* %21 to i32*
%23 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %22)
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @cat to i32 (i8*, ...)*)(i8* %24)
%26 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%27 = bitcast i8* %26 to i32*
%28 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %27)
%29 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @cat to i32 (i8*, ...)*)(i8* %29)
ret void
}

LLVM IR (-O2):
define void @f(i32* %0) {
%2 = alloca [2 x i32]
%3 = alloca [3 x i32]
%4 = alloca [4 x i32]
%5 = alloca i32
%6 = alloca [12 x i8]
%7 = bitcast [2 x i32]* %2 to i8*
%8 = bitcast [3 x i32]* %3 to i8*
%9 = bitcast [4 x i32]* %4 to i8*
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @cat0 to i32 (i32, ...)*)(i32 0)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @cat to i32 (i32, ...)*)(i32 0)
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %12)
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%15 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %14)
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%17 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %16)
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %0)
%19 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vat to i32 (i32, i32, ...)*)(i32 1, i32 0)
%20 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @vat to i32 (i32, i32*, ...)*)(i32 3, i32* %14)
%21 = bitcast i32* %5 to i8*
%22 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %5)
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @cat to i32 (i8*, ...)*)(i8* %21)
%24 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%25 = bitcast [12 x i8]* %6 to i32*
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @cat to i32 (i32*, ...)*)(i32* %25)
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @cat to i32 (i8*, ...)*)(i8* %24)
ret void
}