#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_Newhaven_sendCommand(char, char *, int);
void drv_Newhaven_defchar(const int ascii, const unsigned char *matrix) {
  char cmd;
  char wData[9];
  int i;
  cmd = 0x54;
  wData[0] = ascii;
  for (i = 0; i < 8; i++) {
    wData[i + 1] = *matrix++;
  }
  drv_Newhaven_sendCommand(cmd, wData, 9);
}


x86 assembly (clang, -O0):
<drv_Newhaven_defchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x54,-0x11(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x1a(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jge    1165 <drv_Newhaven_defchar+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x1a(%rbp,%rax,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1130 <drv_Newhaven_defchar+0x20>
mov    -0x11(%rbp),%al
lea    -0x1a(%rbp),%rsi
mov    $0x9,%edx
movsbl %al,%edi
call   1030 <drv_Newhaven_sendCommand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Newhaven_defchar>:
sub    $0x18,%rsp
mov    %dil,0xf(%rsp)
mov    (%rsi),%rax
mov    %rax,0x10(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x54,%edi
mov    $0x9,%edx
call   1030 <drv_Newhaven_sendCommand@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @drv_Newhaven_defchar(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca [9 x i8]
%7 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8 84, i8* %5
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
store i8 %9, i8* %10
store i32 0, i32* %7
br label %11
11: ; preds = %22, %2
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8, i8* %15
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %11
25: ; preds = %11
%26 = load i8, i8* %5
%27 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%28 = call i32 @drv_Newhaven_sendCommand(i8 signext %26, i8* %27, i32 9)
ret void
}

LLVM IR (-O2):
define void @drv_Newhaven_defchar(i32 %0, i8* nocapture %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %0 to i8
store i8 %5, i8* %4
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
%7 = bitcast i8* %1 to i64*
%8 = bitcast i8* %6 to i64*
%9 = load i64, i64* %7
store i64 %9, i64* %8
%10 = call i32 @drv_Newhaven_sendCommand(i8 signext 84, i8* %4, i32 9)
ret void
}