#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ d(int);
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ h(int);
int /*<<< orphan*/ j(int);
int /*<<< orphan*/ l(int);
int /*<<< orphan*/ printf(char *, int);
void c(int x) {
  printf("c(%d)\n", x);
  switch (x) {
  case 2:
    d(2);
    break;
  case 3:
    f(3);
    break;
  case 4:
    h(4);
    break;
  case 5:
    j(5);
    break;
  case 6:
    l(6);
    break;
  }
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11e9 <c+0x89>
mov    -0x10(%rbp),%rax
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
call   1030 <d@plt>
jmp    11e9 <c+0x89>
mov    $0x3,%edi
call   1070 <f@plt>
jmp    11e9 <c+0x89>
mov    $0x4,%edi
call   1060 <h@plt>
jmp    11e9 <c+0x89>
mov    $0x5,%edi
call   1050 <j@plt>
jmp    11e9 <c+0x89>
mov    $0x6,%edi
call   1040 <l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %edi,%ebx
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
call   1080 <printf@plt>
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1194 <c+0x34>
lea    0xe80(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    $0x2,%edi
pop    %rbx
jmp    1030 <d@plt>
pop    %rbx
ret
mov    $0x3,%edi
pop    %rbx
jmp    1070 <f@plt>
mov    $0x4,%edi
pop    %rbx
jmp    1060 <h@plt>
mov    $0x5,%edi
pop    %rbx
jmp    1050 <j@plt>
mov    $0x6,%edi
pop    %rbx
jmp    1040 <l@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"c(%d)\0A\00"
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %16 [
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %14
]
6: ; preds = %1
%7 = call i32 @d(i32 2)
br label %16
8: ; preds = %1
%9 = call i32 @f(i32 3)
br label %16
10: ; preds = %1
%11 = call i32 @h(i32 4)
br label %16
12: ; preds = %1
%13 = call i32 @j(i32 5)
br label %16
14: ; preds = %1
%15 = call i32 @l(i32 6)
br label %16
16: ; preds = %1, %14, %12, %10, %8, %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"c(%d)\0A\00"
define void @c(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
switch i32 %0, label %13 [
i32 2, label %3
i32 3, label %5
i32 4, label %7
i32 5, label %9
i32 6, label %11
]
3: ; preds = %1
%4 = tail call i32 @d(i32 2)
br label %13
5: ; preds = %1
%6 = tail call i32 @f(i32 3)
br label %13
7: ; preds = %1
%8 = tail call i32 @h(i32 4)
br label %13
9: ; preds = %1
%10 = tail call i32 @j(i32 5)
br label %13
11: ; preds = %1
%12 = tail call i32 @l(i32 6)
br label %13
13: ; preds = %1, %11, %9, %7, %5, %3
ret void
}