#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*/ assert(int /*<<< orphan*/);
unsigned int fetch_int();
int /*<<< orphan*/ fetch_skip_audio();
int /*<<< orphan*/ fetch_skip_document();
int /*<<< orphan*/ fetch_skip_geo();
int /*<<< orphan*/ fetch_skip_photo();
int /*<<< orphan*/ fetch_skip_video();
int /*<<< orphan*/ fetch_str(int);
int /*<<< orphan*/ logprintf(char *, unsigned int);
int prefetch_strlen();
void fetch_skip_message_media(void) {
  unsigned x = fetch_int();
  switch (x) {
  case 0x3ded6320:
    break;
  case 0xc8c45a2a:
    fetch_skip_photo();
    break;
  case 0xa2d24290:
    fetch_skip_video();
    break;
  case 0xc6b68300:
    fetch_skip_audio();
    break;
  case 0x2fda2204:
    fetch_skip_document();
    break;
  case 0x56e0d474:
    fetch_skip_geo();
    break;
  case 0x5e7d2f39: {
    int l;
    l = prefetch_strlen();
    fetch_str(l);
    l = prefetch_strlen();
    fetch_str(l);
    l = prefetch_strlen();
    fetch_str(l);
    fetch_int();
  } break;
  case 0x29632a36: {
    int l = prefetch_strlen();
    fetch_str(l);
  } break;
  default:
    logprintf("type = 0x%08x\n", x);
    assert(0);
  }
}


