#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*/ SendByte(unsigned char const, unsigned int);
int /*<<< orphan*/ SetSDATAHiZ();
int /*<<< orphan*/ SetSDATAStrong();
void SendVector(const unsigned char *bVect, unsigned int iNumBits) {
  SetSDATAStrong();
  while (iNumBits > 0) {
    if (iNumBits >= 8) {
      SendByte(*(bVect), 8);
      iNumBits -= 8;
      bVect++;
    } else {
      SendByte(*(bVect), iNumBits);
      iNumBits = 0;
    }
  }
  SetSDATAHiZ();
}


x86 assembly (clang, -O0):
<SendVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <SetSDATAStrong@plt>
cmpl   $0x0,-0xc(%rbp)
jbe    11a2 <SendVector+0x72>
cmpl   $0x8,-0xc(%rbp)
jb     1185 <SendVector+0x55>
mov    -0x8(%rbp),%rax
mov    $0x8,%esi
movzbl (%rax),%edi
call   1050 <SendByte@plt>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    119d <SendVector+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%esi
movzbl %al,%edi
call   1050 <SendByte@plt>
movl   $0x0,-0xc(%rbp)
jmp    1146 <SendVector+0x16>
mov    $0x0,%al
call   1040 <SetSDATAHiZ@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendVector>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <SetSDATAStrong@plt>
test   %ebp,%ebp
je     1174 <SendVector+0x44>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%edi
cmp    $0x7,%ebp
jbe    116d <SendVector+0x3d>
mov    $0x8,%esi
call   1050 <SendByte@plt>
add    $0x1,%rbx
add    $0xfffffff8,%ebp
jne    1150 <SendVector+0x20>
jmp    1174 <SendVector+0x44>
mov    %ebp,%esi
call   1050 <SendByte@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <SetSDATAHiZ@plt>

LLVM IR (-O0):
define void @SendVector(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @SetSDATAStrong()
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %4
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i32, i32* %4
%11 = icmp uge i32 %10, 8
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = call i32 @SendByte(i8 zeroext %14, i32 8)
%16 = load i32, i32* %4
%17 = sub i32 %16, 8
store i32 %17, i32* %4
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %25
20: ; preds = %9
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = load i32, i32* %4
%24 = call i32 @SendByte(i8 zeroext %22, i32 %23)
store i32 0, i32* %4
br label %25
25: ; preds = %20, %12
br label %6
26: ; preds = %6
%27 = call i32 (...) @SetSDATAHiZ()
ret void
}

LLVM IR (-O2):
define void @SendVector(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @SetSDATAStrong()
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i32 [ %14, %12 ], [ %1, %2 ]
%7 = phi i8* [ %15, %12 ], [ %0, %2 ]
%8 = icmp ugt i32 %6, 7
%9 = load i8, i8* %7
br i1 %8, label %12, label %10
10: ; preds = %5
%11 = tail call i32 @SendByte(i8 zeroext %9, i32 %6)
br label %17
12: ; preds = %5
%13 = tail call i32 @SendByte(i8 zeroext %9, i32 8)
%14 = add i32 %6, -8
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = icmp eq i32 %14, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %10, %2
%18 = tail call i32 (...) @SetSDATAHiZ()
ret void
}