#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 *, int);
void drv_MO_defchar(const int ascii, const unsigned char *matrix) {
  int i;
  char cmd[11] = "\376N";
  cmd[2] = (char)ascii;
  for (i = 0; i < 8; i++) {
    cmd[i + 3] = matrix[i] & 0x1f;
  }
  drv_generic_serial_write(cmd, 11);
}


x86 assembly (clang, -O0):
<drv_MO_defchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x15(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x1d(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1180 <drv_MO_defchar+0x70>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1f,%eax
mov    %al,%cl
mov    -0x14(%rbp),%eax
add    $0x3,%eax
cltq
mov    %cl,-0x1f(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <drv_MO_defchar+0x3b>
lea    -0x1f(%rbp),%rdi
mov    $0xb,%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_MO_defchar>:
sub    $0x18,%rsp
movw   $0x4efe,0xc(%rsp)
mov    %dil,0xe(%rsp)
mov    (%rsi),%al
and    $0x1f,%al
mov    %al,0xf(%rsp)
mov    0x1(%rsi),%al
and    $0x1f,%al
mov    %al,0x10(%rsp)
mov    0x2(%rsi),%al
and    $0x1f,%al
mov    %al,0x11(%rsp)
mov    0x3(%rsi),%al
and    $0x1f,%al
mov    %al,0x12(%rsp)
mov    0x4(%rsi),%al
and    $0x1f,%al
mov    %al,0x13(%rsp)
mov    0x5(%rsi),%al
and    $0x1f,%al
mov    %al,0x14(%rsp)
mov    0x6(%rsi),%al
and    $0x1f,%al
mov    %al,0x15(%rsp)
mov    0x7(%rsi),%al
and    $0x1f,%al
mov    %al,0x16(%rsp)
lea    0xc(%rsp),%rdi
mov    $0xb,%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @drv_MO_defchar(i32 %0, i8* nocapture %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = bitcast [11 x i8]* %3 to i16*
store i16 20222, i16* %5
%6 = trunc i32 %0 to i8
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 2
store i8 %6, i8* %7
%8 = load i8, i8* %1
%9 = and i8 %8, 31
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 3
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 1
%12 = load i8, i8* %11
%13 = and i8 %12, 31
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 4
store i8 %13, i8* %14
%15 = getelementptr inbounds i8, i8* %1, i64 2
%16 = load i8, i8* %15
%17 = and i8 %16, 31
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 5
store i8 %17, i8* %18
%19 = getelementptr inbounds i8, i8* %1, i64 3
%20 = load i8, i8* %19
%21 = and i8 %20, 31
%22 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 6
store i8 %21, i8* %22
%23 = getelementptr inbounds i8, i8* %1, i64 4
%24 = load i8, i8* %23
%25 = and i8 %24, 31
%26 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 7
store i8 %25, i8* %26
%27 = getelementptr inbounds i8, i8* %1, i64 5
%28 = load i8, i8* %27
%29 = and i8 %28, 31
%30 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 8
store i8 %29, i8* %30
%31 = getelementptr inbounds i8, i8* %1, i64 6
%32 = load i8, i8* %31
%33 = and i8 %32, 31
%34 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 9
store i8 %33, i8* %34
%35 = getelementptr inbounds i8, i8* %1, i64 7
%36 = load i8, i8* %35
%37 = and i8 %36, 31
%38 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 10
store i8 %37, i8* %38
%39 = call i32 @drv_generic_serial_write(i8* %4, i32 11)
ret void
}