x86 assembly (clang, -O0):
<fetch_skip_message_media>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <fetch_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xa2d24290,%eax
je     125e <fetch_skip_message_media+0xbe>
jmp    11c8 <fetch_skip_message_media+0x28>
mov    -0x10(%rbp),%eax
sub    $0xc6b68300,%eax
je     126a <fetch_skip_message_media+0xca>
jmp    11db <fetch_skip_message_media+0x3b>
mov    -0x10(%rbp),%eax
sub    $0xc8c45a2a,%eax
je     1252 <fetch_skip_message_media+0xb2>
jmp    11ee <fetch_skip_message_media+0x4e>
mov    -0x10(%rbp),%eax
sub    $0x29632a36,%eax
je     12d0 <fetch_skip_message_media+0x130>
jmp    1201 <fetch_skip_message_media+0x61>
mov    -0x10(%rbp),%eax
sub    $0x2fda2204,%eax
je     1276 <fetch_skip_message_media+0xd6>
jmp    1214 <fetch_skip_message_media+0x74>
mov    -0x10(%rbp),%eax
sub    $0x3ded6320,%eax
je     124d <fetch_skip_message_media+0xad>
jmp    1227 <fetch_skip_message_media+0x87>
mov    -0x10(%rbp),%eax
sub    $0x56e0d474,%eax
je     1282 <fetch_skip_message_media+0xe2>
jmp    123a <fetch_skip_message_media+0x9a>
mov    -0x10(%rbp),%eax
sub    $0x5e7d2f39,%eax
je     128e <fetch_skip_message_media+0xee>
jmp    12e7 <fetch_skip_message_media+0x147>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   1080 <fetch_skip_photo@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   1050 <fetch_skip_video@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   10a0 <fetch_skip_audio@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   10b0 <fetch_skip_document@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   1090 <fetch_skip_geo@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fetch_str@plt>
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fetch_str@plt>
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fetch_str@plt>
mov    $0x0,%al
call   1060 <fetch_int@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fetch_str@plt>
jmp    12fd <fetch_skip_message_media+0x15d>
mov    -0x4(%rbp),%esi
lea    0xd0f(%rip),%rdi
call   10c0 <logprintf@plt>
xor    %edi,%edi
call   1070 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_skip_message_media>:
push   %rax
xor    %eax,%eax
call   1060 <fetch_int@plt>
cmp    $0x2fda2203,%eax
jg     11d4 <fetch_skip_message_media+0x34>
cmp    $0xc8c45a29,%eax
jg     11eb <fetch_skip_message_media+0x4b>
cmp    $0xa2d24290,%eax
je     1248 <fetch_skip_message_media+0xa8>
cmp    $0xc6b68300,%eax
jne    1268 <fetch_skip_message_media+0xc8>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <fetch_skip_audio@plt>
cmp    $0x56e0d473,%eax
jg     1208 <fetch_skip_message_media+0x68>
cmp    $0x2fda2204,%eax
je     1250 <fetch_skip_message_media+0xb0>
cmp    $0x3ded6320,%eax
jne    1268 <fetch_skip_message_media+0xc8>
pop    %rax
ret
cmp    $0xc8c45a2a,%eax
je     1258 <fetch_skip_message_media+0xb8>
cmp    $0x29632a36,%eax
jne    1268 <fetch_skip_message_media+0xc8>
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fetch_str@plt>
cmp    $0x56e0d474,%eax
je     1260 <fetch_skip_message_media+0xc0>
cmp    $0x5e7d2f39,%eax
jne    1268 <fetch_skip_message_media+0xc8>
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%edi
call   1040 <fetch_str@plt>
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%edi
call   1040 <fetch_str@plt>
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%edi
call   1040 <fetch_str@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <fetch_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <fetch_skip_video@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <fetch_skip_document@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <fetch_skip_photo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <fetch_skip_geo@plt>
lea    0xd91(%rip),%rdi
mov    %eax,%esi
call   10c0 <logprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1070 <assert@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"type = 0x%08x\0A\00"
define void @fetch_skip_message_media() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @fetch_int()
store i32 %4, i32* %1
%5 = load i32, i32* %1
switch i32 %5, label %32 [
i32 1038967584, label %6
i32 -926655958, label %7
i32 -1563278704, label %9
i32 -961117440, label %11
i32 802824708, label %13
i32 1457575028, label %15
i32 1585262393, label %17
i32 694364726, label %28
]
6: ; preds = %0
br label %36
7: ; preds = %0
%8 = call i32 (...) @fetch_skip_photo()
br label %36
9: ; preds = %0
%10 = call i32 (...) @fetch_skip_video()
br label %36
11: ; preds = %0
%12 = call i32 (...) @fetch_skip_audio()
br label %36
13: ; preds = %0
%14 = call i32 (...) @fetch_skip_document()
br label %36
15: ; preds = %0
%16 = call i32 (...) @fetch_skip_geo()
br label %36
17: ; preds = %0
%18 = call i32 (...) @prefetch_strlen()
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @fetch_str(i32 %19)
%21 = call i32 (...) @prefetch_strlen()
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = call i32 @fetch_str(i32 %22)
%24 = call i32 (...) @prefetch_strlen()
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = call i32 @fetch_str(i32 %25)
%27 = call i32 (...) @fetch_int()
br label %36
28: ; preds = %0
%29 = call i32 (...) @prefetch_strlen()
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = call i32 @fetch_str(i32 %30)
br label %36
32: ; preds = %0
%33 = load i32, i32* %1
%34 = call i32 @logprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = call i32 @assert(i32 0)
br label %36
36: ; preds = %32, %28, %17, %15, %13, %11, %9, %7, %6
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"type = 0x%08x\0A\00"
define void @fetch_skip_message_media() {
%1 = tail call i32 (...) @fetch_int()
switch i32 %1, label %23 [
i32 1038967584, label %26
i32 -926655958, label %2
i32 -1563278704, label %4
i32 -961117440, label %6
i32 802824708, label %8
i32 1457575028, label %10
i32 1585262393, label %12
i32 694364726, label %20
]
2: ; preds = %0
%3 = tail call i32 (...) @fetch_skip_photo()
br label %26
4: ; preds = %0
%5 = tail call i32 (...) @fetch_skip_video()
br label %26
6: ; preds = %0
%7 = tail call i32 (...) @fetch_skip_audio()
br label %26
8: ; preds = %0
%9 = tail call i32 (...) @fetch_skip_document()
br label %26
10: ; preds = %0
%11 = tail call i32 (...) @fetch_skip_geo()
br label %26
12: ; preds = %0
%13 = tail call i32 (...) @prefetch_strlen()
%14 = tail call i32 @fetch_str(i32 %13)
%15 = tail call i32 (...) @prefetch_strlen()
%16 = tail call i32 @fetch_str(i32 %15)
%17 = tail call i32 (...) @prefetch_strlen()
%18 = tail call i32 @fetch_str(i32 %17)
%19 = tail call i32 (...) @fetch_int()
br label %26
20: ; preds = %0
%21 = tail call i32 (...) @prefetch_strlen()
%22 = tail call i32 @fetch_str(i32 %21)
br label %26
23: ; preds = %0
%24 = tail call i32 @logprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%25 = tail call i32 @assert(i32 0)
br label %26
26: ; preds = %23, %20, %12, %10, %8, %6, %4, %2, %0
ret void
}