#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 */
scalar_t__ BusyXLCD();
int /*<<< orphan*/ PutsXLCD(char *);
int /*<<< orphan*/ SetDDRamAddr(int);
int /*<<< orphan*/ putcXLCD(char);
char strlen(char *);
void UifPrintStrLine2(char *str) {
  char length;
  if (str) {
    {
      do {
        while (BusyXLCD())
          ;
      } while (0);
      SetDDRamAddr(0x40);
    };
    length = strlen(str);
    {
      do {
        while (BusyXLCD())
          ;
      } while (0);
      PutsXLCD((char *)(str));
    };
    for (; length < 16; length++) {
      do {
        while (BusyXLCD())
          ;
      } while (0);
      putcXLCD(' ');
    };
  }
}


x86 assembly (clang, -O0):
<UifPrintStrLine2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1219 <UifPrintStrLine2+0xc9>
jmp    116c <UifPrintStrLine2+0x1c>
jmp    1171 <UifPrintStrLine2+0x21>
mov    $0x0,%al
call   1060 <BusyXLCD@plt>
cmp    $0x0,%rax
je     1187 <UifPrintStrLine2+0x37>
jmp    1171 <UifPrintStrLine2+0x21>
jmp    118c <UifPrintStrLine2+0x3c>
mov    $0x40,%edi
call   1050 <SetDDRamAddr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %al,-0x9(%rbp)
jmp    11a7 <UifPrintStrLine2+0x57>
mov    $0x0,%al
call   1060 <BusyXLCD@plt>
cmp    $0x0,%rax
je     11bd <UifPrintStrLine2+0x6d>
jmp    11a7 <UifPrintStrLine2+0x57>
jmp    11c2 <UifPrintStrLine2+0x72>
mov    -0x8(%rbp),%rdi
call   1070 <PutsXLCD@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x10,%eax
jge    1214 <UifPrintStrLine2+0xc4>
jmp    11dd <UifPrintStrLine2+0x8d>
jmp    11e2 <UifPrintStrLine2+0x92>
mov    $0x0,%al
call   1060 <BusyXLCD@plt>
cmp    $0x0,%rax
je     11f8 <UifPrintStrLine2+0xa8>
jmp    11e2 <UifPrintStrLine2+0x92>
jmp    11fd <UifPrintStrLine2+0xad>
mov    $0x20,%edi
call   1030 <putcXLCD@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    11cb <UifPrintStrLine2+0x7b>
jmp    1219 <UifPrintStrLine2+0xc9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UifPrintStrLine2>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     11be <UifPrintStrLine2+0x6e>
mov    %rdi,%r14
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <BusyXLCD@plt>
test   %rax,%rax
jne    1160 <UifPrintStrLine2+0x10>
mov    $0x40,%edi
call   1050 <SetDDRamAddr@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <BusyXLCD@plt>
test   %rax,%rax
jne    1180 <UifPrintStrLine2+0x30>
mov    %r14,%rdi
call   1070 <PutsXLCD@plt>
cmp    $0xf,%bl
jg     11be <UifPrintStrLine2+0x6e>
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <BusyXLCD@plt>
test   %rax,%rax
jne    11a0 <UifPrintStrLine2+0x50>
mov    $0x20,%edi
call   1030 <putcXLCD@plt>
add    $0x1,%bl
cmp    $0x10,%bl
jne    11a0 <UifPrintStrLine2+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UifPrintStrLine2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %43
6: ; preds = %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %11, %7
%9 = call i64 (...) @BusyXLCD()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %8
br label %13
13: ; preds = %12
%14 = call i32 @SetDDRamAddr(i32 64)
%15 = load i8*, i8** %2
%16 = call signext i8 @strlen(i8* %15)
store i8 %16, i8* %3
br label %17
17: ; preds = %13
br label %18
18: ; preds = %21, %17
%19 = call i64 (...) @BusyXLCD()
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
br label %18
22: ; preds = %18
br label %23
23: ; preds = %22
%24 = load i8*, i8** %2
%25 = call i32 @PutsXLCD(i8* %24)
br label %26
26: ; preds = %39, %23
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp slt i32 %28, 16
br i1 %29, label %30, label %42
30: ; preds = %26
br label %31
31: ; preds = %30
br label %32
32: ; preds = %35, %31
%33 = call i64 (...) @BusyXLCD()
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %32
br label %32
36: ; preds = %32
br label %37
37: ; preds = %36
%38 = call i32 @putcXLCD(i8 signext 32)
br label %39
39: ; preds = %37
%40 = load i8, i8* %3
%41 = add i8 %40, 1
store i8 %41, i8* %3
br label %26
42: ; preds = %26
br label %43
43: ; preds = %42, %1
ret void
}

LLVM IR (-O2):
define void @UifPrintStrLine2(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %24, label %3
3: ; preds = %1, %3
%4 = tail call i64 (...) @BusyXLCD()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = tail call i32 @SetDDRamAddr(i32 64)
%8 = tail call signext i8 @strlen(i8* %0)
br label %9
9: ; preds = %9, %6
%10 = tail call i64 (...) @BusyXLCD()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %9
12: ; preds = %9
%13 = tail call i32 @PutsXLCD(i8* %0)
%14 = icmp slt i8 %8, 16
br i1 %14, label %15, label %24
15: ; preds = %12, %20
%16 = phi i8 [ %22, %20 ], [ %8, %12 ]
br label %17
17: ; preds = %15, %17
%18 = tail call i64 (...) @BusyXLCD()
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %17
20: ; preds = %17
%21 = tail call i32 @putcXLCD(i8 signext 32)
%22 = add nsw i8 %16, 1
%23 = icmp eq i8 %22, 16
br i1 %23, label %24, label %15
24: ; preds = %20, %12, %1
ret void
}