int main() {
  float a, b, c;
  float d, e;
  void *args1[] = {&a, &b, &c};
  void *args2[] = {&d, &e};
  printf("%p %p %p %p %p\n", &a, &b, &c, &d, &e);
  void **v_args[] = {(void **)&args1, (void **)&args2};
  void **p_args1 = (void **)&args1;
  void **p_args2 = (void **)&args2;
  foo(&args1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    0xea2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0x1c(%rsp),%rsi
mov    %rsi,0x20(%rsp)
lea    0x18(%rsp),%rdx
mov    %rdx,0x28(%rsp)
lea    0x14(%rsp),%rcx
mov    %rcx,0x30(%rsp)
lea    0xeb7(%rip),%rdi
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%p %p %p %p %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [3 x i8*]
%8 = alloca [2 x i8*]
%9 = alloca [2 x i8**]
%10 = alloca i8**
%11 = alloca i8**
store i32 0, i32* %1
%12 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
%13 = bitcast float* %2 to i8*
store i8* %13, i8** %12
%14 = getelementptr inbounds i8*, i8** %12, i64 1
%15 = bitcast float* %3 to i8*
store i8* %15, i8** %14
%16 = getelementptr inbounds i8*, i8** %14, i64 1
%17 = bitcast float* %4 to i8*
store i8* %17, i8** %16
%18 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 0
%19 = bitcast float* %5 to i8*
store i8* %19, i8** %18
%20 = getelementptr inbounds i8*, i8** %18, i64 1
%21 = bitcast float* %6 to i8*
store i8* %21, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6)
%23 = getelementptr inbounds [2 x i8**], [2 x i8**]* %9, i64 0, i64 0
%24 = bitcast [3 x i8*]* %7 to i8**
store i8** %24, i8*** %23
%25 = getelementptr inbounds i8**, i8*** %23, i64 1
%26 = bitcast [2 x i8*]* %8 to i8**
store i8** %26, i8*** %25
%27 = bitcast [3 x i8*]* %7 to i8**
store i8** %27, i8*** %10
%28 = bitcast [2 x i8*]* %8 to i8**
store i8** %28, i8*** %11
%29 = call i32 ([3 x i8*]*, ...) bitcast (i32 (...)* @foo to i32 ([3 x i8*]*, ...)*)([3 x i8*]* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%p %p %p %p %p\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca [3 x i8*]
%7 = bitcast float* %1 to i8*
%8 = bitcast float* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast [3 x i8*]* %6 to i8*
%13 = bitcast [3 x i8*]* %6 to float**
store float* %1, float** %13
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 1
%15 = bitcast i8** %14 to float**
store float* %2, float** %15
%16 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 2
%17 = bitcast i8** %16 to float**
store float* %3, float** %17
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3, float* %4, float* %5)
%19 = call i32 ([3 x i8*]*, ...) bitcast (i32 (...)* @foo to i32 ([3 x i8*]*, ...)*)([3 x i8*]* %6)
ret i32 0
}