#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 */
struct Event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ compl_1_1(struct Event *);
int /*<<< orphan*/ compl_1_2(struct Event *);
int /*<<< orphan*/ compl_2_1(struct Event *);
int /*<<< orphan*/ compl_2_2(struct Event *);
int get_event_type(struct Event *);
void decrease_job(struct Event *ev) {
  switch (get_event_type(ev)) {
  case 3:
    compl_1_1(ev);
    break;
  case 4:
    compl_1_2(ev);
    break;
  case 5:
    compl_2_1(ev);
    break;
  case 6:
    compl_2_2(ev);
    break;
  }
}


x86 assembly (clang, -O0):
<decrease_job>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_event_type@plt>
add    $0xfffffffd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11be <decrease_job+0x6e>
mov    -0x10(%rbp),%rax
lea    0xe7e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
call   1050 <compl_1_1@plt>
jmp    11be <decrease_job+0x6e>
mov    -0x8(%rbp),%rdi
call   1070 <compl_1_2@plt>
jmp    11be <decrease_job+0x6e>
mov    -0x8(%rbp),%rdi
call   1040 <compl_2_1@plt>
jmp    11be <decrease_job+0x6e>
mov    -0x8(%rbp),%rdi
call   1060 <compl_2_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease_job>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_event_type@plt>
add    $0xfffffffd,%eax
cmp    $0x3,%eax
ja     117a <decrease_job+0x2a>
lea    0xe98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <compl_1_1@plt>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <compl_1_2@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <compl_2_1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <compl_2_2@plt>

LLVM IR (-O0):
%struct.Event = type { i32 }
define void @decrease_job(%struct.Event* %0) {
%2 = alloca %struct.Event*
store %struct.Event* %0, %struct.Event** %2
%3 = load %struct.Event*, %struct.Event** %2
%4 = call i32 @get_event_type(%struct.Event* %3)
switch i32 %4, label %17 [
i32 3, label %5
i32 4, label %8
i32 5, label %11
i32 6, label %14
]
5: ; preds = %1
%6 = load %struct.Event*, %struct.Event** %2
%7 = call i32 @compl_1_1(%struct.Event* %6)
br label %17
8: ; preds = %1
%9 = load %struct.Event*, %struct.Event** %2
%10 = call i32 @compl_1_2(%struct.Event* %9)
br label %17
11: ; preds = %1
%12 = load %struct.Event*, %struct.Event** %2
%13 = call i32 @compl_2_1(%struct.Event* %12)
br label %17
14: ; preds = %1
%15 = load %struct.Event*, %struct.Event** %2
%16 = call i32 @compl_2_2(%struct.Event* %15)
br label %17
17: ; preds = %1, %14, %11, %8, %5
ret void
}

LLVM IR (-O2):
%struct.Event = type { i32 }
define void @decrease_job(%struct.Event* %0) {
%2 = tail call i32 @get_event_type(%struct.Event* %0)
switch i32 %2, label %11 [
i32 3, label %3
i32 4, label %5
i32 5, label %7
i32 6, label %9
]
3: ; preds = %1
%4 = tail call i32 @compl_1_1(%struct.Event* %0)
br label %11
5: ; preds = %1
%6 = tail call i32 @compl_1_2(%struct.Event* %0)
br label %11
7: ; preds = %1
%8 = tail call i32 @compl_2_1(%struct.Event* %0)
br label %11
9: ; preds = %1
%10 = tail call i32 @compl_2_2(%struct.Event* %0)
br label %11
11: ; preds = %1, %9, %7, %5, %3
ret void
}