#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*/ drv_HD_I2C_byte(unsigned char const, int /*<<< orphan*/);
void drv_HD_I2C_data(const unsigned char controller, const char *string,
                     const int len,
                     __attribute__((unused)) const unsigned long delay) {
  int l = len;
  if (len <= 0)
    return;
  while (l--) {
    drv_HD_I2C_byte(controller, *(string++));
  }
}


x86 assembly (clang, -O0):
<drv_HD_I2C_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     113e <drv_HD_I2C_data+0x2e>
jmp    1179 <drv_HD_I2C_data+0x69>
jmp    1143 <drv_HD_I2C_data+0x33>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     1179 <drv_HD_I2C_data+0x69>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%esi
movzbl %al,%edi
call   1030 <drv_HD_I2C_byte@plt>
jmp    1143 <drv_HD_I2C_data+0x33>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_HD_I2C_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <drv_HD_I2C_data+0x35>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
movzbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %ebp,%edi
call   1030 <drv_HD_I2C_byte@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <drv_HD_I2C_data+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @drv_HD_I2C_data(i8 zeroext %0, i8* %1, i32 %2, i64 %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
store i8 %0, i8* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
store i32 %10, i32* %9
%11 = load i32, i32* %7
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
br label %26
14: ; preds = %4
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %9
%17 = add nsw i32 %16, -1
store i32 %17, i32* %9
%18 = icmp ne i32 %16, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i8, i8* %5
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %6
%23 = load i8, i8* %21
%24 = sext i8 %23 to i32
%25 = call i32 @drv_HD_I2C_byte(i8 zeroext %20, i32 %24)
br label %15
26: ; preds = %13, %15
ret void
}

LLVM IR (-O2):
define void @drv_HD_I2C_data(i8 zeroext %0, i8* nocapture %1, i32 %2, i64 %3) {
%5 = icmp slt i32 %2, 1
br i1 %5, label %15, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %2, %4 ]
%8 = phi i8* [ %10, %6 ], [ %1, %4 ]
%9 = add nsw i32 %7, -1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = sext i8 %11 to i32
%13 = tail call i32 @drv_HD_I2C_byte(i8 zeroext %0, i32 %12)
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %4
ret void
}