#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ charoutsmall(int, int, int);
void LCD_disp_str(uint8_t *theStr, uint8_t theLen, uint8_t startx, uint8_t y,
                  uint8_t theFormat) {
  uint8_t invmask = theFormat & 0x80;
  for (uint8_t q = 0; q < theLen; q++) {
    charoutsmall(theStr[q] | invmask, startx, y);
    startx += 6;
  }
}


x86 assembly (clang, -O0):
<LCD_disp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0x80,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <LCD_disp_str+0x67>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
or     -0x1c(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <charoutsmall@plt>
mov    -0x10(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113b <LCD_disp_str+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_disp_str>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    115d <LCD_disp_str+0x4d>
mov    %r8d,%r15d
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rdi,%r12
and    $0x80,%r15d
mov    %esi,%r13d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%edi
or     %r15d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <charoutsmall@plt>
add    $0x6,%ebp
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <LCD_disp_str+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @LCD_disp_str(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %4, 128
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = zext i32 %1 to i64
br label %11
10: ; preds = %11, %5
ret void
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %19, %11 ]
%13 = phi i32 [ %2, %8 ], [ %18, %11 ]
%14 = getelementptr inbounds i32, i32* %0, i64 %12
%15 = load i32, i32* %14
%16 = or i32 %15, %6
%17 = tail call i32 @charoutsmall(i32 %16, i32 %13, i32 %3)
%18 = add nsw i32 %13, 6
%19 = add nuw nsw i64 %12, 1
%20 = icmp eq i64 %19, %9
br i1 %20, label %10, label %11
}