#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 */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ hk_print(char *, char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ md5sum_print(char *, char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ nsrl_print(char *, char *, int /*<<< orphan*/, int);
void tm_print(int type, char *db_file, char *hash, off_t db_off, int flags) {
  if (type == 1) {
    nsrl_print(db_file, hash, db_off, flags);
  } else if (type == 2) {
    md5sum_print(db_file, hash, db_off, flags);
  } else if (type == 3) {
    hk_print(db_file, hash, db_off, flags);
  }
}


x86 assembly (clang, -O0):
<tm_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    116c <tm_print+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1050 <nsrl_print@plt>
jmp    11b5 <tm_print+0x85>
cmpl   $0x2,-0x4(%rbp)
jne    118e <tm_print+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <md5sum_print@plt>
jmp    11b0 <tm_print+0x80>
cmpl   $0x3,-0x4(%rbp)
jne    11ab <tm_print+0x7b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <hk_print@plt>
jmp    11b0 <tm_print+0x80>
jmp    11b5 <tm_print+0x85>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_print>:
cmp    $0x3,%edi
je     114f <tm_print+0x1f>
cmp    $0x2,%edi
je     115f <tm_print+0x2f>
cmp    $0x1,%edi
jne    116f <tm_print+0x3f>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1050 <nsrl_print@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1040 <hk_print@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <md5sum_print@plt>
ret

LLVM IR (-O0):
define void @tm_print(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %19
13: ; preds = %5
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i32 @nsrl_print(i8* %14, i8* %15, i32 %16, i32 %17)
br label %39
19: ; preds = %5
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i8*, i8** %7
%24 = load i8*, i8** %8
%25 = load i32, i32* %9
%26 = load i32, i32* %10
%27 = call i32 @md5sum_print(i8* %23, i8* %24, i32 %25, i32 %26)
br label %38
28: ; preds = %19
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 3
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i8*, i8** %7
%33 = load i8*, i8** %8
%34 = load i32, i32* %9
%35 = load i32, i32* %10
%36 = call i32 @hk_print(i8* %32, i8* %33, i32 %34, i32 %35)
br label %37
37: ; preds = %31, %28
br label %38
38: ; preds = %37, %22
br label %39
39: ; preds = %38, %13
ret void
}

LLVM IR (-O2):
define void @tm_print(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4) {
switch i32 %0, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %5
%7 = tail call i32 @nsrl_print(i8* %1, i8* %2, i32 %3, i32 %4)
br label %12
8: ; preds = %5
%9 = tail call i32 @md5sum_print(i8* %1, i8* %2, i32 %3, i32 %4)
br label %12
10: ; preds = %5
%11 = tail call i32 @hk_print(i8* %1, i8* %2, i32 %3, i32 %4)
br label %12
12: ; preds = %5, %8, %10, %6
ret void
}