int main(int argc, char **argv) {
  void *where[4];
  void *const fin = &&last;
  void *p;
  int i = 0;
  int *next = &&pick;
  where[0] = &&a;
  where[1] = &&b;
  where[2] = &&c;
  where[3] = &&last;
  printf("p = %p (argc=%d), a=%p b=%p c=%p\n", p, argc, &&a, &&b, &&c);
pick:
  p = where[i++];
  goto *p;
a:
  printf("1\n");
  goto *next;
b:
  printf("2\n");
  goto *next;
c:
  printf("3\n");
  goto *next;
last:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xd9(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x44(%rbp)
lea    0x53(%rip),%rcx
mov    %rcx,-0x50(%rbp)
lea    0x6b(%rip),%rcx
mov    %rcx,-0x30(%rbp)
lea    0x7b(%rip),%rcx
mov    %rcx,-0x28(%rbp)
lea    0x8b(%rip),%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
lea    0x36(%rip),%rcx
lea    0x4a(%rip),%r8
lea    0x5e(%rip),%r9
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
cltq
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    120e <main+0xfe>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    120e <main+0xfe>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    120e <main+0xfe>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    120e <main+0xfe>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret
mov    -0x58(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%edx
lea    0x73(%rip),%r8
movq   %r8,%xmm0
lea    0x5e(%rip),%rcx
movq   %rcx,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm1,(%rsp)
lea    0x70(%rip),%rax
movq   %rax,%xmm0
lea    0x5b(%rip),%r9
movq   %r9,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm1,0x10(%rsp)
lea    0xe8d(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%r14),%rbx
jmp    *(%rsp,%r14,8)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rax
add    $0x1,%rbx
jmp    *(%rsp,%rax,8)
lea    0xe85(%rip),%rdi
jmp    11aa <main+0x8a>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
lea    -0x26(%rip),%rax
jmp    *%rax
lea    0xe63(%rip),%rdi
jmp    11aa <main+0x8a>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"p = %p (argc=%d), a=%p b=%p c=%p\0A\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [3 x i8] c"2\0A\00"
@.str.3 = [3 x i8] c"3\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8*]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* blockaddress(@main, %37), i8** %7
store i32 0, i32* %9
store i32* bitcast (i8* blockaddress(@main, %18) to i32*), i32** %10
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
store i8* blockaddress(@main, %25), i8** %11
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 1
store i8* blockaddress(@main, %29), i8** %12
%13 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 2
store i8* blockaddress(@main, %33), i8** %13
%14 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 3
store i8* blockaddress(@main, %37), i8** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* blockaddress(@main, %25), i8* blockaddress(@main, %29), i8* blockaddress(@main, %33))
br label %18
18: ; preds = %2, %38
%19 = load i32, i32* %9
%20 = add nsw i32 %19, 1
store i32 %20, i32* %9
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %21
%23 = load i8*, i8** %22
store i8* %23, i8** %8
%24 = load i8*, i8** %8
br label %38
25: ; preds = %38, %38
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32*, i32** %10
%28 = bitcast i32* %27 to i8*
br label %38
29: ; preds = %38, %38
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32*, i32** %10
%32 = bitcast i32* %31 to i8*
br label %38
33: ; preds = %38, %38
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32*, i32** %10
%36 = bitcast i32* %35 to i8*
br label %38
37: ; preds = %38, %38
ret i32 0
38: ; preds = %33, %29, %25, %18
%39 = phi i8* [ %24, %18 ], [ %28, %25 ], [ %32, %29 ], [ %36, %33 ]
indirectbr i8* %39, [label %37, label %18, label %25, label %29, label %33, label %37, label %25, label %29, label %33]
}

LLVM IR (-O2):
@.str = [34 x i8] c"p = %p (argc=%d), a=%p b=%p c=%p\0A\00"
@str = [2 x i8] c"3\00"
@str.4 = [2 x i8] c"2\00"
@str.5 = [2 x i8] c"1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8*]
%4 = bitcast [4 x i8*]* %3 to <2 x i8*>*
store <2 x i8*> <i8* blockaddress(@main, %13), i8* blockaddress(@main, %14)>, <2 x i8*>* %4
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 2
%6 = bitcast i8** %5 to <2 x i8*>*
store <2 x i8*> <i8* blockaddress(@main, %17), i8* blockaddress(@main, %18)>, <2 x i8*>* %6
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* undef, i32 %0, i8* blockaddress(@main, %13), i8* blockaddress(@main, %14), i8* blockaddress(@main, %17))
br label %8
8: ; preds = %2, %19
%9 = phi i64 [ 0, %2 ], [ %12, %19 ]
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = add nuw i64 %9, 1
br label %19
13: ; preds = %19
br label %14
14: ; preds = %19, %13, %17
%15 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), %13 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %17 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0), %19 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
br label %19
17: ; preds = %19
br label %14
18: ; preds = %19
ret i32 0
19: ; preds = %14, %8
%20 = phi i8* [ %11, %8 ], [ blockaddress(@main, %8), %14 ]
indirectbr i8* %20, [label %18, label %8, label %13, label %14, label %17]
}