#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*/ setPort(short, int);
int /*<<< orphan*/ xsvfTmsTransition(int);
int xsvfGotoTapState(unsigned char *pucTapState, unsigned char ucTargetState) {
  int i;
  int iErrorCode;
  iErrorCode = 0;
  if (ucTargetState == 0x00) {
    xsvfTmsTransition(1);
    for (i = 0; i < 5; ++i) {
      setPort((short)0, 0);
      setPort((short)0, 1);
    }
    *pucTapState = 0x00;
    ;

    ;
  } else if ((ucTargetState != *pucTapState) &&
             (((ucTargetState == 0x07) && (*pucTapState != 0x06)) ||
              ((ucTargetState == 0x0E) && (*pucTapState != 0x0D)))) {
    iErrorCode = 5;
  } else {
    if (ucTargetState == *pucTapState) {
      if (ucTargetState == 0x06) {
        xsvfTmsTransition(1);
        *pucTapState = 0x07;

        ;
      } else if (ucTargetState == 0x0D) {
        xsvfTmsTransition(1);
        *pucTapState = 0x0E;

        ;
      }
    }
    while (ucTargetState != *pucTapState) {
      switch (*pucTapState) {
      case 0x00:
        xsvfTmsTransition(0);
        *pucTapState = 0x01;
        break;
      case 0x01:
        xsvfTmsTransition(1);
        *pucTapState = 0x02;
        break;
      case 0x02:
        if (ucTargetState >= 0x09) {
          xsvfTmsTransition(1);
          *pucTapState = 0x09;
        } else {
          xsvfTmsTransition(0);
          *pucTapState = 0x03;
        }
        break;
      case 0x03:
        if (ucTargetState == 0x04) {
          xsvfTmsTransition(0);
          *pucTapState = 0x04;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x05;
        }
        break;
      case 0x04:
        xsvfTmsTransition(1);
        *pucTapState = 0x05;
        break;
      case 0x05:
        if (ucTargetState == 0x06) {
          xsvfTmsTransition(0);
          *pucTapState = 0x06;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x08;
        }
        break;
      case 0x06:
        xsvfTmsTransition(1);
        *pucTapState = 0x07;
        break;
      case 0x07:
        if (ucTargetState == 0x04) {
          xsvfTmsTransition(0);
          *pucTapState = 0x04;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x08;
        }
        break;
      case 0x08:
        if (ucTargetState == 0x01) {
          xsvfTmsTransition(0);
          *pucTapState = 0x01;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x02;
        }
        break;
      case 0x09:
        xsvfTmsTransition(0);
        *pucTapState = 0x0A;
        break;
      case 0x0A:
        if (ucTargetState == 0x0B) {
          xsvfTmsTransition(0);
          *pucTapState = 0x0B;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x0C;
        }
        break;
      case 0x0B:
        xsvfTmsTransition(1);
        *pucTapState = 0x0C;
        break;
      case 0x0C:
        if (ucTargetState == 0x0D) {
          xsvfTmsTransition(0);
          *pucTapState = 0x0D;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x0F;
        }
        break;
      case 0x0D:
        xsvfTmsTransition(1);
        *pucTapState = 0x0E;
        break;
      case 0x0E:
        if (ucTargetState == 0x0B) {
          xsvfTmsTransition(0);
          *pucTapState = 0x0B;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x0F;
        }
        break;
      case 0x0F:
        if (ucTargetState == 0x01) {
          xsvfTmsTransition(0);
          *pucTapState = 0x01;
        } else {
          xsvfTmsTransition(1);
          *pucTapState = 0x02;
        }
        break;
      default:
        iErrorCode = 5;
        *pucTapState = ucTargetState;
        break;
      }

      ;
    }
  }
  return (iErrorCode);
}


