#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 PDCRead(int);
int /*<<< orphan*/ PDCWrite(int, int);
void PDCLCDCreateChar(unsigned char ucChar, unsigned char *pucData) {
  ;
  while ((PDCRead(0x6) & 0x80)) {
  }
  PDCWrite(0x6, 0x40 + (ucChar * 8));
  for (ucChar = 0; ucChar < 8; ucChar++) {
    while ((PDCRead(0x6) & 0x80)) {
    }
    PDCWrite(0x7, *pucData++);
  }
}


x86 assembly (clang, -O0):
<PDCLCDCreateChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     114f <PDCLCDCreateChar+0x2f>
jmp    1132 <PDCLCDCreateChar+0x12>
movzbl -0x1(%rbp),%esi
shl    $0x3,%esi
add    $0x40,%esi
mov    $0x6,%edi
call   1040 <PDCWrite@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    11bf <PDCLCDCreateChar+0x9f>
jmp    1179 <PDCLCDCreateChar+0x59>
mov    $0x6,%edi
call   1030 <PDCRead@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     1196 <PDCLCDCreateChar+0x76>
jmp    1179 <PDCLCDCreateChar+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1167 <PDCLCDCreateChar+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCLCDCreateChar>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1130 <PDCLCDCreateChar+0x10>
movzbl %bpl,%eax
lea    0x40(,%rax,8),%esi
mov    $0x6,%edi
call   1040 <PDCWrite@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1160 <PDCLCDCreateChar+0x40>
movzbl (%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1180 <PDCLCDCreateChar+0x60>
movzbl 0x1(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    11a0 <PDCLCDCreateChar+0x80>
movzbl 0x2(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    11c0 <PDCLCDCreateChar+0xa0>
movzbl 0x3(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    11e0 <PDCLCDCreateChar+0xc0>
movzbl 0x4(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1200 <PDCLCDCreateChar+0xe0>
movzbl 0x5(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1220 <PDCLCDCreateChar+0x100>
movzbl 0x6(%rbx),%esi
mov    $0x7,%edi
call   1040 <PDCWrite@plt>
nopl   0x0(%rax)
mov    $0x6,%edi
call   1030 <PDCRead@plt>
test   $0x80,%al
jne    1240 <PDCLCDCreateChar+0x120>
movzbl 0x7(%rbx),%esi
mov    $0x7,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <PDCWrite@plt>

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

LLVM IR (-O2):
define void @PDCLCDCreateChar(i8 zeroext %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @PDCRead(i32 6)
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = zext i8 %0 to i32
%9 = shl nuw nsw i32 %8, 3
%10 = add nuw nsw i32 %9, 64
%11 = tail call i32 @PDCWrite(i32 6, i32 %10)
br label %12
12: ; preds = %7, %12
%13 = tail call i32 @PDCRead(i32 6)
%14 = and i32 %13, 128
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %12
16: ; preds = %12
%17 = load i8, i8* %1
%18 = zext i8 %17 to i32
%19 = tail call i32 @PDCWrite(i32 7, i32 %18)
br label %20
20: ; preds = %20, %16
%21 = tail call i32 @PDCRead(i32 6)
%22 = and i32 %21, 128
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %20
24: ; preds = %20
%25 = getelementptr inbounds i8, i8* %1, i64 1
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = tail call i32 @PDCWrite(i32 7, i32 %27)
br label %29
29: ; preds = %29, %24
%30 = tail call i32 @PDCRead(i32 6)
%31 = and i32 %30, 128
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %29
33: ; preds = %29
%34 = getelementptr inbounds i8, i8* %1, i64 2
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = tail call i32 @PDCWrite(i32 7, i32 %36)
br label %38
38: ; preds = %38, %33
%39 = tail call i32 @PDCRead(i32 6)
%40 = and i32 %39, 128
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %38
42: ; preds = %38
%43 = getelementptr inbounds i8, i8* %1, i64 3
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = tail call i32 @PDCWrite(i32 7, i32 %45)
br label %47
47: ; preds = %47, %42
%48 = tail call i32 @PDCRead(i32 6)
%49 = and i32 %48, 128
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %47
51: ; preds = %47
%52 = getelementptr inbounds i8, i8* %1, i64 4
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = tail call i32 @PDCWrite(i32 7, i32 %54)
br label %56
56: ; preds = %56, %51
%57 = tail call i32 @PDCRead(i32 6)
%58 = and i32 %57, 128
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %56
60: ; preds = %56
%61 = getelementptr inbounds i8, i8* %1, i64 5
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = tail call i32 @PDCWrite(i32 7, i32 %63)
br label %65
65: ; preds = %65, %60
%66 = tail call i32 @PDCRead(i32 6)
%67 = and i32 %66, 128
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %65
69: ; preds = %65
%70 = getelementptr inbounds i8, i8* %1, i64 6
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 @PDCWrite(i32 7, i32 %72)
br label %74
74: ; preds = %74, %69
%75 = tail call i32 @PDCRead(i32 6)
%76 = and i32 %75, 128
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %74
78: ; preds = %74
%79 = getelementptr inbounds i8, i8* %1, i64 7
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = tail call i32 @PDCWrite(i32 7, i32 %81)
ret void
}