#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 */
unsigned long ADCPotTurnsGet();
int /*<<< orphan*/ CommandSend(int, unsigned short, unsigned char,
                               int /*<<< orphan*/);
unsigned long ControllerFaultTimeGet();
int /*<<< orphan*/ ControllerFaultTimeSet(unsigned short);
unsigned long EncoderLinesGet();
unsigned long HBridgeBrakeCoastGet();
unsigned long HBridgeVoltageMaxGet();
unsigned long LimitPositionActive();
int /*<<< orphan*/ LimitPositionForwardGet(long *, unsigned long *);
int /*<<< orphan*/ LimitPositionReverseGet(long *, unsigned long *);
int /*<<< orphan*/ MessageSendResponse(unsigned long, unsigned char *, int);
unsigned long MessageConfigurationHandler(unsigned long ulID,
                                          unsigned char *pucData,
                                          unsigned long ulMsgLen) {
  unsigned long pulValue[2], *pulData, ulAck;
  unsigned short *pusData;
  pulData = (unsigned long *)pucData;
  pusData = (unsigned short *)pucData;
  ulAck = 0;
  switch (ulID & (~0x0000003f)) {
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (0 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = 0;
      MessageSendResponse(ulID, (unsigned char *)pulValue, 1);
    } else if (ulMsgLen == 1) {
      CommandSend(0x41, pucData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (1 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = EncoderLinesGet();
      MessageSendResponse(ulID, (unsigned char *)pulValue, 2);
    } else if (ulMsgLen == 2) {
      CommandSend(0x42, pusData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (2 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = ADCPotTurnsGet();
      MessageSendResponse(ulID, (unsigned char *)pulValue, 2);
    } else if (ulMsgLen == 2) {
      CommandSend(0x43, pusData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (3 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = HBridgeBrakeCoastGet();
      ;
      MessageSendResponse(ulID, (unsigned char *)pulValue, 1);
    } else if (ulMsgLen == 1) {
      CommandSend(0x44, pucData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (4 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = LimitPositionActive();
      MessageSendResponse(ulID, (unsigned char *)pulValue, 1);
    } else if (ulMsgLen == 1) {
      CommandSend(0x45, pucData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (5 << 6)): {
    if (ulMsgLen == 0) {
      LimitPositionForwardGet((long *)pulValue, pulValue + 1);
      MessageSendResponse(ulID, (unsigned char *)pulValue, 5);
    } else if (ulMsgLen == 5) {
      CommandSend(0x46, pulData[0], pucData[4], 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (6 << 6)): {
    if (ulMsgLen == 0) {
      LimitPositionReverseGet((long *)pulValue, pulValue + 1);
      MessageSendResponse(ulID, (unsigned char *)pulValue, 5);
    } else if (ulMsgLen == 5) {
      CommandSend(0x47, pulData[0], pucData[4], 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (7 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = HBridgeVoltageMaxGet();
      MessageSendResponse(ulID, (unsigned char *)pulValue, 2);
    } else if (ulMsgLen == 2) {
      CommandSend(0x48, pusData[0], 0, 0);
      ulAck = 1;
    }
    break;
  }
  case ((0x00020000 | 0x02000000 | 0x00001c00) | (8 << 6)): {
    if (ulMsgLen == 0) {
      pulValue[0] = ControllerFaultTimeGet();
      MessageSendResponse(ulID, (unsigned char *)pulValue, 2);
    } else if (ulMsgLen == 2) {
      ControllerFaultTimeSet(pusData[0]);
      ulAck = 1;
    }
    break;
  }
  default: {
    break;
  }
  }
  return (ulAck);
}


x86 assembly (clang, -O0):
<MessageConfigurationHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffc0,%rax
mov    %rax,-0x50(%rbp)
sub    $0x2021c00,%rax
je     12a1 <MessageConfigurationHandler+0xf1>
jmp    11f9 <MessageConfigurationHandler+0x49>
mov    -0x50(%rbp),%rax
sub    $0x2021c40,%rax
je     1300 <MessageConfigurationHandler+0x150>
jmp    120e <MessageConfigurationHandler+0x5e>
mov    -0x50(%rbp),%rax
sub    $0x2021c80,%rax
je     135f <MessageConfigurationHandler+0x1af>
jmp    1223 <MessageConfigurationHandler+0x73>
mov    -0x50(%rbp),%rax
sub    $0x2021cc0,%rax
je     13be <MessageConfigurationHandler+0x20e>
jmp    1238 <MessageConfigurationHandler+0x88>
mov    -0x50(%rbp),%rax
sub    $0x2021d00,%rax
je     1420 <MessageConfigurationHandler+0x270>
jmp    124d <MessageConfigurationHandler+0x9d>
mov    -0x50(%rbp),%rax
sub    $0x2021d40,%rax
je     1482 <MessageConfigurationHandler+0x2d2>
jmp    1262 <MessageConfigurationHandler+0xb2>
mov    -0x50(%rbp),%rax
sub    $0x2021d80,%rax
je     14f3 <MessageConfigurationHandler+0x343>
jmp    1277 <MessageConfigurationHandler+0xc7>
mov    -0x50(%rbp),%rax
sub    $0x2021dc0,%rax
je     1564 <MessageConfigurationHandler+0x3b4>
jmp    128c <MessageConfigurationHandler+0xdc>
mov    -0x50(%rbp),%rax
sub    $0x2021e00,%rax
je     15c3 <MessageConfigurationHandler+0x413>
jmp    1619 <MessageConfigurationHandler+0x469>
cmpq   $0x0,-0x18(%rbp)
jne    12cb <MessageConfigurationHandler+0x11b>
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <MessageSendResponse@plt>
jmp    12fb <MessageConfigurationHandler+0x14b>
cmpq   $0x1,-0x18(%rbp)
jne    12f6 <MessageConfigurationHandler+0x146>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    $0x41,%edi
xor    %ecx,%ecx
movzwl %ax,%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    12fb <MessageConfigurationHandler+0x14b>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    132d <MessageConfigurationHandler+0x17d>
mov    $0x0,%al
call   1060 <EncoderLinesGet@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <MessageSendResponse@plt>
jmp    135a <MessageConfigurationHandler+0x1aa>
cmpq   $0x2,-0x18(%rbp)
jne    1355 <MessageConfigurationHandler+0x1a5>
mov    -0x48(%rbp),%rax
mov    $0x42,%edi
xor    %ecx,%ecx
movzwl (%rax),%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    135a <MessageConfigurationHandler+0x1aa>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    138c <MessageConfigurationHandler+0x1dc>
mov    $0x0,%al
call   1090 <ADCPotTurnsGet@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <MessageSendResponse@plt>
jmp    13b9 <MessageConfigurationHandler+0x209>
cmpq   $0x2,-0x18(%rbp)
jne    13b4 <MessageConfigurationHandler+0x204>
mov    -0x48(%rbp),%rax
mov    $0x43,%edi
xor    %ecx,%ecx
movzwl (%rax),%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    13b9 <MessageConfigurationHandler+0x209>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    13eb <MessageConfigurationHandler+0x23b>
mov    $0x0,%al
call   10a0 <HBridgeBrakeCoastGet@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <MessageSendResponse@plt>
jmp    141b <MessageConfigurationHandler+0x26b>
cmpq   $0x1,-0x18(%rbp)
jne    1416 <MessageConfigurationHandler+0x266>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    $0x44,%edi
xor    %ecx,%ecx
movzwl %ax,%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    141b <MessageConfigurationHandler+0x26b>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    144d <MessageConfigurationHandler+0x29d>
mov    $0x0,%al
call   10c0 <LimitPositionActive@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <MessageSendResponse@plt>
jmp    147d <MessageConfigurationHandler+0x2cd>
cmpq   $0x1,-0x18(%rbp)
jne    1478 <MessageConfigurationHandler+0x2c8>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    $0x45,%edi
xor    %ecx,%ecx
movzwl %ax,%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    147d <MessageConfigurationHandler+0x2cd>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    14b5 <MessageConfigurationHandler+0x305>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x8,%rsi
call   1070 <LimitPositionForwardGet@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x5,%edx
call   1030 <MessageSendResponse@plt>
jmp    14ee <MessageConfigurationHandler+0x33e>
cmpq   $0x5,-0x18(%rbp)
jne    14e9 <MessageConfigurationHandler+0x339>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    %ax,%dx
mov    -0x10(%rbp),%rax
mov    $0x46,%edi
xor    %ecx,%ecx
movzwl %dx,%esi
movzbl 0x4(%rax),%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    14ee <MessageConfigurationHandler+0x33e>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    1526 <MessageConfigurationHandler+0x376>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x8,%rsi
call   1080 <LimitPositionReverseGet@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x5,%edx
call   1030 <MessageSendResponse@plt>
jmp    155f <MessageConfigurationHandler+0x3af>
cmpq   $0x5,-0x18(%rbp)
jne    155a <MessageConfigurationHandler+0x3aa>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    %ax,%dx
mov    -0x10(%rbp),%rax
mov    $0x47,%edi
xor    %ecx,%ecx
movzwl %dx,%esi
movzbl 0x4(%rax),%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    155f <MessageConfigurationHandler+0x3af>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    1591 <MessageConfigurationHandler+0x3e1>
mov    $0x0,%al
call   10d0 <HBridgeVoltageMaxGet@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <MessageSendResponse@plt>
jmp    15be <MessageConfigurationHandler+0x40e>
cmpq   $0x2,-0x18(%rbp)
jne    15b9 <MessageConfigurationHandler+0x409>
mov    -0x48(%rbp),%rax
mov    $0x48,%edi
xor    %ecx,%ecx
movzwl (%rax),%esi
mov    %ecx,%edx
call   1050 <CommandSend@plt>
movq   $0x1,-0x40(%rbp)
jmp    15be <MessageConfigurationHandler+0x40e>
jmp    161e <MessageConfigurationHandler+0x46e>
cmpq   $0x0,-0x18(%rbp)
jne    15f0 <MessageConfigurationHandler+0x440>
mov    $0x0,%al
call   10b0 <ControllerFaultTimeGet@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <MessageSendResponse@plt>
jmp    1614 <MessageConfigurationHandler+0x464>
cmpq   $0x2,-0x18(%rbp)
jne    160f <MessageConfigurationHandler+0x45f>
mov    -0x48(%rbp),%rax
movzwl (%rax),%edi
call   1040 <ControllerFaultTimeSet@plt>
movq   $0x1,-0x40(%rbp)
jmp    1614 <MessageConfigurationHandler+0x464>
jmp    161e <MessageConfigurationHandler+0x46e>
jmp    161e <MessageConfigurationHandler+0x46e>
mov    -0x40(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MessageConfigurationHandler>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    -0x2021c00(%rdi),%rax
shr    $0x6,%rax
cmp    $0x8,%rax
ja     12fb <MessageConfigurationHandler+0x14b>
mov    %rdi,%rbx
lea    0xe2a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x1,%rdx
je     1355 <MessageConfigurationHandler+0x1a5>
test   %rdx,%rdx
jne    12fb <MessageConfigurationHandler+0x14b>
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
jmp    12ee <MessageConfigurationHandler+0x13e>
cmp    $0x2,%rdx
je     135f <MessageConfigurationHandler+0x1af>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   1060 <EncoderLinesGet@plt>
jmp    133f <MessageConfigurationHandler+0x18f>
cmp    $0x2,%rdx
je     1369 <MessageConfigurationHandler+0x1b9>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   1090 <ADCPotTurnsGet@plt>
jmp    133f <MessageConfigurationHandler+0x18f>
cmp    $0x1,%rdx
je     1373 <MessageConfigurationHandler+0x1c3>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   10a0 <HBridgeBrakeCoastGet@plt>
jmp    128a <MessageConfigurationHandler+0xda>
cmp    $0x1,%rdx
je     137d <MessageConfigurationHandler+0x1cd>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   10c0 <LimitPositionActive@plt>
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <MessageSendResponse@plt>
jmp    13cc <MessageConfigurationHandler+0x21c>
cmp    $0x5,%rdx
je     1387 <MessageConfigurationHandler+0x1d7>
test   %rdx,%rdx
jne    12fb <MessageConfigurationHandler+0x14b>
lea    0x8(%rsp),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1070 <LimitPositionForwardGet@plt>
jmp    12e3 <MessageConfigurationHandler+0x133>
cmp    $0x5,%rdx
je     139e <MessageConfigurationHandler+0x1ee>
test   %rdx,%rdx
jne    12fb <MessageConfigurationHandler+0x14b>
lea    0x8(%rsp),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1080 <LimitPositionReverseGet@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <MessageSendResponse@plt>
xor    %r14d,%r14d
jmp    13cc <MessageConfigurationHandler+0x21c>
xor    %r14d,%r14d
jmp    13cc <MessageConfigurationHandler+0x21c>
cmp    $0x2,%rdx
je     13b5 <MessageConfigurationHandler+0x205>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   10d0 <HBridgeVoltageMaxGet@plt>
jmp    133f <MessageConfigurationHandler+0x18f>
cmp    $0x2,%rdx
je     13d7 <MessageConfigurationHandler+0x227>
xor    %r14d,%r14d
test   %rdx,%rdx
jne    13cc <MessageConfigurationHandler+0x21c>
xor    %eax,%eax
call   10b0 <ControllerFaultTimeGet@plt>
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <MessageSendResponse@plt>
jmp    13cc <MessageConfigurationHandler+0x21c>
movzbl (%rsi),%esi
mov    $0x41,%edi
jmp    13bd <MessageConfigurationHandler+0x20d>
movzwl (%rsi),%esi
mov    $0x42,%edi
jmp    13bd <MessageConfigurationHandler+0x20d>
movzwl (%rsi),%esi
mov    $0x43,%edi
jmp    13bd <MessageConfigurationHandler+0x20d>
movzbl (%rsi),%esi
mov    $0x44,%edi
jmp    13bd <MessageConfigurationHandler+0x20d>
movzbl (%rsi),%esi
mov    $0x45,%edi
jmp    13bd <MessageConfigurationHandler+0x20d>
mov    (%rsi),%rax
mov    %rax,%rcx
shr    $0x20,%rcx
movzwl %ax,%esi
movzbl %cl,%edx
mov    $0x46,%edi
jmp    13bf <MessageConfigurationHandler+0x20f>
mov    (%rsi),%rax
mov    %rax,%rcx
shr    $0x20,%rcx
movzwl %ax,%esi
movzbl %cl,%edx
mov    $0x47,%edi
jmp    13bf <MessageConfigurationHandler+0x20f>
movzwl (%rsi),%esi
mov    $0x48,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <CommandSend@plt>
mov    $0x1,%r14d
mov    %r14,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
movzwl (%rsi),%edi
call   1040 <ControllerFaultTimeSet@plt>
jmp    13c6 <MessageConfigurationHandler+0x216>

LLVM IR (-O0):
define i64 @MessageConfigurationHandler(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [2 x i64]
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i16*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
store i64* %12, i64** %8
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i16*
store i16* %14, i16** %10
store i64 0, i64* %9
%15 = load i64, i64* %4
%16 = and i64 %15, -64
switch i64 %16, label %211 [
i64 33692672, label %17
i64 33692736, label %37
i64 33692800, label %57
i64 33692864, label %77
i64 33692928, label %98
i64 33692992, label %119
i64 33693056, label %145
i64 33693120, label %171
i64 33693184, label %191
]
17: ; preds = %3
%18 = load i64, i64* %6
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 0, i64* %21
%22 = load i64, i64* %4
%23 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%24 = bitcast i64* %23 to i8*
%25 = call i32 @MessageSendResponse(i64 %22, i8* %24, i32 1)
br label %36
26: ; preds = %17
%27 = load i64, i64* %6
%28 = icmp eq i64 %27, 1
br i1 %28, label %29, label %35
29: ; preds = %26
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = zext i8 %32 to i16
%34 = call i32 @CommandSend(i32 65, i16 zeroext %33, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %35
35: ; preds = %29, %26
br label %36
36: ; preds = %35, %20
br label %212
37: ; preds = %3
%38 = load i64, i64* %6
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = call i64 (...) @EncoderLinesGet()
%42 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %41, i64* %42
%43 = load i64, i64* %4
%44 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%45 = bitcast i64* %44 to i8*
%46 = call i32 @MessageSendResponse(i64 %43, i8* %45, i32 2)
br label %56
47: ; preds = %37
%48 = load i64, i64* %6
%49 = icmp eq i64 %48, 2
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i16*, i16** %10
%52 = getelementptr inbounds i16, i16* %51, i64 0
%53 = load i16, i16* %52
%54 = call i32 @CommandSend(i32 66, i16 zeroext %53, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %55
55: ; preds = %50, %47
br label %56
56: ; preds = %55, %40
br label %212
57: ; preds = %3
%58 = load i64, i64* %6
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %67
60: ; preds = %57
%61 = call i64 (...) @ADCPotTurnsGet()
%62 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %61, i64* %62
%63 = load i64, i64* %4
%64 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%65 = bitcast i64* %64 to i8*
%66 = call i32 @MessageSendResponse(i64 %63, i8* %65, i32 2)
br label %76
67: ; preds = %57
%68 = load i64, i64* %6
%69 = icmp eq i64 %68, 2
br i1 %69, label %70, label %75
70: ; preds = %67
%71 = load i16*, i16** %10
%72 = getelementptr inbounds i16, i16* %71, i64 0
%73 = load i16, i16* %72
%74 = call i32 @CommandSend(i32 67, i16 zeroext %73, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %75
75: ; preds = %70, %67
br label %76
76: ; preds = %75, %60
br label %212
77: ; preds = %3
%78 = load i64, i64* %6
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %77
%81 = call i64 (...) @HBridgeBrakeCoastGet()
%82 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %81, i64* %82
%83 = load i64, i64* %4
%84 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%85 = bitcast i64* %84 to i8*
%86 = call i32 @MessageSendResponse(i64 %83, i8* %85, i32 1)
br label %97
87: ; preds = %77
%88 = load i64, i64* %6
%89 = icmp eq i64 %88, 1
br i1 %89, label %90, label %96
90: ; preds = %87
%91 = load i8*, i8** %5
%92 = getelementptr inbounds i8, i8* %91, i64 0
%93 = load i8, i8* %92
%94 = zext i8 %93 to i16
%95 = call i32 @CommandSend(i32 68, i16 zeroext %94, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %96
96: ; preds = %90, %87
br label %97
97: ; preds = %96, %80
br label %212
98: ; preds = %3
%99 = load i64, i64* %6
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %108
101: ; preds = %98
%102 = call i64 (...) @LimitPositionActive()
%103 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %102, i64* %103
%104 = load i64, i64* %4
%105 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%106 = bitcast i64* %105 to i8*
%107 = call i32 @MessageSendResponse(i64 %104, i8* %106, i32 1)
br label %118
108: ; preds = %98
%109 = load i64, i64* %6
%110 = icmp eq i64 %109, 1
br i1 %110, label %111, label %117
111: ; preds = %108
%112 = load i8*, i8** %5
%113 = getelementptr inbounds i8, i8* %112, i64 0
%114 = load i8, i8* %113
%115 = zext i8 %114 to i16
%116 = call i32 @CommandSend(i32 69, i16 zeroext %115, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %117
117: ; preds = %111, %108
br label %118
118: ; preds = %117, %101
br label %212
119: ; preds = %3
%120 = load i64, i64* %6
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %131
122: ; preds = %119
%123 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%124 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%125 = getelementptr inbounds i64, i64* %124, i64 1
%126 = call i32 @LimitPositionForwardGet(i64* %123, i64* %125)
%127 = load i64, i64* %4
%128 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%129 = bitcast i64* %128 to i8*
%130 = call i32 @MessageSendResponse(i64 %127, i8* %129, i32 5)
br label %144
131: ; preds = %119
%132 = load i64, i64* %6
%133 = icmp eq i64 %132, 5
br i1 %133, label %134, label %143
134: ; preds = %131
%135 = load i64*, i64** %8
%136 = getelementptr inbounds i64, i64* %135, i64 0
%137 = load i64, i64* %136
%138 = trunc i64 %137 to i16
%139 = load i8*, i8** %5
%140 = getelementptr inbounds i8, i8* %139, i64 4
%141 = load i8, i8* %140
%142 = call i32 @CommandSend(i32 70, i16 zeroext %138, i8 zeroext %141, i32 0)
store i64 1, i64* %9
br label %143
143: ; preds = %134, %131
br label %144
144: ; preds = %143, %122
br label %212
145: ; preds = %3
%146 = load i64, i64* %6
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %157
148: ; preds = %145
%149 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%150 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%151 = getelementptr inbounds i64, i64* %150, i64 1
%152 = call i32 @LimitPositionReverseGet(i64* %149, i64* %151)
%153 = load i64, i64* %4
%154 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%155 = bitcast i64* %154 to i8*
%156 = call i32 @MessageSendResponse(i64 %153, i8* %155, i32 5)
br label %170
157: ; preds = %145
%158 = load i64, i64* %6
%159 = icmp eq i64 %158, 5
br i1 %159, label %160, label %169
160: ; preds = %157
%161 = load i64*, i64** %8
%162 = getelementptr inbounds i64, i64* %161, i64 0
%163 = load i64, i64* %162
%164 = trunc i64 %163 to i16
%165 = load i8*, i8** %5
%166 = getelementptr inbounds i8, i8* %165, i64 4
%167 = load i8, i8* %166
%168 = call i32 @CommandSend(i32 71, i16 zeroext %164, i8 zeroext %167, i32 0)
store i64 1, i64* %9
br label %169
169: ; preds = %160, %157
br label %170
170: ; preds = %169, %148
br label %212
171: ; preds = %3
%172 = load i64, i64* %6
%173 = icmp eq i64 %172, 0
br i1 %173, label %174, label %181
174: ; preds = %171
%175 = call i64 (...) @HBridgeVoltageMaxGet()
%176 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %175, i64* %176
%177 = load i64, i64* %4
%178 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%179 = bitcast i64* %178 to i8*
%180 = call i32 @MessageSendResponse(i64 %177, i8* %179, i32 2)
br label %190
181: ; preds = %171
%182 = load i64, i64* %6
%183 = icmp eq i64 %182, 2
br i1 %183, label %184, label %189
184: ; preds = %181
%185 = load i16*, i16** %10
%186 = getelementptr inbounds i16, i16* %185, i64 0
%187 = load i16, i16* %186
%188 = call i32 @CommandSend(i32 72, i16 zeroext %187, i8 zeroext 0, i32 0)
store i64 1, i64* %9
br label %189
189: ; preds = %184, %181
br label %190
190: ; preds = %189, %174
br label %212
191: ; preds = %3
%192 = load i64, i64* %6
%193 = icmp eq i64 %192, 0
br i1 %193, label %194, label %201
194: ; preds = %191
%195 = call i64 (...) @ControllerFaultTimeGet()
%196 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %195, i64* %196
%197 = load i64, i64* %4
%198 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%199 = bitcast i64* %198 to i8*
%200 = call i32 @MessageSendResponse(i64 %197, i8* %199, i32 2)
br label %210
201: ; preds = %191
%202 = load i64, i64* %6
%203 = icmp eq i64 %202, 2
br i1 %203, label %204, label %209
204: ; preds = %201
%205 = load i16*, i16** %10
%206 = getelementptr inbounds i16, i16* %205, i64 0
%207 = load i16, i16* %206
%208 = call i32 @ControllerFaultTimeSet(i16 zeroext %207)
store i64 1, i64* %9
br label %209
209: ; preds = %204, %201
br label %210
210: ; preds = %209, %194
br label %212
211: ; preds = %3
br label %212
212: ; preds = %211, %210, %190, %170, %144, %118, %97, %76, %56, %36
%213 = load i64, i64* %9
ret i64 %213
}

LLVM IR (-O2):
define i64 @MessageConfigurationHandler(i64 %0, i8* nocapture %1, i64 %2) {
%4 = alloca [2 x i64]
%5 = bitcast [2 x i64]* %4 to i8*
%6 = bitcast i8* %1 to i64*
%7 = bitcast i8* %1 to i16*
%8 = add i64 %0, -33692672
%9 = lshr i64 %8, 6
switch i64 %9, label %92 [
i64 0, label %10
i64 1, label %18
i64 2, label %26
i64 3, label %34
i64 4, label %43
i64 5, label %52
i64 6, label %64
i64 7, label %76
i64 8, label %84
]
10: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %11
i64 1, label %14
]
11: ; preds = %10
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 0, i64* %12
%13 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 1)
br label %92
14: ; preds = %10
%15 = load i8, i8* %1
%16 = zext i8 %15 to i16
%17 = tail call i32 @CommandSend(i32 65, i16 zeroext %16, i8 zeroext 0, i32 0)
br label %92
18: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %19
i64 2, label %23
]
19: ; preds = %18
%20 = tail call i64 (...) @EncoderLinesGet()
%21 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %20, i64* %21
%22 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 2)
br label %92
23: ; preds = %18
%24 = load i16, i16* %7
%25 = tail call i32 @CommandSend(i32 66, i16 zeroext %24, i8 zeroext 0, i32 0)
br label %92
26: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %27
i64 2, label %31
]
27: ; preds = %26
%28 = tail call i64 (...) @ADCPotTurnsGet()
%29 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %28, i64* %29
%30 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 2)
br label %92
31: ; preds = %26
%32 = load i16, i16* %7
%33 = tail call i32 @CommandSend(i32 67, i16 zeroext %32, i8 zeroext 0, i32 0)
br label %92
34: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %35
i64 1, label %39
]
35: ; preds = %34
%36 = tail call i64 (...) @HBridgeBrakeCoastGet()
%37 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %36, i64* %37
%38 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 1)
br label %92
39: ; preds = %34
%40 = load i8, i8* %1
%41 = zext i8 %40 to i16
%42 = tail call i32 @CommandSend(i32 68, i16 zeroext %41, i8 zeroext 0, i32 0)
br label %92
43: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %44
i64 1, label %48
]
44: ; preds = %43
%45 = tail call i64 (...) @LimitPositionActive()
%46 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %45, i64* %46
%47 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 1)
br label %92
48: ; preds = %43
%49 = load i8, i8* %1
%50 = zext i8 %49 to i16
%51 = tail call i32 @CommandSend(i32 69, i16 zeroext %50, i8 zeroext 0, i32 0)
br label %92
52: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %53
i64 5, label %58
]
53: ; preds = %52
%54 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%55 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
%56 = call i32 @LimitPositionForwardGet(i64* %54, i64* %55)
%57 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 5)
br label %92
58: ; preds = %52
%59 = load i64, i64* %6
%60 = trunc i64 %59 to i16
%61 = lshr i64 %59, 32
%62 = trunc i64 %61 to i8
%63 = tail call i32 @CommandSend(i32 70, i16 zeroext %60, i8 zeroext %62, i32 0)
br label %92
64: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %65
i64 5, label %70
]
65: ; preds = %64
%66 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%67 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
%68 = call i32 @LimitPositionReverseGet(i64* %66, i64* %67)
%69 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 5)
br label %92
70: ; preds = %64
%71 = load i64, i64* %6
%72 = trunc i64 %71 to i16
%73 = lshr i64 %71, 32
%74 = trunc i64 %73 to i8
%75 = tail call i32 @CommandSend(i32 71, i16 zeroext %72, i8 zeroext %74, i32 0)
br label %92
76: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %77
i64 2, label %81
]
77: ; preds = %76
%78 = tail call i64 (...) @HBridgeVoltageMaxGet()
%79 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %78, i64* %79
%80 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 2)
br label %92
81: ; preds = %76
%82 = load i16, i16* %7
%83 = tail call i32 @CommandSend(i32 72, i16 zeroext %82, i8 zeroext 0, i32 0)
br label %92
84: ; preds = %3
switch i64 %2, label %92 [
i64 0, label %85
i64 2, label %89
]
85: ; preds = %84
%86 = tail call i64 (...) @ControllerFaultTimeGet()
%87 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
store i64 %86, i64* %87
%88 = call i32 @MessageSendResponse(i64 %0, i8* %5, i32 2)
br label %92
89: ; preds = %84
%90 = load i16, i16* %7
%91 = tail call i32 @ControllerFaultTimeSet(i16 zeroext %90)
br label %92
92: ; preds = %84, %76, %64, %52, %43, %34, %26, %18, %10, %3, %85, %89, %77, %81, %65, %70, %53, %58, %44, %48, %35, %39, %27, %31, %19, %23, %11, %14
%93 = phi i64 [ 0, %3 ], [ 0, %85 ], [ 1, %89 ], [ 0, %77 ], [ 1, %81 ], [ 0, %65 ], [ 1, %70 ], [ 0, %53 ], [ 1, %58 ], [ 0, %44 ], [ 1, %48 ], [ 0, %35 ], [ 1, %39 ], [ 0, %27 ], [ 1, %31 ], [ 0, %19 ], [ 1, %23 ], [ 0, %11 ], [ 1, %14 ], [ 0, %10 ], [ 0, %18 ], [ 0, %26 ], [ 0, %34 ], [ 0, %43 ], [ 0, %52 ], [ 0, %64 ], [ 0, %76 ], [ 0, %84 ]
ret i64 %93
}