void test_hho_cst(void) {
  do {
    extern void failure_on_line_27(void);
    if (!(1 == __builtin_snprintf(0, 0, "%#.1hho", 0)))
      failure_on_line_27();
  } while (0);
  do {
    extern void failure_on_line_28(void);
    if (!(2 == __builtin_snprintf(0, 0, "%#.2hho", 0)))
      failure_on_line_28();
  } while (0);
  do {
    extern void failure_on_line_30(void);
    if (!(2 == __builtin_snprintf(0, 0, "%#.1hho", 1)))
      failure_on_line_30();
  } while (0);
  do {
    extern void failure_on_line_31(void);
    if (!(2 == __builtin_snprintf(0, 0, "%#.2hho", 1)))
      failure_on_line_31();
  } while (0);
  do {
    extern void failure_on_line_32(void);
    if (!(3 == __builtin_snprintf(0, 0, "%#.3hho", 1)))
      failure_on_line_32();
  } while (0);
}


x86 assembly (clang, -O0):
<test_hho_cst>:
push   %rbp
mov    %rsp,%rbp
jmp    1169 <test_hho_cst+0x9>
xor    %eax,%eax
mov    %eax,%esi
lea    0xe8c(%rip),%rdx
xor    %ecx,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1194 <test_hho_cst+0x34>
call   1080 <failure_on_line_27@plt>
jmp    1199 <test_hho_cst+0x39>
jmp    119e <test_hho_cst+0x3e>
xor    %eax,%eax
mov    %eax,%esi
lea    0xe5f(%rip),%rdx
xor    %ecx,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     11c9 <test_hho_cst+0x69>
call   1060 <failure_on_line_28@plt>
jmp    11ce <test_hho_cst+0x6e>
jmp    11d3 <test_hho_cst+0x73>
xor    %eax,%eax
mov    %eax,%esi
lea    0xe22(%rip),%rdx
mov    $0x1,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1201 <test_hho_cst+0xa1>
call   1040 <failure_on_line_30@plt>
jmp    1206 <test_hho_cst+0xa6>
jmp    120b <test_hho_cst+0xab>
xor    %eax,%eax
mov    %eax,%esi
lea    0xdf2(%rip),%rdx
mov    $0x1,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1239 <test_hho_cst+0xd9>
call   1070 <failure_on_line_31@plt>
jmp    123e <test_hho_cst+0xde>
jmp    1243 <test_hho_cst+0xe3>
xor    %eax,%eax
mov    %eax,%esi
lea    0xdc2(%rip),%rdx
mov    $0x1,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     1271 <test_hho_cst+0x111>
call   1030 <failure_on_line_32@plt>
jmp    1276 <test_hho_cst+0x116>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hho_cst>:
push   %rax
lea    0xe98(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmp    $0x1,%eax
je     117f <test_hho_cst+0x1f>
call   1080 <failure_on_line_27@plt>
lea    0xe82(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmp    $0x2,%eax
je     119d <test_hho_cst+0x3d>
call   1060 <failure_on_line_28@plt>
lea    0xe5c(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmp    $0x2,%eax
je     11be <test_hho_cst+0x5e>
call   1040 <failure_on_line_30@plt>
lea    0xe43(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmp    $0x2,%eax
je     11df <test_hho_cst+0x7f>
call   1070 <failure_on_line_31@plt>
lea    0xe2a(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmp    $0x3,%eax
jne    11fd <test_hho_cst+0x9d>
pop    %rax
ret
pop    %rax
jmp    1030 <failure_on_line_32@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%#.1hho\00"
@.str.1 = [8 x i8] c"%#.2hho\00"
@.str.2 = [8 x i8] c"%#.3hho\00"
define void @test_hho_cst() {
br label %1
1: ; preds = %0
%2 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i32 1, %2
br i1 %3, label %5, label %4
4: ; preds = %1
br label %5
5: ; preds = %4, %1
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
%8 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%9 = icmp eq i32 2, %8
br i1 %9, label %11, label %10
10: ; preds = %7
br label %11
11: ; preds = %10, %7
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
%14 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%15 = icmp eq i32 2, %14
br i1 %15, label %17, label %16
16: ; preds = %13
br label %17
17: ; preds = %16, %13
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%21 = icmp eq i32 2, %20
br i1 %21, label %23, label %22
22: ; preds = %19
br label %23
23: ; preds = %22, %19
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
%26 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
%27 = icmp eq i32 3, %26
br i1 %27, label %29, label %28
28: ; preds = %25
br label %29
29: ; preds = %28, %25
br label %30
30: ; preds = %29
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%#.1hho\00"
@.str.1 = [8 x i8] c"%#.2hho\00"
@.str.2 = [8 x i8] c"%#.3hho\00"
define void @test_hho_cst() {
%1 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 1
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @failure_on_line_27()
br label %4
4: ; preds = %3, %0
%5 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = icmp eq i32 %5, 2
br i1 %6, label %8, label %7
7: ; preds = %4
tail call void @failure_on_line_28()
br label %8
8: ; preds = %7, %4
%9 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = icmp eq i32 %9, 2
br i1 %10, label %12, label %11
11: ; preds = %8
tail call void @failure_on_line_30()
br label %12
12: ; preds = %11, %8
%13 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%14 = icmp eq i32 %13, 2
br i1 %14, label %16, label %15
15: ; preds = %12
tail call void @failure_on_line_31()
br label %16
16: ; preds = %15, %12
%17 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
%18 = icmp eq i32 %17, 3
br i1 %18, label %20, label %19
19: ; preds = %16
tail call void @failure_on_line_32()
br label %20
20: ; preds = %16, %19
ret void
}