main() {
  static void *cf[] = {&&next1, &&next2, &&next3, &&next4, &&next5, &&loop};
  static void **prog[] = {cf,     cf + 1, cf,     cf + 2, cf,
                          cf + 3, cf,     cf + 4, cf,     cf + 5};
  void ***ip = prog;
  int count = 10000000;
  goto ***ip++;
next1:
  asm("#"
      "1");
  goto ***ip++;
next2:
  asm("#"
      "2");
  goto ***ip++;
next3:
  asm("#"
      "3");
  goto ***ip++;
next4:
  asm("#"
      "4");
  goto ***ip++;
next5:
  asm("#"
      "5");
  goto ***ip++;
loop:
  if (count > 0) {
    count--;
    ip = prog;
    goto ***ip++;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2f3a(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x989680,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
cmpl   $0x0,-0x14(%rbp)
jle    1221 <main+0x111>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
lea    0x2e61(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <main+0x118>
xor    %edi,%edi
call   1030 <exit@plt>
mov    -0x20(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x989680,%eax
lea    0x2f13(%rip),%rcx
lea    0x2cb4(%rip),%rdx
jmp    1135 <main+0x25>
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%eax
jb     1189 <main+0x79>
mov    %rdx,%rsi
jmp    *(%rcx)
nopw   0x0(%rax,%rax,1)
mov    (%rsi),%rdi
add    $0x8,%rsi
jmp    *(%rdi)
nopl   0x0(%rax)
mov    (%rsi),%rdi
add    $0x8,%rsi
jmp    *(%rdi)
nopl   0x0(%rax)
mov    (%rsi),%rdi
add    $0x8,%rsi
jmp    *(%rdi)
nopl   0x0(%rax)
mov    (%rsi),%rdi
add    $0x8,%rsi
jmp    *(%rdi)
nopl   0x0(%rax)
mov    (%rsi),%rdi
add    $0x8,%rsi
jmp    *(%rdi)
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@main.cf = internal global [6 x i8*] [i8* blockaddress(@main, %8), i8* blockaddress(@main, %13), i8* blockaddress(@main, %18), i8* blockaddress(@main, %23), i8* blockaddress(@main, %28), i8* blockaddress(@main, %33)]
@main.prog = internal global [10 x i8**] [i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 8) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 16) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 24) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 32) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 40) to i8**)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i8***
%3 = alloca i32
store i32 0, i32* %1
store i8*** getelementptr inbounds ([10 x i8**], [10 x i8**]* @main.prog, i64 0, i64 0), i8**** %2
store i32 10000000, i32* %3
%4 = load i8***, i8**** %2
%5 = getelementptr inbounds i8**, i8*** %4, i32 1
store i8*** %5, i8**** %2
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
br label %44
8: ; preds = %44
%9 = load i8***, i8**** %2
%10 = getelementptr inbounds i8**, i8*** %9, i32 1
store i8*** %10, i8**** %2
%11 = load i8**, i8*** %9
%12 = load i8*, i8** %11
br label %44
13: ; preds = %44
%14 = load i8***, i8**** %2
%15 = getelementptr inbounds i8**, i8*** %14, i32 1
store i8*** %15, i8**** %2
%16 = load i8**, i8*** %14
%17 = load i8*, i8** %16
br label %44
18: ; preds = %44
%19 = load i8***, i8**** %2
%20 = getelementptr inbounds i8**, i8*** %19, i32 1
store i8*** %20, i8**** %2
%21 = load i8**, i8*** %19
%22 = load i8*, i8** %21
br label %44
23: ; preds = %44
%24 = load i8***, i8**** %2
%25 = getelementptr inbounds i8**, i8*** %24, i32 1
store i8*** %25, i8**** %2
%26 = load i8**, i8*** %24
%27 = load i8*, i8** %26
br label %44
28: ; preds = %44
%29 = load i8***, i8**** %2
%30 = getelementptr inbounds i8**, i8*** %29, i32 1
store i8*** %30, i8**** %2
%31 = load i8**, i8*** %29
%32 = load i8*, i8** %31
br label %44
33: ; preds = %44
%34 = load i32, i32* %3
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load i32, i32* %3
%38 = add nsw i32 %37, -1
store i32 %38, i32* %3
store i8*** getelementptr inbounds ([10 x i8**], [10 x i8**]* @main.prog, i64 0, i64 0), i8**** %2
%39 = load i8***, i8**** %2
%40 = getelementptr inbounds i8**, i8*** %39, i32 1
store i8*** %40, i8**** %2
%41 = load i8**, i8*** %39
%42 = load i8*, i8** %41
br label %44
43: ; preds = %33
unreachable
44: ; preds = %36, %28, %23, %18, %13, %8, %0
%45 = phi i8* [ %7, %0 ], [ %12, %8 ], [ %17, %13 ], [ %22, %18 ], [ %27, %23 ], [ %32, %28 ], [ %42, %36 ]
indirectbr i8* %45, [label %8, label %13, label %18, label %23, label %28, label %33]
}

LLVM IR (-O2):
@main.cf = internal global [6 x i8*] [i8* blockaddress(@main, %3), i8* blockaddress(@main, %7), i8* blockaddress(@main, %8), i8* blockaddress(@main, %9), i8* blockaddress(@main, %10), i8* blockaddress(@main, %11)]
@main.prog = internal unnamed_addr constant [10 x i8**] [i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 8) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 16) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 24) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 32) to i8**), i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i32 0, i32 0), i8** bitcast (i8* getelementptr (i8, i8* bitcast ([6 x i8*]* @main.cf to i8*), i64 40) to i8**)]
define i32 @main() {
br label %1
1: ; preds = %11, %0
%2 = phi i32 [ %13, %11 ], [ 10000000, %0 ]
br label %15
3: ; preds = %15
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %4
4: ; preds = %3, %7, %8, %9, %10
%5 = load i8**, i8*** %16
%6 = getelementptr inbounds i8**, i8*** %16, i64 1
br label %15
7: ; preds = %15
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %4
8: ; preds = %15
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %4
9: ; preds = %15
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %4
10: ; preds = %15
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %4
11: ; preds = %15
%12 = icmp eq i32 %2, 0
%13 = add nsw i32 %2, -1
br i1 %12, label %14, label %1
14: ; preds = %11
tail call void @exit(i32 0)
unreachable
15: ; preds = %4, %1
%16 = phi i8*** [ getelementptr inbounds ([10 x i8**], [10 x i8**]* @main.prog, i64 0, i64 1), %1 ], [ %6, %4 ]
%17 = phi i8** [ getelementptr inbounds ([6 x i8*], [6 x i8*]* @main.cf, i64 0, i64 0), %1 ], [ %5, %4 ]
%18 = load i8*, i8** %17
indirectbr i8* %18, [label %3, label %7, label %8, label %9, label %10, label %11]
}