#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_MT_write(const int row, const int col, const char *data,
                      const int len) {
  char cmd[] = "\033"
               "[y;xH";
  cmd[2] = (char)row;
  cmd[4] = (char)col;
  drv_generic_serial_write(cmd, 6);
  drv_generic_serial_write(data, len);
}


x86 assembly (clang, -O0):
<drv_BuE_MT_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
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%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_MT_write>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
movl   $0x3b795b1b,(%rsp)
movl   $0x48783b,0x3(%rsp)
mov    %dil,0x2(%rsp)
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_MT_write.cmd = [7 x i8] c"\1B[y;xH\00"
define void @drv_BuE_MT_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 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 2
store i8 %12, i8* %13
%14 = load i32, i32* %6
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 4
store i8 %15, i8* %16
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
%18 = call i32 @drv_generic_serial_write(i8* %17, i32 6)
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i32 @drv_generic_serial_write(i8* %19, i32 %20)
ret void
}

LLVM IR (-O2):
@__const.drv_BuE_MT_write.cmd = [7 x i8] c"\1B[y;xH\00"
define void @drv_BuE_MT_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 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 2
store i8 %7, i8* %8
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 4
store i8 %9, i8* %10
%11 = call i32 @drv_generic_serial_write(i8* %6, i32 6)
%12 = call i32 @drv_generic_serial_write(i8* %2, i32 %3)
ret void
}