void printGesture(int g, int *delta, int *val) {
  switch (g) {
  case 0:
    DEBUG_PRINTLN("*none");
    break;
  case 1:
    break;
  case 2:
    DEBUG_PRINTLN("TAP");
    break;
  case 3:
    DEBUG_PRINTLN("DUBBLE TAP");
    break;
  case 4:
    DEBUG_PRINTLN("RELEASE");
    break;
  case 5:
    DEBUG_PRINT("HOVER CHANGE: ");
    DEBUG_PRINT(*delta);
    DEBUG_PRINT(" -> ");
    DEBUG_PRINTLN(*val);
    break;
  case 6:
    DEBUG_PRINT("PRESS: ");
    DEBUG_PRINTLN(*val);
    break;
  default:
    DEBUG_PRINTLN("ERR");
    break;
  }
}


x86 assembly (clang, -O0):
<printGesture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x6,%rax
ja     1204 <printGesture+0xe4>
mov    -0x20(%rbp),%rax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
jmp    1212 <printGesture+0xf2>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <DEBUG_PRINT@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1040 <DEBUG_PRINT@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <DEBUG_PRINT@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <DEBUG_PRINT@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
jmp    1212 <printGesture+0xf2>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG_PRINTLN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printGesture>:
push   %r14
push   %rbx
push   %rax
cmp    $0x6,%edi
ja     1147 <printGesture+0x27>
mov    %rdx,%r14
mov    %edi,%eax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed7(%rip),%rdi
jmp    1171 <printGesture+0x51>
lea    0xf03(%rip),%rdi
jmp    1171 <printGesture+0x51>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeca(%rip),%rdi
jmp    1171 <printGesture+0x51>
lea    0xeba(%rip),%rdi
jmp    1171 <printGesture+0x51>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <DEBUG_PRINTLN@plt>
mov    %rsi,%rbx
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <DEBUG_PRINT@plt>
mov    (%rbx),%edi
xor    %eax,%eax
call   1040 <DEBUG_PRINT@plt>
lea    0xea4(%rip),%rdi
jmp    11a9 <printGesture+0x89>
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <DEBUG_PRINT@plt>
mov    (%r14),%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <DEBUG_PRINTLN@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"*none\00"
@.str.1 = [4 x i8] c"TAP\00"
@.str.2 = [11 x i8] c"DUBBLE TAP\00"
@.str.3 = [8 x i8] c"RELEASE\00"
@.str.4 = [15 x i8] c"HOVER CHANGE: \00"
@.str.5 = [5 x i8] c" -> \00"
@.str.6 = [8 x i8] c"PRESS: \00"
@.str.7 = [4 x i8] c"ERR\00"
define void @printGesture(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
switch i32 %7, label %31 [
i32 0, label %8
i32 1, label %10
i32 2, label %11
i32 3, label %13
i32 4, label %15
i32 5, label %17
i32 6, label %26
]
8: ; preds = %3
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %33
10: ; preds = %3
br label %33
11: ; preds = %3
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %33
13: ; preds = %3
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %33
15: ; preds = %3
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %33
17: ; preds = %3
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i32, ...)*)(i32 %20)
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32*, i32** %6
%24 = load i32, i32* %23
%25 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i32, ...)*)(i32 %24)
br label %33
26: ; preds = %3
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%28 = load i32*, i32** %6
%29 = load i32, i32* %28
%30 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i32, ...)*)(i32 %29)
br label %33
31: ; preds = %3
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %26, %17, %15, %13, %11, %10, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"*none\00"
@.str.1 = [4 x i8] c"TAP\00"
@.str.2 = [11 x i8] c"DUBBLE TAP\00"
@.str.3 = [8 x i8] c"RELEASE\00"
@.str.4 = [15 x i8] c"HOVER CHANGE: \00"
@.str.5 = [5 x i8] c" -> \00"
@.str.6 = [8 x i8] c"PRESS: \00"
@.str.7 = [4 x i8] c"ERR\00"
define void @printGesture(i32 %0, i32* nocapture %1, i32* nocapture %2) {
switch i32 %0, label %23 [
i32 0, label %4
i32 1, label %25
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %19
]
4: ; preds = %3
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %25
6: ; preds = %3
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %25
8: ; preds = %3
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %25
10: ; preds = %3
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %25
12: ; preds = %3
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i32, ...)*)(i32 %14)
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i32, ...)*)(i32 %17)
br label %25
19: ; preds = %3
%20 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINT to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i32, ...)*)(i32 %21)
br label %25
23: ; preds = %3
%24 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG_PRINTLN to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %25
25: ; preds = %23, %19, %12, %10, %8, %6, %3, %4
ret void
}