void test_va_multiarg(__builtin_va_list va) {
  do {
    int n = __builtin_vsnprintf(0, 0, "%8x", va);
    do {
      extern void failure_on_line_158(int);
      extern void success_on_line_158(int);
      if (n == 8)
        success_on_line_158(n);
      else
        failure_on_line_158(n);
    } while (0);
  } while (0);
  do {
    int n = __builtin_vsnprintf(0, 0, "% 8x", va);
    do {
      extern void failure_on_line_159(int);
      extern void success_on_line_159(int);
      if (n == 8)
        success_on_line_159(n);
      else
        failure_on_line_159(n);
    } while (0);
  } while (0);
  do {
    int n = __builtin_vsnprintf(0, 0, "%9x", va);
    do {
      extern void failure_on_line_160(int);
      extern void success_on_line_160(int);
      if (n == 9)
        success_on_line_160(n);
      else
        failure_on_line_160(n);
    } while (0);
  } while (0);
  do {
    int n = __builtin_vsnprintf(0, 0, "%11o", va);
    do {
      extern void failure_on_line_161(int);
      extern void success_on_line_161(int);
      if (n == 11)
        success_on_line_161(n);
      else
        failure_on_line_161(n);
    } while (0);
  } while (0);
  do {
    int n = __builtin_vsnprintf(0, 0, "%12o", va);
    do {
      extern void failure_on_line_162(int);
      extern void success_on_line_162(int);
      if (n == 12)
        success_on_line_162(n);
      else
        failure_on_line_162(n);
    } while (0);
  } while (0);
  do {
    int n = __builtin_vsnprintf(0, 0, "%12i %3.2s", va);
    do {
      extern void failure_on_line_164(int);
      extern void success_on_line_164(int);
      if (n == 16)
        success_on_line_164(n);
      else
        failure_on_line_164(n);
    } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<test_va_multiarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xe15(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jne    120d <test_va_multiarg+0x3d>
mov    -0xc(%rbp),%edi
call   10b0 <success_on_line_158@plt>
jmp    1215 <test_va_multiarg+0x45>
mov    -0xc(%rbp),%edi
call   10c0 <failure_on_line_158@plt>
jmp    121a <test_va_multiarg+0x4a>
jmp    121f <test_va_multiarg+0x4f>
jmp    1224 <test_va_multiarg+0x54>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xdd1(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jne    1255 <test_va_multiarg+0x85>
mov    -0x10(%rbp),%edi
call   10f0 <success_on_line_159@plt>
jmp    125d <test_va_multiarg+0x8d>
mov    -0x10(%rbp),%edi
call   1030 <failure_on_line_159@plt>
jmp    1262 <test_va_multiarg+0x92>
jmp    1267 <test_va_multiarg+0x97>
jmp    126c <test_va_multiarg+0x9c>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xd8e(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jne    129d <test_va_multiarg+0xcd>
mov    -0x14(%rbp),%edi
call   1060 <success_on_line_160@plt>
jmp    12a5 <test_va_multiarg+0xd5>
mov    -0x14(%rbp),%edi
call   1050 <failure_on_line_160@plt>
jmp    12aa <test_va_multiarg+0xda>
jmp    12af <test_va_multiarg+0xdf>
jmp    12b4 <test_va_multiarg+0xe4>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xd4a(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xb,-0x18(%rbp)
jne    12e5 <test_va_multiarg+0x115>
mov    -0x18(%rbp),%edi
call   10d0 <success_on_line_161@plt>
jmp    12ed <test_va_multiarg+0x11d>
mov    -0x18(%rbp),%edi
call   10e0 <failure_on_line_161@plt>
jmp    12f2 <test_va_multiarg+0x122>
jmp    12f7 <test_va_multiarg+0x127>
jmp    12fc <test_va_multiarg+0x12c>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xd07(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jne    132d <test_va_multiarg+0x15d>
mov    -0x1c(%rbp),%edi
call   1090 <success_on_line_162@plt>
jmp    1335 <test_va_multiarg+0x165>
mov    -0x1c(%rbp),%edi
call   1070 <failure_on_line_162@plt>
jmp    133a <test_va_multiarg+0x16a>
jmp    133f <test_va_multiarg+0x16f>
jmp    1344 <test_va_multiarg+0x174>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
lea    0xcc4(%rip),%rdx
mov    %rsi,%rdi
call   1040 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x10,-0x20(%rbp)
jne    1375 <test_va_multiarg+0x1a5>
mov    -0x20(%rbp),%edi
call   10a0 <success_on_line_164@plt>
jmp    137d <test_va_multiarg+0x1ad>
mov    -0x20(%rbp),%edi
call   1080 <failure_on_line_164@plt>
jmp    1382 <test_va_multiarg+0x1b2>
jmp    1387 <test_va_multiarg+0x1b7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_va_multiarg>:
push   %rbx
mov    %rdi,%rbx
lea    0xe25(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0x8,%eax
jne    11f8 <test_va_multiarg+0x28>
mov    $0x8,%edi
call   10b0 <success_on_line_158@plt>
jmp    11ff <test_va_multiarg+0x2f>
mov    %eax,%edi
call   10c0 <failure_on_line_158@plt>
lea    0xdfe(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0x8,%eax
jne    1223 <test_va_multiarg+0x53>
mov    $0x8,%edi
call   10f0 <success_on_line_159@plt>
jmp    122a <test_va_multiarg+0x5a>
mov    %eax,%edi
call   1030 <failure_on_line_159@plt>
lea    0xdd8(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0x9,%eax
jne    124e <test_va_multiarg+0x7e>
mov    $0x9,%edi
call   1060 <success_on_line_160@plt>
jmp    1255 <test_va_multiarg+0x85>
mov    %eax,%edi
call   1050 <failure_on_line_160@plt>
lea    0xdb1(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0xb,%eax
jne    1279 <test_va_multiarg+0xa9>
mov    $0xb,%edi
call   10d0 <success_on_line_161@plt>
jmp    1280 <test_va_multiarg+0xb0>
mov    %eax,%edi
call   10e0 <failure_on_line_161@plt>
lea    0xd8b(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0xc,%eax
jne    12a4 <test_va_multiarg+0xd4>
mov    $0xc,%edi
call   1090 <success_on_line_162@plt>
jmp    12ab <test_va_multiarg+0xdb>
mov    %eax,%edi
call   1070 <failure_on_line_162@plt>
lea    0xd65(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <vsnprintf@plt>
cmp    $0x10,%eax
jne    12ce <test_va_multiarg+0xfe>
mov    $0x10,%edi
pop    %rbx
jmp    10a0 <success_on_line_164@plt>
mov    %eax,%edi
pop    %rbx
jmp    1080 <failure_on_line_164@plt>

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
@.str = [4 x i8] c"%8x\00"
@.str.1 = [5 x i8] c"% 8x\00"
@.str.2 = [4 x i8] c"%9x\00"
@.str.3 = [5 x i8] c"%11o\00"
@.str.4 = [5 x i8] c"%12o\00"
@.str.5 = [11 x i8] c"%12i %3.2s\00"
define void @test_va_multiarg(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
br label %9
9: ; preds = %1
%10 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%11 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.__va_list_tag* %10)
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i32, i32* %3
br label %19
17: ; preds = %12
%18 = load i32, i32* %3
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%24 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.__va_list_tag* %23)
store i32 %24, i32* %4
br label %25
25: ; preds = %22
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 8
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = load i32, i32* %4
br label %32
30: ; preds = %25
%31 = load i32, i32* %4
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
br label %35
35: ; preds = %34
%36 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%37 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %struct.__va_list_tag* %36)
store i32 %37, i32* %5
br label %38
38: ; preds = %35
%39 = load i32, i32* %5
%40 = icmp eq i32 %39, 9
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = load i32, i32* %5
br label %45
43: ; preds = %38
%44 = load i32, i32* %5
br label %45
45: ; preds = %43, %41
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
%49 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%50 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %struct.__va_list_tag* %49)
store i32 %50, i32* %6
br label %51
51: ; preds = %48
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 11
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = load i32, i32* %6
br label %58
56: ; preds = %51
%57 = load i32, i32* %6
br label %58
58: ; preds = %56, %54
br label %59
59: ; preds = %58
br label %60
60: ; preds = %59
br label %61
61: ; preds = %60
%62 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%63 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %struct.__va_list_tag* %62)
store i32 %63, i32* %7
br label %64
64: ; preds = %61
%65 = load i32, i32* %7
%66 = icmp eq i32 %65, 12
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = load i32, i32* %7
br label %71
69: ; preds = %64
%70 = load i32, i32* %7
br label %71
71: ; preds = %69, %67
br label %72
72: ; preds = %71
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73
%75 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%76 = call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.__va_list_tag* %75)
store i32 %76, i32* %8
br label %77
77: ; preds = %74
%78 = load i32, i32* %8
%79 = icmp eq i32 %78, 16
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = load i32, i32* %8
br label %84
82: ; preds = %77
%83 = load i32, i32* %8
br label %84
84: ; preds = %82, %80
br label %85
85: ; preds = %84
br label %86
86: ; preds = %85
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
@.str = [4 x i8] c"%8x\00"
@.str.1 = [5 x i8] c"% 8x\00"
@.str.2 = [4 x i8] c"%9x\00"
@.str.3 = [5 x i8] c"%11o\00"
@.str.4 = [5 x i8] c"%12o\00"
@.str.5 = [11 x i8] c"%12i %3.2s\00"
define void @test_va_multiarg(%struct.__va_list_tag* %0) {
%2 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.__va_list_tag* %0)
%3 = icmp eq i32 %2, 8
br i1 %3, label %4, label %5
4: ; preds = %1
tail call void @success_on_line_158(i32 8)
br label %6
5: ; preds = %1
tail call void @failure_on_line_158(i32 %2)
br label %6
6: ; preds = %5, %4
%7 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.__va_list_tag* %0)
%8 = icmp eq i32 %7, 8
br i1 %8, label %9, label %10
9: ; preds = %6
tail call void @success_on_line_159(i32 8)
br label %11
10: ; preds = %6
tail call void @failure_on_line_159(i32 %7)
br label %11
11: ; preds = %10, %9
%12 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %struct.__va_list_tag* %0)
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %15
14: ; preds = %11
tail call void @success_on_line_160(i32 9)
br label %16
15: ; preds = %11
tail call void @failure_on_line_160(i32 %12)
br label %16
16: ; preds = %15, %14
%17 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %struct.__va_list_tag* %0)
%18 = icmp eq i32 %17, 11
br i1 %18, label %19, label %20
19: ; preds = %16
tail call void @success_on_line_161(i32 11)
br label %21
20: ; preds = %16
tail call void @failure_on_line_161(i32 %17)
br label %21
21: ; preds = %20, %19
%22 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %struct.__va_list_tag* %0)
%23 = icmp eq i32 %22, 12
br i1 %23, label %24, label %25
24: ; preds = %21
tail call void @success_on_line_162(i32 12)
br label %26
25: ; preds = %21
tail call void @failure_on_line_162(i32 %22)
br label %26
26: ; preds = %25, %24
%27 = tail call i32 @vsnprintf(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.__va_list_tag* %0)
%28 = icmp eq i32 %27, 16
br i1 %28, label %29, label %30
29: ; preds = %26
tail call void @success_on_line_164(i32 16)
br label %31
30: ; preds = %26
tail call void @failure_on_line_164(i32 %27)
br label %31
31: ; preds = %30, %29
ret void
}