x86 assembly (clang, -O0):
<xsvfGotoTapState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x14(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1190 <xsvfGotoTapState+0x70>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1184 <xsvfGotoTapState+0x64>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <xsvfGotoTapState+0x37>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1521 <xsvfGotoTapState+0x401>
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e9 <xsvfGotoTapState+0xc9>
movzbl -0x9(%rbp),%eax
cmp    $0x7,%eax
jne    11c0 <xsvfGotoTapState+0xa0>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x6,%eax
jne    11dd <xsvfGotoTapState+0xbd>
movzbl -0x9(%rbp),%eax
cmp    $0xe,%eax
jne    11e9 <xsvfGotoTapState+0xc9>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xd,%eax
je     11e9 <xsvfGotoTapState+0xc9>
movl   $0x5,-0x14(%rbp)
jmp    151c <xsvfGotoTapState+0x3fc>
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1247 <xsvfGotoTapState+0x127>
movzbl -0x9(%rbp),%eax
cmp    $0x6,%eax
jne    121f <xsvfGotoTapState+0xff>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x7,(%rax)
jmp    1242 <xsvfGotoTapState+0x122>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
jne    123d <xsvfGotoTapState+0x11d>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xe,(%rax)
jmp    1242 <xsvfGotoTapState+0x122>
jmp    1247 <xsvfGotoTapState+0x127>
jmp    124c <xsvfGotoTapState+0x12c>
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     1517 <xsvfGotoTapState+0x3f7>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x20(%rbp)
sub    $0xf,%rax
ja     1502 <xsvfGotoTapState+0x3e2>
mov    -0x20(%rbp),%rax
lea    0xd81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jl     12d4 <xsvfGotoTapState+0x1b4>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x9,(%rax)
jmp    12e2 <xsvfGotoTapState+0x1c2>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x3,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x4,%eax
jne    1307 <xsvfGotoTapState+0x1e7>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
jmp    1318 <xsvfGotoTapState+0x1f8>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x5,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x5,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x6,%eax
jne    1353 <xsvfGotoTapState+0x233>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x6,(%rax)
jmp    1364 <xsvfGotoTapState+0x244>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x8,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x7,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x4,%eax
jne    139f <xsvfGotoTapState+0x27f>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
jmp    13b0 <xsvfGotoTapState+0x290>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x8,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    13d5 <xsvfGotoTapState+0x2b5>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
jmp    13e6 <xsvfGotoTapState+0x2c6>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0xb,%eax
jne    141e <xsvfGotoTapState+0x2fe>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xb,(%rax)
jmp    142f <xsvfGotoTapState+0x30f>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xc,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xc,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
jne    146a <xsvfGotoTapState+0x34a>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xd,(%rax)
jmp    147b <xsvfGotoTapState+0x35b>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xf,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xe,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0xb,%eax
jne    14b6 <xsvfGotoTapState+0x396>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xb,(%rax)
jmp    14c7 <xsvfGotoTapState+0x3a7>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0xf,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movzbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    14ec <xsvfGotoTapState+0x3cc>
xor    %edi,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
jmp    14fd <xsvfGotoTapState+0x3dd>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
jmp    1512 <xsvfGotoTapState+0x3f2>
movl   $0x5,-0x14(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    124c <xsvfGotoTapState+0x12c>
jmp    151c <xsvfGotoTapState+0x3fc>
jmp    1521 <xsvfGotoTapState+0x401>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsvfGotoTapState>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r14
test   %esi,%esi
je     1160 <xsvfGotoTapState+0x40>
mov    %esi,%ebp
mov    (%r14),%bl
cmp    %bpl,%bl
jne    11df <xsvfGotoTapState+0xbf>
cmp    $0x6,%bpl
je     1204 <xsvfGotoTapState+0xe4>
xor    %eax,%eax
cmp    $0xd,%bpl
jne    1398 <xsvfGotoTapState+0x278>
mov    $0xe,%bl
jmp    1206 <xsvfGotoTapState+0xe6>
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
xor    %ebp,%ebp
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <setPort@plt>
xor    %eax,%eax
mov    %bpl,(%r14)
jmp    1398 <xsvfGotoTapState+0x278>
mov    $0x5,%eax
cmp    $0x7,%bpl
jne    11f3 <xsvfGotoTapState+0xd3>
cmp    $0x6,%bl
jne    1398 <xsvfGotoTapState+0x278>
cmp    $0xe,%bpl
jne    1213 <xsvfGotoTapState+0xf3>
cmp    $0xd,%bl
jne    1398 <xsvfGotoTapState+0x278>
jmp    1213 <xsvfGotoTapState+0xf3>
mov    $0x7,%bl
mov    $0x1,%edi
call   1030 <xsvfTmsTransition@plt>
mov    %bl,(%r14)
xor    %eax,%eax
cmp    %bpl,%bl
je     1398 <xsvfGotoTapState+0x278>
cmp    $0x1,%bpl
setne  0x4(%rsp)
sete   %r9b
cmp    $0xb,%bpl
sete   %r8b
setne  %dl
cmp    $0xd,%bpl
setne  %sil
cmp    $0x4,%bpl
sete   %cl
setne  %dil
cmp    $0x6,%bpl
setne  %al
mov    $0x2,%r13b
sub    %r9b,%r13b
mov    %rdx,0x20(%rsp)
lea    0x0(,%rdx,4),%edx
or     $0xb,%dl
mov    %edx,0x14(%rsp)
mov    %rsi,0x30(%rsp)
lea    (%rsi,%rsi,1),%edx
or     $0xd,%dl
mov    %edx,0x10(%rsp)
mov    $0xc,%dl
sub    %r8b,%dl
mov    %dl,0x6(%rsp)
mov    %rdi,0x18(%rsp)
lea    0x0(,%rdi,4),%edx
add    $0x4,%dl
mov    %edx,0xc(%rsp)
mov    %rax,0x28(%rsp)
add    %eax,%eax
add    $0x6,%al
mov    %eax,0x8(%rsp)
xor    $0x5,%cl
mov    %cl,0x7(%rsp)
cmp    $0x9,%bpl
setae  0x5(%rsp)
mov    $0x9,%eax
mov    $0x3,%r15d
cmovae %eax,%r15d
lea    0xd39(%rip),%r12
jmp    12f4 <xsvfGotoTapState+0x1d4>
movzbl 0x4(%rsp),%eax
mov    %r13d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <xsvfTmsTransition@plt>
mov    %bl,(%r14)
cmp    %bpl,%bl
je     1396 <xsvfGotoTapState+0x276>
cmp    $0xf,%bl
ja     13a7 <xsvfGotoTapState+0x287>
xor    %eax,%eax
movzbl %bl,%ecx
movslq (%r12,%rcx,4),%rcx
add    %r12,%rcx
mov    $0x1,%bl
jmp    *%rcx
mov    $0x2,%bl
mov    $0x1,%al
jmp    12e0 <xsvfGotoTapState+0x1c0>
movzbl 0x5(%rsp),%eax
mov    %r15d,%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x18(%rsp),%rax
movzbl 0x7(%rsp),%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    $0x5,%bl
mov    $0x1,%al
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x28(%rsp),%rax
mov    0x8(%rsp),%ecx
mov    %ecx,%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    $0x7,%bl
mov    $0x1,%al
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x18(%rsp),%rax
mov    0xc(%rsp),%ecx
mov    %ecx,%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    $0xa,%bl
xor    %eax,%eax
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x20(%rsp),%rax
movzbl 0x6(%rsp),%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    $0xc,%bl
mov    $0x1,%al
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x30(%rsp),%rax
mov    0x10(%rsp),%ecx
mov    %ecx,%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    $0xe,%bl
mov    $0x1,%al
jmp    12e0 <xsvfGotoTapState+0x1c0>
mov    0x20(%rsp),%rax
mov    0x14(%rsp),%ecx
mov    %ecx,%ebx
jmp    12e0 <xsvfGotoTapState+0x1c0>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x5,%eax
jmp    11d7 <xsvfGotoTapState+0xb7>

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

LLVM IR (-O2):
define i32 @xsvfGotoTapState(i8* %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = tail call i32 @xsvfTmsTransition(i32 1)
%6 = tail call i32 @setPort(i16 signext 0, i32 0)
%7 = tail call i32 @setPort(i16 signext 0, i32 1)
%8 = tail call i32 @setPort(i16 signext 0, i32 0)
%9 = tail call i32 @setPort(i16 signext 0, i32 1)
%10 = tail call i32 @setPort(i16 signext 0, i32 0)
%11 = tail call i32 @setPort(i16 signext 0, i32 1)
%12 = tail call i32 @setPort(i16 signext 0, i32 0)
%13 = tail call i32 @setPort(i16 signext 0, i32 1)
%14 = tail call i32 @setPort(i16 signext 0, i32 0)
%15 = tail call i32 @setPort(i16 signext 0, i32 1)
br label %82
16: ; preds = %2
%17 = load i8, i8* %0
%18 = icmp eq i8 %17, %1
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = icmp ne i8 %1, 7
%21 = icmp eq i8 %17, 6
%22 = select i1 %20, i1 true, i1 %21
br i1 %22, label %23, label %85
23: ; preds = %19
%24 = icmp ne i8 %1, 14
%25 = icmp eq i8 %17, 13
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %32, label %85
27: ; preds = %16
switch i8 %1, label %85 [
i8 6, label %29
i8 13, label %28
]
28: ; preds = %27
br label %29
29: ; preds = %27, %28
%30 = phi i8 [ 14, %28 ], [ 7, %27 ]
%31 = tail call i32 @xsvfTmsTransition(i32 1)
store i8 %30, i8* %0
br label %32
32: ; preds = %29, %23
%33 = phi i8 [ %17, %23 ], [ %30, %29 ]
%34 = icmp eq i8 %33, %1
br i1 %34, label %85, label %35
35: ; preds = %32
%36 = icmp eq i8 %1, 1
%37 = icmp eq i8 %1, 11
%38 = icmp eq i8 %1, 13
%39 = icmp eq i8 %1, 4
%40 = icmp eq i8 %1, 6
%41 = icmp ugt i8 %1, 8
%42 = xor i1 %36, true
%43 = select i1 %36, i8 1, i8 2
%44 = xor i1 %37, true
%45 = select i1 %37, i8 11, i8 15
%46 = xor i1 %38, true
%47 = select i1 %38, i8 13, i8 15
%48 = xor i1 %37, true
%49 = select i1 %37, i8 11, i8 12
%50 = xor i1 %36, true
%51 = select i1 %36, i8 1, i8 2
%52 = xor i1 %39, true
%53 = select i1 %39, i8 4, i8 8
%54 = xor i1 %40, true
%55 = select i1 %40, i8 6, i8 8
%56 = xor i1 %39, true
%57 = select i1 %39, i8 4, i8 5
%58 = select i1 %41, i8 9, i8 3
br label %59
59: ; preds = %35, %76
%60 = phi i8 [ %33, %35 ], [ %78, %76 ]
switch i8 %60, label %82 [
i8 0, label %76
i8 1, label %61
i8 2, label %62
i8 3, label %63
i8 4, label %64
i8 5, label %65
i8 6, label %66
i8 7, label %67
i8 8, label %68
i8 9, label %69
i8 10, label %70
i8 11, label %71
i8 12, label %72
i8 13, label %73
i8 14, label %74
i8 15, label %75
]
61: ; preds = %59
br label %76
62: ; preds = %59
br label %76
63: ; preds = %59
br label %76
64: ; preds = %59
br label %76
65: ; preds = %59
br label %76
66: ; preds = %59
br label %76
67: ; preds = %59
br label %76
68: ; preds = %59
br label %76
69: ; preds = %59
br label %76
70: ; preds = %59
br label %76
71: ; preds = %59
br label %76
72: ; preds = %59
br label %76
73: ; preds = %59
br label %76
74: ; preds = %59
br label %76
75: ; preds = %59
br label %76
76: ; preds = %75, %74, %72, %70, %68, %67, %65, %63, %62, %59, %73, %71, %69, %66, %64, %61
%77 = phi i1 [ true, %73 ], [ true, %71 ], [ false, %69 ], [ true, %66 ], [ true, %64 ], [ true, %61 ], [ false, %59 ], [ %41, %62 ], [ %56, %63 ], [ %54, %65 ], [ %52, %67 ], [ %50, %68 ], [ %48, %70 ], [ %46, %72 ], [ %44, %74 ], [ %42, %75 ]
%78 = phi i8 [ 14, %73 ], [ 12, %71 ], [ 10, %69 ], [ 7, %66 ], [ 5, %64 ], [ 2, %61 ], [ 1, %59 ], [ %58, %62 ], [ %57, %63 ], [ %55, %65 ], [ %53, %67 ], [ %51, %68 ], [ %49, %70 ], [ %47, %72 ], [ %45, %74 ], [ %43, %75 ]
%79 = zext i1 %77 to i32
%80 = tail call i32 @xsvfTmsTransition(i32 %79)
store i8 %78, i8* %0
%81 = icmp eq i8 %78, %1
br i1 %81, label %85, label %59
82: ; preds = %59, %4
%83 = phi i8 [ 0, %4 ], [ %1, %59 ]
%84 = phi i32 [ 0, %4 ], [ 5, %59 ]
store i8 %83, i8* %0
br label %85
85: ; preds = %76, %82, %27, %32, %23, %19
%86 = phi i32 [ 5, %19 ], [ 5, %23 ], [ 0, %32 ], [ 0, %27 ], [ %84, %82 ], [ 0, %76 ]
ret i32 %86
}