#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*/ _transmit_to_gpio_with_increased_bit(unsigned char,
                                                        int const);
void _transmit_bytes(const unsigned char *data, const int length,
                     const int delay_per_bit) {
  unsigned char bit;
  int i, j;
  for (i = 0; i < length; i++) {
    for (j = 7; j >= 0; j--) {
      bit = (data[i] >> j) & 1;
      _transmit_to_gpio_with_increased_bit(bit, delay_per_bit);
    }
  }
}


x86 assembly (clang, -O0):
<_transmit_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118c <_transmit_bytes+0x7c>
movl   $0x7,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1179 <_transmit_bytes+0x69>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%esi
movzbl %al,%edi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <_transmit_bytes+0x2c>
jmp    117e <_transmit_bytes+0x6e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <_transmit_bytes+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_transmit_bytes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    11c9 <_transmit_bytes+0xb9>
mov    %edx,%r15d
mov    %rdi,%rbx
mov    %esi,%r14d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movzbl (%rbx,%rbp,1),%eax
shr    $0x7,%al
movzbl %al,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    $0x6,%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    $0x5,%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    $0x4,%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    $0x3,%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    $0x2,%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
shr    %edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
movzbl (%rbx,%rbp,1),%edi
and    $0x1,%edi
mov    %r15d,%esi
call   1030 <_transmit_to_gpio_with_increased_bit@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1130 <_transmit_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_transmit_bytes(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
br label %10
10: ; preds = %36, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %39
14: ; preds = %10
store i32 7, i32* %9
br label %15
15: ; preds = %32, %14
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = load i8*, i8** %4
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = load i32, i32* %9
%26 = ashr i32 %24, %25
%27 = and i32 %26, 1
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i32, i32* %6
%31 = call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %29, i32 %30)
br label %32
32: ; preds = %18
%33 = load i32, i32* %9
%34 = add nsw i32 %33, -1
store i32 %34, i32* %9
br label %15
35: ; preds = %15
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %10
39: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @_transmit_bytes(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %42
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %40, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = lshr i8 %10, 7
%12 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %11, i32 %2)
%13 = load i8, i8* %9
%14 = lshr i8 %13, 6
%15 = and i8 %14, 1
%16 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %15, i32 %2)
%17 = load i8, i8* %9
%18 = lshr i8 %17, 5
%19 = and i8 %18, 1
%20 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %19, i32 %2)
%21 = load i8, i8* %9
%22 = lshr i8 %21, 4
%23 = and i8 %22, 1
%24 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %23, i32 %2)
%25 = load i8, i8* %9
%26 = lshr i8 %25, 3
%27 = and i8 %26, 1
%28 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %27, i32 %2)
%29 = load i8, i8* %9
%30 = lshr i8 %29, 2
%31 = and i8 %30, 1
%32 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %31, i32 %2)
%33 = load i8, i8* %9
%34 = lshr i8 %33, 1
%35 = and i8 %34, 1
%36 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %35, i32 %2)
%37 = load i8, i8* %9
%38 = and i8 %37, 1
%39 = tail call i32 @_transmit_to_gpio_with_increased_bit(i8 zeroext %38, i32 %2)
%40 = add nuw nsw i64 %8, 1
%41 = icmp eq i64 %40, %6
br i1 %41, label %42, label %7
42: ; preds = %7, %3
ret void
}