int test_o_var(int i) {
  int n = __builtin_snprintf(0, 0, "%#o", i);
  do {
    extern void failure_on_line_70(void);
    if (!(0 < n && n < 13))
      failure_on_line_70();
  } while (0);
  do {
    extern void keep_call_on_line_72(void);
    if (1 == n)
      keep_call_on_line_72();
  } while (0);
  do {
    extern void keep_call_on_line_73(void);
    if (2 == n)
      keep_call_on_line_73();
  } while (0);
  do {
    extern void keep_call_on_line_74(void);
    if (3 == n)
      keep_call_on_line_74();
  } while (0);
  do {
    extern void keep_call_on_line_75(void);
    if (4 == n)
      keep_call_on_line_75();
  } while (0);
  do {
    extern void keep_call_on_line_76(void);
    if (5 == n)
      keep_call_on_line_76();
  } while (0);
  do {
    extern void keep_call_on_line_77(void);
    if (6 == n)
      keep_call_on_line_77();
  } while (0);
  do {
    extern void keep_call_on_line_78(void);
    if (7 == n)
      keep_call_on_line_78();
  } while (0);
  do {
    extern void keep_call_on_line_79(void);
    if (8 == n)
      keep_call_on_line_79();
  } while (0);
  do {
    extern void keep_call_on_line_80(void);
    if (9 == n)
      keep_call_on_line_80();
  } while (0);
  do {
    extern void keep_call_on_line_81(void);
    if (10 == n)
      keep_call_on_line_81();
  } while (0);
  do {
    extern void keep_call_on_line_82(void);
    if (11 == n)
      keep_call_on_line_82();
  } while (0);
  do {
    extern void keep_call_on_line_83(void);
    if (12 == n)
      keep_call_on_line_83();
  } while (0);
  return n;
}


