#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*/ Write_LCD(int, char *, int);
void Set_Insert(int fd, int row, int col) {
  if (row == 0 && col == 0) {
    char cmd[] = {254, 72, 253};
    Write_LCD(fd, cmd, 3);
  } else {
    char cmd[] = {254, 71, 0, 0, 253};
    cmd[2] = (char)col;
    cmd[3] = (char)row;
    Write_LCD(fd, cmd, 5);
  }
}


x86 assembly (clang, -O0):
<Set_Insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115f <Set_Insert+0x4f>
cmpl   $0x0,-0xc(%rbp)
jne    115f <Set_Insert+0x4f>
mov    0xec4(%rip),%ax
mov    %ax,-0xf(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xf(%rbp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
jmp    118e <Set_Insert+0x7e>
mov    0xe9e(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xe99(%rip),%al
mov    %al,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x5,%edx
call   1030 <Write_LCD@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set_Insert>:
sub    $0x18,%rsp
mov    %edx,%eax
or     %esi,%eax
je     113c <Set_Insert+0x2c>
movl   $0x47fe,0xc(%rsp)
movb   $0xfd,0x10(%rsp)
mov    %dl,0xe(%rsp)
mov    %sil,0xf(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x5,%edx
jmp    1152 <Set_Insert+0x42>
movb   $0xfd,0x16(%rsp)
movw   $0x48fe,0x14(%rsp)
lea    0x14(%rsp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.Set_Insert.cmd = [3 x i8] c"\FEH\FD"
@__const.Set_Insert.cmd.1 = [5 x i8] c"\FEG\00\00\FD"
define void @Set_Insert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x i8]
%8 = alloca [5 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = bitcast [3 x i8]* %7 to i8*
%16 = load i32, i32* %4
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%18 = call i32 @Write_LCD(i32 %16, i8* %17, i32 3)
br label %30
19: ; preds = %11, %3
%20 = bitcast [5 x i8]* %8 to i8*
%21 = load i32, i32* %6
%22 = trunc i32 %21 to i8
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 2
store i8 %22, i8* %23
%24 = load i32, i32* %5
%25 = trunc i32 %24 to i8
%26 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 3
store i8 %25, i8* %26
%27 = load i32, i32* %4
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%29 = call i32 @Write_LCD(i32 %27, i8* %28, i32 5)
br label %30
30: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
@__const.Set_Insert.cmd = [3 x i8] c"\FEH\FD"
@__const.Set_Insert.cmd.1 = [5 x i8] c"\FEG\00\00\FD"
define void @Set_Insert(i32 %0, i32 %1, i32 %2) {
%4 = alloca [3 x i8]
%5 = alloca [5 x i8]
%6 = or i32 %2, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%10 = call i32 @Write_LCD(i32 %0, i8* %9, i32 3)
br label %18
11: ; preds = %3
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%13 = trunc i32 %2 to i8
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
store i8 %13, i8* %14
%15 = trunc i32 %1 to i8
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
store i8 %15, i8* %16
%17 = call i32 @Write_LCD(i32 %0, i8* %12, i32 5)
br label %18
18: ; preds = %11, %8
ret void
}