#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ msDelay(int);
int /*<<< orphan*/ owTouchBit(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int rw1990TouchByte(int portnum, int delay, int sendbyte) {
  int i;
  for (i = 0; i < 8; i++) {
    owTouchBit(portnum, sendbyte & 0x01);
    msDelay(delay);
    sendbyte = sendbyte >> 1;
    printf(".");
    fflush(stdout);
  }
  return 1;
}


x86 assembly (clang, -O0):
<rw1990TouchByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11a9 <rw1990TouchByte+0x69>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
and    $0x1,%esi
call   1060 <owTouchBit@plt>
mov    -0x8(%rbp),%edi
call   1040 <msDelay@plt>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <rw1990TouchByte+0x18>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rw1990TouchByte>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r15d
mov    %edx,%esi
and    $0x1,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    %ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2e69(%rip),%r12
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    $0x2,%ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    $0x3,%ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    $0x4,%ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    $0x5,%ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    %ebx,%ebp
shr    $0x6,%ebp
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
shr    $0x7,%ebx
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
and    $0x1,%ebx
mov    %r15d,%edi
mov    %ebx,%esi
call   1060 <owTouchBit@plt>
mov    %r14d,%edi
call   1040 <msDelay@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stdout = global i32 0
define i32 @rw1990TouchByte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = and i32 %13, 1
%15 = call i32 @owTouchBit(i32 %12, i32 %14)
%16 = load i32, i32* %5
%17 = call i32 @msDelay(i32 %16)
%18 = load i32, i32* %6
%19 = ashr i32 %18, 1
store i32 %19, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
br label %23
23: ; preds = %11
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %8
ret i32 1
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @rw1990TouchByte(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 1
%5 = tail call i32 @owTouchBit(i32 %0, i32 %4)
%6 = tail call i32 @msDelay(i32 %1)
%7 = lshr i32 %2, 1
%8 = tail call i32 @putchar(i32 46)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = and i32 %7, 1
%12 = tail call i32 @owTouchBit(i32 %0, i32 %11)
%13 = tail call i32 @msDelay(i32 %1)
%14 = lshr i32 %2, 2
%15 = tail call i32 @putchar(i32 46)
%16 = load i32, i32* @stdout
%17 = tail call i32 @fflush(i32 %16)
%18 = and i32 %14, 1
%19 = tail call i32 @owTouchBit(i32 %0, i32 %18)
%20 = tail call i32 @msDelay(i32 %1)
%21 = lshr i32 %2, 3
%22 = tail call i32 @putchar(i32 46)
%23 = load i32, i32* @stdout
%24 = tail call i32 @fflush(i32 %23)
%25 = and i32 %21, 1
%26 = tail call i32 @owTouchBit(i32 %0, i32 %25)
%27 = tail call i32 @msDelay(i32 %1)
%28 = lshr i32 %2, 4
%29 = tail call i32 @putchar(i32 46)
%30 = load i32, i32* @stdout
%31 = tail call i32 @fflush(i32 %30)
%32 = and i32 %28, 1
%33 = tail call i32 @owTouchBit(i32 %0, i32 %32)
%34 = tail call i32 @msDelay(i32 %1)
%35 = lshr i32 %2, 5
%36 = tail call i32 @putchar(i32 46)
%37 = load i32, i32* @stdout
%38 = tail call i32 @fflush(i32 %37)
%39 = and i32 %35, 1
%40 = tail call i32 @owTouchBit(i32 %0, i32 %39)
%41 = tail call i32 @msDelay(i32 %1)
%42 = lshr i32 %2, 6
%43 = tail call i32 @putchar(i32 46)
%44 = load i32, i32* @stdout
%45 = tail call i32 @fflush(i32 %44)
%46 = and i32 %42, 1
%47 = tail call i32 @owTouchBit(i32 %0, i32 %46)
%48 = tail call i32 @msDelay(i32 %1)
%49 = lshr i32 %2, 7
%50 = tail call i32 @putchar(i32 46)
%51 = load i32, i32* @stdout
%52 = tail call i32 @fflush(i32 %51)
%53 = and i32 %49, 1
%54 = tail call i32 @owTouchBit(i32 %0, i32 %53)
%55 = tail call i32 @msDelay(i32 %1)
%56 = tail call i32 @putchar(i32 46)
%57 = load i32, i32* @stdout
%58 = tail call i32 @fflush(i32 %57)
ret i32 1
}