bcreset(chan) int chan;
{
  register i, a;
  _in_((((chan) << 2 | 0xa0) | 1) | 0x200 | 0x400);
  _in_((((chan) << 2 | 0xa0) | 3) | 0x200 | 0x400);
  a = ((chan) << 2 | 0xa0);
  for (i = 0; i < 4; ++i)
    _out_(a + i, 0);
  _out_(0x23, 0);
}


x86 assembly (clang, -O0):
<bcreset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x2,%edi
or     $0xa0,%edi
or     $0x1,%edi
or     $0x200,%edi
or     $0x400,%edi
mov    $0x0,%al
call   1030 <_in_@plt>
mov    -0x8(%rbp),%edi
shl    $0x2,%edi
or     $0xa0,%edi
or     $0x3,%edi
or     $0x200,%edi
or     $0x400,%edi
mov    $0x0,%al
call   1030 <_in_@plt>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
or     $0xa0,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11ab <bcreset+0x8b>
mov    -0x10(%rbp),%edi
add    -0xc(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <_out_@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <bcreset+0x64>
mov    $0x23,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <_out_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcreset>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
shl    $0x2,%ebx
mov    %ebx,%ebp
or     $0xa0,%ebp
mov    %ebx,%edi
or     $0x6a1,%edi
xor    %eax,%eax
call   1030 <_in_@plt>
mov    %ebx,%edi
or     $0x6a3,%edi
xor    %eax,%eax
call   1030 <_in_@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <_out_@plt>
mov    %ebx,%edi
or     $0xa1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <_out_@plt>
mov    %ebx,%edi
or     $0xa2,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <_out_@plt>
or     $0xa3,%ebx
mov    %ebx,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <_out_@plt>
mov    $0x23,%edi
xor    %esi,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_out_@plt>

LLVM IR (-O0):
define i32 @bcreset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 2
%8 = or i32 %7, 160
%9 = or i32 %8, 1
%10 = or i32 %9, 512
%11 = or i32 %10, 1024
%12 = call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* %3
%14 = shl i32 %13, 2
%15 = or i32 %14, 160
%16 = or i32 %15, 3
%17 = or i32 %16, 512
%18 = or i32 %17, 1024
%19 = call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 %18)
%20 = load i32, i32* %3
%21 = shl i32 %20, 2
%22 = or i32 %21, 160
store i32 %22, i32* %5
store i32 0, i32* %4
br label %23
23: ; preds = %31, %1
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 4
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %5
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
%30 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 %29, i32 0)
br label %31
31: ; preds = %26
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %23
34: ; preds = %23
%35 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 35, i32 0)
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @bcreset(i32 %0) {
%2 = shl i32 %0, 2
%3 = or i32 %2, 160
%4 = or i32 %2, 1697
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 %4)
%6 = or i32 %2, 1699
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 %3, i32 0)
%9 = or i32 %2, 161
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 %9, i32 0)
%11 = or i32 %2, 162
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 %11, i32 0)
%13 = or i32 %2, 163
%14 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 %13, i32 0)
%15 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_out_ to i32 (i32, i32, ...)*)(i32 35, i32 0)
ret i32 undef
}