#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_Pertelian_send(char *, int);
void drv_Pertelian_defchar(const int ascii, const unsigned char *matrix) {
  char cmd[11] = "";
  int i;
  cmd[0] = 0xfe;
  cmd[1] = (0x40 + (8 * ascii));
  for (i = 0; i < 8; i++) {
    cmd[i + 2] = matrix[i] & 0x1f;
  }
  drv_Pertelian_send(cmd, 10);
}


x86 assembly (clang, -O0):
<drv_Pertelian_defchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1b(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
movb   $0xfe,-0x1b(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x40,%eax
mov    %al,-0x1a(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jge    118b <drv_Pertelian_defchar+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1f,%eax
mov    %al,%cl
mov    -0x20(%rbp),%eax
add    $0x2,%eax
cltq
mov    %cl,-0x1b(%rbp,%rax,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1156 <drv_Pertelian_defchar+0x36>
lea    -0x1b(%rbp),%rdi
mov    $0xa,%esi
call   1040 <drv_Pertelian_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Pertelian_defchar>:
sub    $0x18,%rsp
movb   $0x0,0x17(%rsp)
movb   $0xfe,0xd(%rsp)
shl    $0x3,%dil
add    $0x40,%dil
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    0xd(%rsp),%rdi
mov    $0xa,%esi
call   1030 <drv_Pertelian_send@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @drv_Pertelian_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 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 10
store i8 0, i8* %5
store i8 -2, i8* %4
%6 = trunc i32 %0 to i8
%7 = shl i8 %6, 3
%8 = add i8 %7, 64
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = load i8, i8* %1
%11 = and i8 %10, 31
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 2
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %1, i64 1
%14 = load i8, i8* %13
%15 = and i8 %14, 31
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 3
store i8 %15, i8* %16
%17 = getelementptr inbounds i8, i8* %1, i64 2
%18 = load i8, i8* %17
%19 = and i8 %18, 31
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 4
store i8 %19, i8* %20
%21 = getelementptr inbounds i8, i8* %1, i64 3
%22 = load i8, i8* %21
%23 = and i8 %22, 31
%24 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 5
store i8 %23, i8* %24
%25 = getelementptr inbounds i8, i8* %1, i64 4
%26 = load i8, i8* %25
%27 = and i8 %26, 31
%28 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 6
store i8 %27, i8* %28
%29 = getelementptr inbounds i8, i8* %1, i64 5
%30 = load i8, i8* %29
%31 = and i8 %30, 31
%32 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 7
store i8 %31, i8* %32
%33 = getelementptr inbounds i8, i8* %1, i64 6
%34 = load i8, i8* %33
%35 = and i8 %34, 31
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 8
store i8 %35, i8* %36
%37 = getelementptr inbounds i8, i8* %1, i64 7
%38 = load i8, i8* %37
%39 = and i8 %38, 31
%40 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 9
store i8 %39, i8* %40
%41 = call i32 @drv_Pertelian_send(i8* %4, i32 10)
ret void
}