zsda32(buf, length, frameend) register char *buf;
{
  register int c;
  register unsigned long crc;
  crc = 0xFFFFFFFFL;
  for (; --length >= 0; ++buf) {
    c = *buf & 0377;
    zsendline(c);
    crc = UPDC32(c, crc);
  }
  xsendline(030);
  xsendline(frameend);
  crc = UPDC32(frameend, crc);
  crc = ~crc;
  for (c = 4; --c >= 0;) {
    zsendline((int)crc);
    crc >>= 8;
  }
}


x86 assembly (clang, -O0):
<zsda32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     119b <zsda32+0x6b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x0,%al
call   1050 <zsendline@plt>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <UPDC32@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114b <zsda32+0x1b>
mov    $0x18,%edi
mov    $0x0,%al
call   1030 <xsendline@plt>
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1030 <xsendline@plt>
mov    -0x18(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <UPDC32@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jl     1208 <zsda32+0xd8>
mov    -0x28(%rbp),%rax
mov    %eax,%edi
mov    $0x0,%al
call   1050 <zsendline@plt>
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x28(%rbp)
jmp    11d8 <zsda32+0xa8>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsda32>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    $0xffffffff,%r15d
test   %esi,%esi
jle    117a <zsda32+0x4a>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nopl   (%rax)
movzbl (%rbx),%r12d
mov    %r12d,%edi
xor    %eax,%eax
call   1050 <zsendline@plt>
mov    %r12d,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <UPDC32@plt>
movslq %eax,%r15
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1150 <zsda32+0x20>
mov    $0x18,%edi
xor    %eax,%eax
call   1030 <xsendline@plt>
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <xsendline@plt>
mov    %r14d,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <UPDC32@plt>
mov    %eax,%ebx
not    %ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <zsendline@plt>
mov    %ebx,%edi
sar    $0x8,%edi
xor    %eax,%eax
call   1050 <zsendline@plt>
mov    %ebx,%edi
sar    $0x10,%edi
xor    %eax,%eax
call   1050 <zsendline@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <zsendline@plt>

LLVM IR (-O0):
define i32 @zsda32(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 4294967295, i64* %9
br label %10
10: ; preds = %25, %3
%11 = load i32, i32* %6
%12 = add nsw i32 %11, -1
store i32 %12, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = and i32 %17, 255
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %19)
%21 = load i32, i32* %8
%22 = load i64, i64* %9
%23 = call i32 (i32, i64, ...) bitcast (i32 (...)* @UPDC32 to i32 (i32, i64, ...)*)(i32 %21, i64 %22)
%24 = sext i32 %23 to i64
store i64 %24, i64* %9
br label %25
25: ; preds = %14
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %5
br label %10
28: ; preds = %10
%29 = call i32 (i32, ...) bitcast (i32 (...)* @xsendline to i32 (i32, ...)*)(i32 24)
%30 = load i32, i32* %7
%31 = call i32 (i32, ...) bitcast (i32 (...)* @xsendline to i32 (i32, ...)*)(i32 %30)
%32 = load i32, i32* %7
%33 = load i64, i64* %9
%34 = call i32 (i32, i64, ...) bitcast (i32 (...)* @UPDC32 to i32 (i32, i64, ...)*)(i32 %32, i64 %33)
%35 = sext i32 %34 to i64
store i64 %35, i64* %9
%36 = load i64, i64* %9
%37 = xor i64 %36, -1
store i64 %37, i64* %9
store i32 4, i32* %8
br label %38
38: ; preds = %42, %28
%39 = load i32, i32* %8
%40 = add nsw i32 %39, -1
store i32 %40, i32* %8
%41 = icmp sge i32 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i64, i64* %9
%44 = trunc i64 %43 to i32
%45 = call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %44)
%46 = load i64, i64* %9
%47 = lshr i64 %46, 8
store i64 %47, i64* %9
br label %38
48: ; preds = %38
%49 = load i32, i32* %4
ret i32 %49
}

LLVM IR (-O2):
define i32 @zsda32(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3, %5
%6 = phi i64 [ %14, %5 ], [ 4294967295, %3 ]
%7 = phi i8* [ %15, %5 ], [ %0, %3 ]
%8 = phi i32 [ %9, %5 ], [ %1, %3 ]
%9 = add nsw i32 %8, -1
%10 = load i8, i8* %7
%11 = zext i8 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %11)
%13 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @UPDC32 to i32 (i32, i64, ...)*)(i32 %11, i64 %6)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = icmp ugt i32 %8, 1
br i1 %16, label %5, label %17
17: ; preds = %5, %3
%18 = phi i64 [ 4294967295, %3 ], [ %14, %5 ]
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @xsendline to i32 (i32, ...)*)(i32 24)
%20 = tail call i32 (i32, ...) bitcast (i32 (...)* @xsendline to i32 (i32, ...)*)(i32 %2)
%21 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @UPDC32 to i32 (i32, i64, ...)*)(i32 %2, i64 %18)
%22 = xor i32 %21, -1
%23 = tail call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %22)
%24 = ashr i32 %22, 8
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %24)
%26 = ashr i32 %22, 16
%27 = tail call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %26)
%28 = ashr i32 %22, 24
%29 = tail call i32 (i32, ...) bitcast (i32 (...)* @zsendline to i32 (i32, ...)*)(i32 %28)
ret i32 undef
}