#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*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void dh_verbose_cb(int p, int n, void *arg) {
  switch (p) {
  case 0:
    fputs(".", stderr);
    break;
  case 1:
    fputs("+", stderr);
    break;
  case 2:
    fputs("*", stderr);
    break;
  case 3:
    fputs("\n", stderr);
    break;
  }
}


x86 assembly (clang, -O0):
<dh_verbose_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     11aa <dh_verbose_cb+0x9a>
mov    -0x18(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdi
call   1030 <fputs@plt>
jmp    11aa <dh_verbose_cb+0x9a>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1030 <fputs@plt>
jmp    11aa <dh_verbose_cb+0x9a>
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
lea    0xe89(%rip),%rdi
call   1030 <fputs@plt>
jmp    11aa <dh_verbose_cb+0x9a>
mov    0x2e44(%rip),%rax
mov    (%rax),%esi
lea    0xe71(%rip),%rdi
call   1030 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dh_verbose_cb>:
cmp    $0x3,%edi
ja     1134 <dh_verbose_cb+0x24>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @dh_verbose_cb(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %20 [
i32 0, label %8
i32 1, label %11
i32 2, label %14
i32 3, label %17
]
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %20
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %20
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %3
%18 = load i32, i32* @stderr
%19 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %3, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
@reltable.dh_verbose_cb = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.dh_verbose_cb to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.dh_verbose_cb to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.dh_verbose_cb to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.dh_verbose_cb to i64)) to i32)]
define void @dh_verbose_cb(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp ult i32 %0, 4
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = sext i32 %0 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.dh_verbose_cb to i8*), i64 %7)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fputs(i8* %8, i32 %9)
br label %11
11: ; preds = %3, %5
ret void
}