#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*/ proc1();
void c(unsigned int param1) {
  proc1();
  if (param1 <= 6) {
    switch (param1) {
    case 0:
    case 1:
    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;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1080 <proc1@plt>
cmpl   $0x6,-0x4(%rbp)
ja     11ec <c+0x8c>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     11e7 <c+0x87>
mov    -0x10(%rbp),%rax
lea    0xe68(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
call   1030 <d@plt>
jmp    11e7 <c+0x87>
mov    $0x3,%edi
call   1070 <f@plt>
jmp    11e7 <c+0x87>
mov    $0x4,%edi
call   1060 <h@plt>
jmp    11e7 <c+0x87>
mov    $0x5,%edi
call   1050 <j@plt>
jmp    11e7 <c+0x87>
mov    $0x6,%edi
call   1040 <l@plt>
jmp    11ec <c+0x8c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1080 <proc1@plt>
cmp    $0x6,%ebx
ja     118e <c+0x2e>
ja     118e <c+0x2e>
mov    %ebx,%eax
lea    0xe86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
pop    %rbx
jmp    1030 <d@plt>
pop    %rbx
ret
mov    $0x3,%edi
pop    %rbx
jmp    1070 <f@plt>
mov    $0x5,%edi
pop    %rbx
jmp    1050 <j@plt>
mov    $0x6,%edi
pop    %rbx
jmp    1040 <l@plt>
mov    $0x4,%edi
pop    %rbx
jmp    1060 <h@plt>

LLVM IR (-O0):
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @proc1()
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, 6
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i32, i32* %2
switch i32 %7, label %18 [
i32 0, label %8
i32 1, label %8
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
]
8: ; preds = %6, %6, %6
%9 = call i32 @d(i32 2)
br label %18
10: ; preds = %6
%11 = call i32 @f(i32 3)
br label %18
12: ; preds = %6
%13 = call i32 @h(i32 4)
br label %18
14: ; preds = %6
%15 = call i32 @j(i32 5)
br label %18
16: ; preds = %6
%17 = call i32 @l(i32 6)
br label %18
18: ; preds = %6, %16, %14, %12, %10, %8
br label %19
19: ; preds = %18, %1
ret void
}

LLVM IR (-O2):
define void @c(i32 %0) {
%2 = tail call i32 (...) @proc1()
%3 = icmp ult i32 %0, 7
br i1 %3, label %4, label %15
4: ; preds = %1
switch i32 %0, label %15 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %7
i32 4, label %9
i32 5, label %11
i32 6, label %13
]
5: ; preds = %4, %4, %4
%6 = tail call i32 @d(i32 2)
br label %15
7: ; preds = %4
%8 = tail call i32 @f(i32 3)
br label %15
9: ; preds = %4
%10 = tail call i32 @h(i32 4)
br label %15
11: ; preds = %4
%12 = tail call i32 @j(i32 5)
br label %15
13: ; preds = %4
%14 = tail call i32 @l(i32 6)
br label %15
15: ; preds = %5, %7, %9, %11, %13, %4, %1
ret void
}