x86 assembly (clang, -O0):
<test_o_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%esi
lea    0xe07(%rip),%rdx
mov    %rsi,%rdi
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jge    121b <test_o_var+0x3b>
cmpl   $0xd,-0x8(%rbp)
jl     1220 <test_o_var+0x40>
call   10c0 <failure_on_line_70@plt>
jmp    1225 <test_o_var+0x45>
jmp    122a <test_o_var+0x4a>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    123d <test_o_var+0x5d>
call   1090 <keep_call_on_line_72@plt>
jmp    1242 <test_o_var+0x62>
jmp    1247 <test_o_var+0x67>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    125a <test_o_var+0x7a>
call   1040 <keep_call_on_line_73@plt>
jmp    125f <test_o_var+0x7f>
jmp    1264 <test_o_var+0x84>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    1277 <test_o_var+0x97>
call   10b0 <keep_call_on_line_74@plt>
jmp    127c <test_o_var+0x9c>
jmp    1281 <test_o_var+0xa1>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    1294 <test_o_var+0xb4>
call   1030 <keep_call_on_line_75@plt>
jmp    1299 <test_o_var+0xb9>
jmp    129e <test_o_var+0xbe>
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
jne    12b1 <test_o_var+0xd1>
call   10a0 <keep_call_on_line_76@plt>
jmp    12b6 <test_o_var+0xd6>
jmp    12bb <test_o_var+0xdb>
mov    $0x6,%eax
cmp    -0x8(%rbp),%eax
jne    12ce <test_o_var+0xee>
call   10f0 <keep_call_on_line_77@plt>
jmp    12d3 <test_o_var+0xf3>
jmp    12d8 <test_o_var+0xf8>
mov    $0x7,%eax
cmp    -0x8(%rbp),%eax
jne    12eb <test_o_var+0x10b>
call   1080 <keep_call_on_line_78@plt>
jmp    12f0 <test_o_var+0x110>
jmp    12f5 <test_o_var+0x115>
mov    $0x8,%eax
cmp    -0x8(%rbp),%eax
jne    1308 <test_o_var+0x128>
call   1100 <keep_call_on_line_79@plt>
jmp    130d <test_o_var+0x12d>
jmp    1312 <test_o_var+0x132>
mov    $0x9,%eax
cmp    -0x8(%rbp),%eax
jne    1325 <test_o_var+0x145>
call   10e0 <keep_call_on_line_80@plt>
jmp    132a <test_o_var+0x14a>
jmp    132f <test_o_var+0x14f>
mov    $0xa,%eax
cmp    -0x8(%rbp),%eax
jne    1342 <test_o_var+0x162>
call   1060 <keep_call_on_line_81@plt>
jmp    1347 <test_o_var+0x167>
jmp    134c <test_o_var+0x16c>
mov    $0xb,%eax
cmp    -0x8(%rbp),%eax
jne    135f <test_o_var+0x17f>
call   10d0 <keep_call_on_line_82@plt>
jmp    1364 <test_o_var+0x184>
jmp    1369 <test_o_var+0x189>
mov    $0xc,%eax
cmp    -0x8(%rbp),%eax
jne    137c <test_o_var+0x19c>
call   1070 <keep_call_on_line_83@plt>
jmp    1381 <test_o_var+0x1a1>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_o_var>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ecx
lea    0xe43(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
mov    %eax,%r14d
lea    -0x1(%r14),%ebx
cmp    $0xc,%ebx
jb     1209 <test_o_var+0x29>
call   10c0 <failure_on_line_70@plt>
cmp    $0xb,%ebx
ja     1270 <test_o_var+0x90>
lea    0xdeb(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
call   1090 <keep_call_on_line_72@plt>
jmp    1270 <test_o_var+0x90>
call   1040 <keep_call_on_line_73@plt>
jmp    1270 <test_o_var+0x90>
call   10b0 <keep_call_on_line_74@plt>
jmp    1270 <test_o_var+0x90>
call   1030 <keep_call_on_line_75@plt>
jmp    1270 <test_o_var+0x90>
call   10a0 <keep_call_on_line_76@plt>
jmp    1270 <test_o_var+0x90>
call   10f0 <keep_call_on_line_77@plt>
jmp    1270 <test_o_var+0x90>
call   1080 <keep_call_on_line_78@plt>
jmp    1270 <test_o_var+0x90>
call   1100 <keep_call_on_line_79@plt>
jmp    1270 <test_o_var+0x90>
call   10e0 <keep_call_on_line_80@plt>
jmp    1270 <test_o_var+0x90>
call   1060 <keep_call_on_line_81@plt>
jmp    1270 <test_o_var+0x90>
call   10d0 <keep_call_on_line_82@plt>
jmp    1270 <test_o_var+0x90>
call   1070 <keep_call_on_line_83@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%#o\00"
define i32 @test_o_var(i32 %0) {
%2 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 12
br i1 %4, label %6, label %5
5: ; preds = %1
tail call void @failure_on_line_70()
br label %6
6: ; preds = %5, %1
switch i32 %2, label %19 [
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
]
7: ; preds = %6
tail call void @keep_call_on_line_72()
br label %19
8: ; preds = %6
tail call void @keep_call_on_line_73()
br label %19
9: ; preds = %6
tail call void @keep_call_on_line_74()
br label %19
10: ; preds = %6
tail call void @keep_call_on_line_75()
br label %19
11: ; preds = %6
tail call void @keep_call_on_line_76()
br label %19
12: ; preds = %6
tail call void @keep_call_on_line_77()
br label %19
13: ; preds = %6
tail call void @keep_call_on_line_78()
br label %19
14: ; preds = %6
tail call void @keep_call_on_line_79()
br label %19
15: ; preds = %6
tail call void @keep_call_on_line_80()
br label %19
16: ; preds = %6
tail call void @keep_call_on_line_81()
br label %19
17: ; preds = %6
tail call void @keep_call_on_line_82()
br label %19
18: ; preds = %6
tail call void @keep_call_on_line_83()
br label %19
19: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %18
ret i32 %2
}