#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_generic_serial_write(char const *, int const);
void drv_BuE_CT_write(const int row, const int col, const char *data,
                      const int len) {
  char cmd[] = "\033"
               "LCzs\001";
  cmd[3] = (char)row + 1;
  cmd[4] = (char)col + 1;
  drv_generic_serial_write(cmd, 6);
  drv_generic_serial_write(data, len);
}


x86 assembly (clang, -O0):
<drv_BuE_CT_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xecf(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xec7(%rip),%al
mov    %al,-0x15(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x1,%eax
mov    %al,-0x18(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x1,%eax
mov    %al,-0x17(%rbp)
lea    -0x1b(%rbp),%rdi
mov    $0x6,%esi
call   1030 <drv_generic_serial_write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_BuE_CT_write>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
movl   $0x1737a,0x3(%rsp)
movl   $0x7a434c1b,(%rsp)
add    $0x1,%dil
mov    %dil,0x3(%rsp)
add    $0x1,%sil
mov    %sil,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <drv_generic_serial_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.drv_BuE_CT_write.cmd = [7 x i8] c"\1BLCzs\01\00"
define void @drv_BuE_CT_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [7 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = bitcast [7 x i8]* %9 to i8*
%11 = load i32, i32* %5
%12 = trunc i32 %11 to i8
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 1
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 3
store i8 %15, i8* %16
%17 = load i32, i32* %6
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 1
%21 = trunc i32 %20 to i8
%22 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 4
store i8 %21, i8* %22
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
%24 = call i32 @drv_generic_serial_write(i8* %23, i32 6)
%25 = load i8*, i8** %7
%26 = load i32, i32* %8
%27 = call i32 @drv_generic_serial_write(i8* %25, i32 %26)
ret void
}

LLVM IR (-O2):
@__const.drv_BuE_CT_write.cmd = [7 x i8] c"\1BLCzs\01\00"
define void @drv_BuE_CT_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [7 x i8]
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %0 to i8
%8 = add i8 %7, 1
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 3
store i8 %8, i8* %9
%10 = trunc i32 %1 to i8
%11 = add i8 %10, 1
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 4
store i8 %11, i8* %12
%13 = call i32 @drv_generic_serial_write(i8* %6, i32 6)
%14 = call i32 @drv_generic_serial_write(i8* %2, i32 %3)
ret void
}