#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 u_int32_t;

/* Variables and functions */
char *get_type(u_int32_t type) {
  switch (type) {
  case 0x00000000:
    return " Logging start";
    break;
  case 0x01010101:
    return "Function entry";
    break;
  case 0x02020202:
    return " Function exit";
    break;
  }
  return " Invalid entry";
}


x86 assembly (clang, -O0):
<get_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1140 <get_type+0x40>
jmp    111a <get_type+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1010101,%eax
je     1150 <get_type+0x50>
jmp    112d <get_type+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x2020202,%eax
je     1160 <get_type+0x60>
jmp    1170 <get_type+0x70>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type+0x7b>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type+0x7b>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type+0x7b>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type>:
test   %edi,%edi
je     111c <get_type+0x1c>
cmp    $0x2020202,%edi
je     1124 <get_type+0x24>
cmp    $0x1010101,%edi
jne    112c <get_type+0x2c>
lea    0xef4(%rip),%rax
ret
lea    0xedd(%rip),%rax
ret
lea    0xef3(%rip),%rax
ret
lea    0xefa(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c" Logging start\00"
@.str.1 = [15 x i8] c"Function entry\00"
@.str.2 = [15 x i8] c" Function exit\00"
@.str.3 = [15 x i8] c" Invalid entry\00"
define i8* @get_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 16843009, label %6
i32 33686018, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [15 x i8] c" Logging start\00"
@.str.1 = [15 x i8] c"Function entry\00"
@.str.2 = [15 x i8] c" Function exit\00"
@.str.3 = [15 x i8] c" Invalid entry\00"
define i8* @get_type(i32 %0) {
switch i32 %0, label %4 [
i32 0, label %5
i32 16843009, label %2
i32 33686018, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}