#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*/ printak(char *, ...);
int select_default_callback(int n, int type) {
  printak("<0xadff2f>Vistual Information:</>");
  switch (type) {
  case 1:
    printak("<0xcc2222>Pressed key ENTER on selection No.%d.\n</>", n);
    break;
  case 2:
    printak("<0x2222cc>Over the selection No.%d.\n</>", n);
    break;
  default:
    printak("<0x666666>Unknown No.%d.\n</>", n);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<select_default_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printak@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1151 <select_default_callback+0x41>
jmp    1140 <select_default_callback+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1167 <select_default_callback+0x57>
jmp    117d <select_default_callback+0x6d>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printak@plt>
jmp    118e <select_default_callback+0x7e>
mov    -0x4(%rbp),%esi
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printak@plt>
jmp    118e <select_default_callback+0x7e>
mov    -0x4(%rbp),%esi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printak@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_default_callback>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printak@plt>
cmp    $0x2,%ebx
lea    0xf27(%rip),%rax
lea    0xf48(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%ebx
lea    0xede(%rip),%rdi
cmovne %rcx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printak@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"<0xadff2f>Vistual Information:</>\00"
@.str.1 = [52 x i8] c"<0xcc2222>Pressed key ENTER on selection No.%d.\0A</>\00"
@.str.2 = [40 x i8] c"<0x2222cc>Over the selection No.%d.\0A</>\00"
@.str.3 = [29 x i8] c"<0x666666>Unknown No.%d.\0A</>\00"
define i32 @select_default_callback(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printak(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
switch i32 %6, label %13 [
i32 1, label %7
i32 2, label %10
]
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printak(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printak(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printak(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"<0xadff2f>Vistual Information:</>\00"
@.str.1 = [52 x i8] c"<0xcc2222>Pressed key ENTER on selection No.%d.\0A</>\00"
@.str.2 = [40 x i8] c"<0x2222cc>Over the selection No.%d.\0A</>\00"
@.str.3 = [29 x i8] c"<0x666666>Unknown No.%d.\0A</>\00"
define i32 @select_default_callback(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printak(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 2
%5 = select i1 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0)
%6 = icmp eq i32 %1, 1
%7 = select i1 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %5
%8 = tail call i32 (i8*, ...) @printak(i8* %7, i32 %0)
ret i32 0
}