#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 char iowTouchBit(unsigned char);
unsigned char iowTouchByte(unsigned char sendbyte) {
  unsigned char i;
  unsigned char result = 0;
  for (i = 0; i < 8; i++) {
    result |= (iowTouchBit(sendbyte & 1) << i);
    sendbyte >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<iowTouchByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    116d <iowTouchByte+0x5d>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
movzbl %al,%eax
movzbl -0x2(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x3(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1126 <iowTouchByte+0x16>
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowTouchByte>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebp
and    $0x1,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%ebx
mov    %ebp,%eax
shr    %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%r14d
add    %al,%r14b
or     %bl,%r14b
mov    %ebp,%eax
shr    $0x2,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%r15d
shl    $0x2,%r15b
mov    %ebp,%eax
shr    $0x3,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%r12d
shl    $0x3,%r12b
or     %r15b,%r12b
or     %r14b,%r12b
mov    %ebp,%eax
shr    $0x4,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%r14d
shl    $0x4,%r14b
mov    %ebp,%eax
shr    $0x5,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%r15d
shl    $0x5,%r15b
or     %r14b,%r15b
mov    %ebp,%eax
shr    $0x6,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iowTouchBit@plt>
mov    %eax,%ebx
shl    $0x6,%bl
or     %r15b,%bl
or     %r12b,%bl
shr    $0x7,%bpl
movzbl %bpl,%edi
call   1030 <iowTouchBit@plt>
shl    $0x7,%al
or     %bl,%al
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @iowTouchByte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i8 0, i8* %3
br label %5
5: ; preds = %27, %1
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %30
9: ; preds = %5
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 1
%13 = trunc i32 %12 to i8
%14 = call zeroext i8 @iowTouchBit(i8 zeroext %13)
%15 = zext i8 %14 to i32
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = shl i32 %15, %17
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %20, %18
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %27
27: ; preds = %9
%28 = load i8, i8* %3
%29 = add i8 %28, 1
store i8 %29, i8* %3
br label %5
30: ; preds = %5
%31 = load i8, i8* %4
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @iowTouchByte(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = tail call zeroext i8 @iowTouchBit(i8 zeroext %2)
%4 = lshr i8 %0, 1
%5 = and i8 %4, 1
%6 = tail call zeroext i8 @iowTouchBit(i8 zeroext %5)
%7 = shl i8 %6, 1
%8 = or i8 %3, %7
%9 = lshr i8 %0, 2
%10 = and i8 %9, 1
%11 = tail call zeroext i8 @iowTouchBit(i8 zeroext %10)
%12 = shl i8 %11, 2
%13 = or i8 %8, %12
%14 = lshr i8 %0, 3
%15 = and i8 %14, 1
%16 = tail call zeroext i8 @iowTouchBit(i8 zeroext %15)
%17 = shl i8 %16, 3
%18 = or i8 %13, %17
%19 = lshr i8 %0, 4
%20 = and i8 %19, 1
%21 = tail call zeroext i8 @iowTouchBit(i8 zeroext %20)
%22 = shl i8 %21, 4
%23 = or i8 %18, %22
%24 = lshr i8 %0, 5
%25 = and i8 %24, 1
%26 = tail call zeroext i8 @iowTouchBit(i8 zeroext %25)
%27 = shl i8 %26, 5
%28 = or i8 %23, %27
%29 = lshr i8 %0, 6
%30 = and i8 %29, 1
%31 = tail call zeroext i8 @iowTouchBit(i8 zeroext %30)
%32 = shl i8 %31, 6
%33 = or i8 %28, %32
%34 = lshr i8 %0, 7
%35 = tail call zeroext i8 @iowTouchBit(i8 zeroext %34)
%36 = shl i8 %35, 7
%37 = or i8 %33, %36
ret i8 %37
}