#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 */
struct s_reader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cCamCryptVG_Decrypt_D3(struct s_reader *, unsigned char *,
                                          unsigned char *, unsigned char *);
int /*<<< orphan*/ cCamCryptVG_Process_D0(struct s_reader *, unsigned char *,
                                          unsigned char *);
int /*<<< orphan*/ cCamCryptVG_Process_D1(struct s_reader *, unsigned char *,
                                          unsigned char *, unsigned char *);
void cCamCryptVG_PostProcess_Decrypt(struct s_reader *reader,
                                     unsigned char *rxbuff) {
  switch (rxbuff[0]) {
  case 0xD0:
    cCamCryptVG_Process_D0(reader, rxbuff, rxbuff + 5);
    break;
  case 0xD1:
    cCamCryptVG_Process_D1(reader, rxbuff, rxbuff + 5, rxbuff + rxbuff[4] + 5);
    break;
  case 0xD3:
    cCamCryptVG_Decrypt_D3(reader, rxbuff, rxbuff + 5, rxbuff + rxbuff[4] + 5);
    break;
  }
}


x86 assembly (clang, -O0):
<cCamCryptVG_PostProcess_Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0xd0,%eax
je     1180 <cCamCryptVG_PostProcess_Decrypt+0x50>
jmp    115a <cCamCryptVG_PostProcess_Decrypt+0x2a>
mov    -0x14(%rbp),%eax
sub    $0xd1,%eax
je     119a <cCamCryptVG_PostProcess_Decrypt+0x6a>
jmp    116d <cCamCryptVG_PostProcess_Decrypt+0x3d>
mov    -0x14(%rbp),%eax
sub    $0xd3,%eax
je     11c9 <cCamCryptVG_PostProcess_Decrypt+0x99>
jmp    11f3 <cCamCryptVG_PostProcess_Decrypt+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x5,%rdx
call   1030 <cCamCryptVG_Process_D0@plt>
jmp    11f3 <cCamCryptVG_PostProcess_Decrypt+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x5,%rdx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
cltq
add    %rax,%rcx
add    $0x5,%rcx
call   1040 <cCamCryptVG_Process_D1@plt>
jmp    11f3 <cCamCryptVG_PostProcess_Decrypt+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x5,%rdx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
cltq
add    %rax,%rcx
add    $0x5,%rcx
call   1050 <cCamCryptVG_Decrypt_D3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cCamCryptVG_PostProcess_Decrypt>:
mov    (%rsi),%al
cmp    $0xd3,%al
je     1147 <cCamCryptVG_PostProcess_Decrypt+0x17>
cmp    $0xd1,%al
je     115c <cCamCryptVG_PostProcess_Decrypt+0x2c>
cmp    $0xd0,%al
jne    1171 <cCamCryptVG_PostProcess_Decrypt+0x41>
lea    0x5(%rsi),%rdx
jmp    1030 <cCamCryptVG_Process_D0@plt>
lea    0x5(%rsi),%rdx
movzbl 0x4(%rsi),%eax
lea    (%rsi,%rax,1),%rcx
add    $0x5,%rcx
jmp    1050 <cCamCryptVG_Decrypt_D3@plt>
lea    0x5(%rsi),%rdx
movzbl 0x4(%rsi),%eax
lea    (%rsi,%rax,1),%rcx
add    $0x5,%rcx
jmp    1040 <cCamCryptVG_Process_D1@plt>
ret

LLVM IR (-O0):
%struct.s_reader = type { i32 }
define void @cCamCryptVG_PostProcess_Decrypt(%struct.s_reader* %0, i8* %1) {
%3 = alloca %struct.s_reader*
%4 = alloca i8*
store %struct.s_reader* %0, %struct.s_reader** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
switch i32 %8, label %43 [
i32 208, label %9
i32 209, label %15
i32 211, label %29
]
9: ; preds = %2
%10 = load %struct.s_reader*, %struct.s_reader** %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 5
%14 = call i32 @cCamCryptVG_Process_D0(%struct.s_reader* %10, i8* %11, i8* %13)
br label %43
15: ; preds = %2
%16 = load %struct.s_reader*, %struct.s_reader** %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 5
%20 = load i8*, i8** %4
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 4
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %20, i64 %25
%27 = getelementptr inbounds i8, i8* %26, i64 5
%28 = call i32 @cCamCryptVG_Process_D1(%struct.s_reader* %16, i8* %17, i8* %19, i8* %27)
br label %43
29: ; preds = %2
%30 = load %struct.s_reader*, %struct.s_reader** %3
%31 = load i8*, i8** %4
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8*, i8** %4
%35 = load i8*, i8** %4
%36 = getelementptr inbounds i8, i8* %35, i64 4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %34, i64 %39
%41 = getelementptr inbounds i8, i8* %40, i64 5
%42 = call i32 @cCamCryptVG_Decrypt_D3(%struct.s_reader* %30, i8* %31, i8* %33, i8* %41)
br label %43
43: ; preds = %2, %29, %15, %9
ret void
}

LLVM IR (-O2):
%struct.s_reader = type { i32 }
define void @cCamCryptVG_PostProcess_Decrypt(%struct.s_reader* %0, i8* %1) {
%3 = load i8, i8* %1
switch i8 %3, label %23 [
i8 -48, label %4
i8 -47, label %7
i8 -45, label %15
]
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 5
%6 = tail call i32 @cCamCryptVG_Process_D0(%struct.s_reader* %0, i8* %1, i8* %5)
br label %23
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %1, i64 5
%9 = getelementptr inbounds i8, i8* %1, i64 4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 5
%14 = tail call i32 @cCamCryptVG_Process_D1(%struct.s_reader* %0, i8* %1, i8* %8, i8* %13)
br label %23
15: ; preds = %2
%16 = getelementptr inbounds i8, i8* %1, i64 5
%17 = getelementptr inbounds i8, i8* %1, i64 4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = getelementptr inbounds i8, i8* %1, i64 %19
%21 = getelementptr inbounds i8, i8* %20, i64 5
%22 = tail call i32 @cCamCryptVG_Decrypt_D3(%struct.s_reader* %0, i8* %1, i8* %16, i8* %21)
br label %23
23: ; preds = %2, %15, %7, %4
ret void
}