double f_va_3(char *fmt, ...) {
  __builtin_va_list va;
  __builtin_va_start(va, fmt);
  double v = __builtin_va_arg(va, double);
  int w = __builtin_va_arg(va, int);
  double x = __builtin_va_arg(va, double);
  __builtin_va_end(va);
  return v + x;
}


x86 assembly (clang, -O0):
<f_va_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
test   %al,%al
je     113f <f_va_3+0x3f>
movaps %xmm0,-0xc0(%rbp)
movaps %xmm1,-0xb0(%rbp)
movaps %xmm2,-0xa0(%rbp)
movaps %xmm3,-0x90(%rbp)
movaps %xmm4,-0x80(%rbp)
movaps %xmm5,-0x70(%rbp)
movaps %xmm6,-0x60(%rbp)
movaps %xmm7,-0x50(%rbp)
mov    %r9,-0xc8(%rbp)
mov    %r8,-0xd0(%rbp)
mov    %rcx,-0xd8(%rbp)
mov    %rdx,-0xe0(%rbp)
mov    %rsi,-0xe8(%rbp)
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rax
lea    -0xf0(%rbp),%rcx
mov    %rcx,0x10(%rax)
lea    0x10(%rbp),%rcx
mov    %rcx,0x8(%rax)
movl   $0x30,0x4(%rax)
movl   $0x8,(%rax)
lea    -0x20(%rbp),%rax
mov    %rax,-0x108(%rbp)
add    $0x4,%rax
mov    %rax,-0x100(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xf4(%rbp)
cmp    $0xa0,%eax
ja     11e0 <f_va_3+0xe0>
mov    -0x100(%rbp),%rcx
mov    -0xf4(%rbp),%edx
mov    -0x108(%rbp),%rsi
movslq %edx,%rax
add    0x10(%rsi),%rax
add    $0x10,%edx
mov    %edx,(%rcx)
mov    %rax,-0x110(%rbp)
jmp    11fd <f_va_3+0xfd>
mov    -0x108(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x114(%rbp)
cmp    $0x28,%eax
ja     124f <f_va_3+0x14f>
mov    -0x120(%rbp),%rcx
mov    -0x114(%rbp),%edx
movslq %edx,%rax
add    0x10(%rcx),%rax
add    $0x8,%edx
mov    %edx,(%rcx)
mov    %rax,-0x128(%rbp)
jmp    126c <f_va_3+0x16c>
mov    -0x120(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x140(%rbp)
add    $0x4,%rax
mov    %rax,-0x138(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x12c(%rbp)
cmp    $0xa0,%eax
ja     12ce <f_va_3+0x1ce>
mov    -0x138(%rbp),%rcx
mov    -0x12c(%rbp),%edx
mov    -0x140(%rbp),%rsi
movslq %edx,%rax
add    0x10(%rsi),%rax
add    $0x10,%edx
mov    %edx,(%rcx)
mov    %rax,-0x148(%rbp)
jmp    12eb <f_va_3+0x1eb>
mov    -0x140(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x148(%rbp)
mov    -0x148(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_va_3>:
sub    $0x58,%rsp
mov    %rsi,-0x58(%rsp)
mov    %rdx,-0x50(%rsp)
mov    %rcx,-0x48(%rsp)
mov    %r8,-0x40(%rsp)
mov    %r9,-0x38(%rsp)
test   %al,%al
je     1148 <f_va_3+0x48>
movaps %xmm0,-0x30(%rsp)
movaps %xmm1,-0x20(%rsp)
movaps %xmm2,-0x10(%rsp)
movaps %xmm3,(%rsp)
movaps %xmm4,0x10(%rsp)
movaps %xmm5,0x20(%rsp)
movaps %xmm6,0x30(%rsp)
movaps %xmm7,0x40(%rsp)
movabs $0x3000000008,%rax
mov    %rax,-0x80(%rsp)
lea    -0x60(%rsp),%rax
mov    %rax,-0x70(%rsp)
lea    0x60(%rsp),%rax
mov    %rax,-0x78(%rsp)
mov    -0x7c(%rsp),%eax
cmp    $0xa0,%rax
ja     1188 <f_va_3+0x88>
mov    %rax,%rcx
add    -0x70(%rsp),%rcx
add    $0x10,%eax
mov    %eax,-0x7c(%rsp)
jmp    1196 <f_va_3+0x96>
mov    -0x78(%rsp),%rcx
lea    0x8(%rcx),%rdx
mov    %rdx,-0x78(%rsp)
movsd  (%rcx),%xmm0
mov    -0x80(%rsp),%ecx
cmp    $0x28,%ecx
ja     11c1 <f_va_3+0xc1>
add    $0x8,%ecx
mov    %ecx,-0x80(%rsp)
cmp    $0xa0,%eax
jbe    11ce <f_va_3+0xce>
mov    -0x78(%rsp),%rcx
lea    0x8(%rcx),%rax
mov    %rax,-0x78(%rsp)
jmp    11dc <f_va_3+0xdc>
addq   $0x8,-0x78(%rsp)
cmp    $0xa0,%eax
ja     11b1 <f_va_3+0xb1>
mov    %eax,%ecx
add    -0x70(%rsp),%rcx
add    $0x10,%eax
mov    %eax,-0x7c(%rsp)
addsd  (%rcx),%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define double @f_va_3(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [1 x %struct.__va_list_tag]
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store i8* %0, i8** %2
%7 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%8 = bitcast %struct.__va_list_tag* %7 to i8*
%9 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%10 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = icmp ule i32 %11, 160
br i1 %12, label %13, label %19
13: ; preds = %1
%14 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %9, i32 0, i32 3
%15 = load i8*, i8** %14
%16 = getelementptr i8, i8* %15, i32 %11
%17 = bitcast i8* %16 to double*
%18 = add i32 %11, 16
store i32 %18, i32* %10
br label %24
19: ; preds = %1
%20 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %9, i32 0, i32 2
%21 = load i8*, i8** %20
%22 = bitcast i8* %21 to double*
%23 = getelementptr i8, i8* %21, i32 8
store i8* %23, i8** %20
br label %24
24: ; preds = %19, %13
%25 = phi double* [ %17, %13 ], [ %22, %19 ]
%26 = load double, double* %25
store double %26, double* %4
%27 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%28 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %27, i32 0, i32 0
%29 = load i32, i32* %28
%30 = icmp ule i32 %29, 40
br i1 %30, label %31, label %37
31: ; preds = %24
%32 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %27, i32 0, i32 3
%33 = load i8*, i8** %32
%34 = getelementptr i8, i8* %33, i32 %29
%35 = bitcast i8* %34 to i32*
%36 = add i32 %29, 8
store i32 %36, i32* %28
br label %42
37: ; preds = %24
%38 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %27, i32 0, i32 2
%39 = load i8*, i8** %38
%40 = bitcast i8* %39 to i32*
%41 = getelementptr i8, i8* %39, i32 8
store i8* %41, i8** %38
br label %42
42: ; preds = %37, %31
%43 = phi i32* [ %35, %31 ], [ %40, %37 ]
%44 = load i32, i32* %43
store i32 %44, i32* %5
%45 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%46 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %45, i32 0, i32 1
%47 = load i32, i32* %46
%48 = icmp ule i32 %47, 160
br i1 %48, label %49, label %55
49: ; preds = %42
%50 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %45, i32 0, i32 3
%51 = load i8*, i8** %50
%52 = getelementptr i8, i8* %51, i32 %47
%53 = bitcast i8* %52 to double*
%54 = add i32 %47, 16
store i32 %54, i32* %46
br label %60
55: ; preds = %42
%56 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %45, i32 0, i32 2
%57 = load i8*, i8** %56
%58 = bitcast i8* %57 to double*
%59 = getelementptr i8, i8* %57, i32 8
store i8* %59, i8** %56
br label %60
60: ; preds = %55, %49
%61 = phi double* [ %53, %49 ], [ %58, %55 ]
%62 = load double, double* %61
store double %62, double* %6
%63 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%64 = bitcast %struct.__va_list_tag* %63 to i8*
%65 = load double, double* %4
%66 = load double, double* %6
%67 = fadd double %65, %66
ret double %67
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define double @f_va_3(i8* nocapture readnone %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = icmp ult i32 %5, 161
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 3
%9 = load i8*, i8** %8
%10 = zext i32 %5 to i64
%11 = getelementptr i8, i8* %9, i64 %10
%12 = add nuw nsw i32 %5, 16
store i32 %12, i32* %4
br label %17
13: ; preds = %1
%14 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 2
%15 = load i8*, i8** %14
%16 = getelementptr i8, i8* %15, i64 8
store i8* %16, i8** %14
br label %17
17: ; preds = %13, %7
%18 = phi i32 [ %12, %7 ], [ %5, %13 ]
%19 = phi i8* [ %11, %7 ], [ %15, %13 ]
%20 = bitcast i8* %19 to double*
%21 = load double, double* %20
%22 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 0
%23 = load i32, i32* %22
%24 = icmp ult i32 %23, 41
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = add nuw nsw i32 %23, 8
store i32 %26, i32* %22
br label %31
27: ; preds = %17
%28 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 2
%29 = load i8*, i8** %28
%30 = getelementptr i8, i8* %29, i64 8
store i8* %30, i8** %28
br label %31
31: ; preds = %27, %25
%32 = icmp ult i32 %18, 161
br i1 %32, label %33, label %39
33: ; preds = %31
%34 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 3
%35 = load i8*, i8** %34
%36 = zext i32 %18 to i64
%37 = getelementptr i8, i8* %35, i64 %36
%38 = add nuw nsw i32 %18, 16
store i32 %38, i32* %4
br label %43
39: ; preds = %31
%40 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 2
%41 = load i8*, i8** %40
%42 = getelementptr i8, i8* %41, i64 8
store i8* %42, i8** %40
br label %43
43: ; preds = %39, %33
%44 = phi i8* [ %37, %33 ], [ %41, %39 ]
%45 = bitcast i8* %44 to double*
%46 = load double, double* %45
%47 = fadd double %21, %46
ret double %47
}