main() {
  static void *prog[] = {&&next1, &&next2, &&next1, &&next3, &&next1,
                         &&next4, &&next1, &&next5, &&next1, &&loop};
  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    0x2f0a(%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,-0x20(%rbp)
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1213 <main+0x103>
cmpl   $0x0,-0x14(%rbp)
jle    120c <main+0xfc>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
lea    0x2e43(%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,-0x20(%rbp)
jmp    1213 <main+0x103>
xor    %edi,%edi
call   1030 <exit@plt>
mov    -0x20(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x989680,%eax
lea    0x23(%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.prog = internal global [10 x i8*] [i8* blockaddress(@main, %7), i8* blockaddress(@main, %11), i8* blockaddress(@main, %7), i8* blockaddress(@main, %15), i8* blockaddress(@main, %7), i8* blockaddress(@main, %19), i8* blockaddress(@main, %7), i8* blockaddress(@main, %23), i8* blockaddress(@main, %7), i8* blockaddress(@main, %27)]
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
br label %37
7: ; preds = %37, %37, %37, %37, %37
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %2
%10 = load i8*, i8** %8
br label %37
11: ; preds = %37
%12 = load i8**, i8*** %2
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %2
%14 = load i8*, i8** %12
br label %37
15: ; preds = %37
%16 = load i8**, i8*** %2
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %2
%18 = load i8*, i8** %16
br label %37
19: ; preds = %37
%20 = load i8**, i8*** %2
%21 = getelementptr inbounds i8*, i8** %20, i32 1
store i8** %21, i8*** %2
%22 = load i8*, i8** %20
br label %37
23: ; preds = %37
%24 = load i8**, i8*** %2
%25 = getelementptr inbounds i8*, i8** %24, i32 1
store i8** %25, i8*** %2
%26 = load i8*, i8** %24
br label %37
27: ; preds = %37
%28 = load i32, i32* %3
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %3
%32 = add nsw i32 %31, -1
store i32 %32, i32* %3
store i8** getelementptr inbounds ([10 x i8*], [10 x i8*]* @main.prog, i64 0, i64 0), i8*** %2
%33 = load i8**, i8*** %2
%34 = getelementptr inbounds i8*, i8** %33, i32 1
store i8** %34, i8*** %2
%35 = load i8*, i8** %33
br label %37
36: ; preds = %27
unreachable
37: ; preds = %30, %23, %19, %15, %11, %7, %0
%38 = phi i8* [ %6, %0 ], [ %10, %7 ], [ %14, %11 ], [ %18, %15 ], [ %22, %19 ], [ %26, %23 ], [ %35, %30 ]
indirectbr i8* %38, [label %7, label %11, label %7, label %15, label %7, label %19, label %7, label %23, label %7, label %27]
}

LLVM IR (-O2):
@main.prog = internal unnamed_addr constant [10 x i8*] [i8* blockaddress(@main, %3), i8* blockaddress(@main, %7), i8* blockaddress(@main, %3), i8* blockaddress(@main, %8), i8* blockaddress(@main, %3), i8* blockaddress(@main, %9), i8* blockaddress(@main, %3), i8* blockaddress(@main, %10), i8* blockaddress(@main, %3), i8* blockaddress(@main, %11)]
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* [ blockaddress(@main, %3), %1 ], [ %5, %4 ]
indirectbr i8* %17, [label %3, label %7, label %11, label %8, label %10, label %9]
}