#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 lcd_getnextcharacterpos(char *, int);
int lcd_getprevcharacterpos(char *, int);
char *lcd_getutf8char(char *, int);
char *lcd_parsespecial(char *);
int lcd_width();
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *lcd_inputbuildscrollingline(char *selstr, int selection) {
  int i, p;
  static char linebuf[128];
  char *utf8char;
  int preview;
  if (selstr == NULL)
    return "";
  strcpy(linebuf, "");
  preview = (lcd_width() - 5) / 2;
  for (p = selection, i = 0; i < preview; i++)
    p = lcd_getprevcharacterpos(selstr, p);
  for (i = 0; i < preview; i++) {
    utf8char = lcd_getutf8char(selstr, p);
    strcat(linebuf, lcd_parsespecial(utf8char));
    p = lcd_getnextcharacterpos(selstr, p);
  }
  utf8char = lcd_getutf8char(selstr, p);
  if (strcmp(utf8char, "\xee\x80\x80") == 0) {
    strcat(linebuf, " END ");
    p = lcd_getnextcharacterpos(selstr, p);
    p = lcd_getnextcharacterpos(selstr, p);
    p = lcd_getnextcharacterpos(selstr, p);
  } else if (strcmp(utf8char, "\xee\x80\x83") == 0) {
    strcat(linebuf, " DEL ");
    p = lcd_getnextcharacterpos(selstr, p);
    p = lcd_getnextcharacterpos(selstr, p);
    p = lcd_getnextcharacterpos(selstr, p);
  } else {
    strcat(linebuf, " <");
    strcat(linebuf, utf8char);
    strcat(linebuf, "> ");
    p = lcd_getnextcharacterpos(selstr, p);
  }
  for (i = 0; i < preview; i++) {
    utf8char = lcd_getutf8char(selstr, p);
    strcat(linebuf, lcd_parsespecial(utf8char));
    p = lcd_getnextcharacterpos(selstr, p);
  }
  if (lcd_width() != (preview + 5 + preview)) {
    strcat(linebuf, " ");
  }
  return linebuf;
}


x86 assembly (clang, -O0):
<lcd_inputbuildscrollingline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11aa <lcd_inputbuildscrollingline+0x2a>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1406 <lcd_inputbuildscrollingline+0x286>
lea    0x2ebf(%rip),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcpy@plt>
mov    $0x0,%al
call   1050 <lcd_width@plt>
sub    $0x5,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1208 <lcd_inputbuildscrollingline+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <lcd_getprevcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11df <lcd_inputbuildscrollingline+0x5f>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1260 <lcd_inputbuildscrollingline+0xe0>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <lcd_parsespecial@plt>
mov    %rax,%rsi
lea    0x2e32(%rip),%rdi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120f <lcd_inputbuildscrollingline+0x8f>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12cf <lcd_inputbuildscrollingline+0x14f>
lea    0x2ddf(%rip),%rdi
lea    0xd6c(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
jmp    1378 <lcd_inputbuildscrollingline+0x1f8>
mov    -0x28(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    132e <lcd_inputbuildscrollingline+0x1ae>
lea    0x2d80(%rip),%rdi
lea    0xd17(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
jmp    1373 <lcd_inputbuildscrollingline+0x1f3>
lea    0x2d3b(%rip),%rdi
lea    0xcd8(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x28(%rbp),%rsi
lea    0x2d24(%rip),%rdi
call   10a0 <strcat@plt>
lea    0x2d18(%rip),%rdi
lea    0xcb8(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
jmp    1378 <lcd_inputbuildscrollingline+0x1f8>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13d0 <lcd_inputbuildscrollingline+0x250>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <lcd_parsespecial@plt>
mov    %rax,%rsi
lea    0x2cc2(%rip),%rdi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    137f <lcd_inputbuildscrollingline+0x1ff>
mov    $0x0,%al
call   1050 <lcd_width@plt>
mov    -0x2c(%rbp),%ecx
add    $0x5,%ecx
add    -0x2c(%rbp),%ecx
cmp    %ecx,%eax
je     13fb <lcd_inputbuildscrollingline+0x27b>
lea    0x2c81(%rip),%rdi
lea    0xc22(%rip),%rsi
call   10a0 <strcat@plt>
lea    0x2c6e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_inputbuildscrollingline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     12a5 <lcd_inputbuildscrollingline+0x125>
mov    %esi,%ebp
mov    %rdi,%r13
lea    0x2ed0(%rip),%rdi
lea    0xe72(%rip),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
call   1050 <lcd_width@plt>
mov    %eax,%r15d
lea    -0x5(%r15),%eax
shr    $0x1f,%eax
lea    (%r15,%rax,1),%r14d
add    $0xfffffffb,%r14d
sar    %r14d
cmp    $0x7,%r15d
jl     123e <lcd_inputbuildscrollingline+0xbe>
cmp    $0x2,%r14d
mov    $0x1,%ebx
cmovge %r14d,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %ebp,%esi
call   1030 <lcd_getprevcharacterpos@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    11e0 <lcd_inputbuildscrollingline+0x60>
cmp    $0x7,%r15d
jl     123e <lcd_inputbuildscrollingline+0xbe>
cmp    $0x2,%r14d
mov    $0x1,%ebx
cmovge %r14d,%ebx
lea    0x2e65(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %ebp,%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,%rdi
call   1080 <lcd_parsespecial@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %ebp,%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    1210 <lcd_inputbuildscrollingline+0x90>
mov    %r13,%rdi
mov    %ebp,%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,%r12
lea    0xdae(%rip),%rsi
mov    %rax,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12b1 <lcd_inputbuildscrollingline+0x131>
lea    0xda4(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12c1 <lcd_inputbuildscrollingline+0x141>
lea    0x2df6(%rip),%rbx
lea    0xd93(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <strcat@plt>
lea    0xd7c(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
jmp    12ea <lcd_inputbuildscrollingline+0x16a>
lea    0xd6d(%rip),%r12
jmp    1376 <lcd_inputbuildscrollingline+0x1f6>
lea    0x2db8(%rip),%rdi
lea    0xd45(%rip),%rsi
jmp    12cf <lcd_inputbuildscrollingline+0x14f>
lea    0x2da8(%rip),%rdi
lea    0xd3f(%rip),%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %ebp,%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,%ebp
lea    0x2d7f(%rip),%r12
mov    %r13,%rdi
mov    %ebp,%esi
call   1060 <lcd_getnextcharacterpos@plt>
cmp    $0x7,%r15d
jl     134e <lcd_inputbuildscrollingline+0x1ce>
mov    %eax,%ebp
cmp    $0x2,%r14d
mov    $0x1,%ebx
cmovge %r14d,%ebx
lea    0x2d59(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %ebp,%esi
call   1090 <lcd_getutf8char@plt>
mov    %rax,%rdi
call   1080 <lcd_parsespecial@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %ebp,%esi
call   1060 <lcd_getnextcharacterpos@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    1320 <lcd_inputbuildscrollingline+0x1a0>
xor    %eax,%eax
call   1050 <lcd_width@plt>
lea    (%r14,%r14,1),%ecx
add    $0x5,%ecx
cmp    %ecx,%eax
je     1376 <lcd_inputbuildscrollingline+0x1f6>
lea    0x2d09(%rip),%r12
lea    0xcaa(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcat@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@lcd_inputbuildscrollingline.linebuf = internal global [128 x i8] zeroinitializer
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"\EE\80\80\00"
@.str.2 = [6 x i8] c" END \00"
@.str.3 = [4 x i8] c"\EE\80\83\00"
@.str.4 = [6 x i8] c" DEL \00"
@.str.5 = [3 x i8] c" <\00"
@.str.6 = [3 x i8] c"> \00"
@.str.7 = [2 x i8] c" \00"
define i8* @lcd_inputbuildscrollingline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %118
13: ; preds = %2
%14 = call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @lcd_width()
%16 = sub nsw i32 %15, 5
%17 = sdiv i32 %16, 2
store i32 %17, i32* %9
%18 = load i32, i32* %5
store i32 %18, i32* %7
store i32 0, i32* %6
br label %19
19: ; preds = %27, %13
%20 = load i32, i32* %6
%21 = load i32, i32* %9
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i8*, i8** %4
%25 = load i32, i32* %7
%26 = call i32 @lcd_getprevcharacterpos(i8* %24, i32 %25)
store i32 %26, i32* %7
br label %27
27: ; preds = %23
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %19
30: ; preds = %19
store i32 0, i32* %6
br label %31
31: ; preds = %45, %30
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %48
35: ; preds = %31
%36 = load i8*, i8** %4
%37 = load i32, i32* %7
%38 = call i8* @lcd_getutf8char(i8* %36, i32 %37)
store i8* %38, i8** %8
%39 = load i8*, i8** %8
%40 = call i8* @lcd_parsespecial(i8* %39)
%41 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %4
%43 = load i32, i32* %7
%44 = call i32 @lcd_getnextcharacterpos(i8* %42, i32 %43)
store i32 %44, i32* %7
br label %45
45: ; preds = %35
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %31
48: ; preds = %31
%49 = load i8*, i8** %4
%50 = load i32, i32* %7
%51 = call i8* @lcd_getutf8char(i8* %49, i32 %50)
store i8* %51, i8** %8
%52 = load i8*, i8** %8
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %66
55: ; preds = %48
%56 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%57 = load i8*, i8** %4
%58 = load i32, i32* %7
%59 = call i32 @lcd_getnextcharacterpos(i8* %57, i32 %58)
store i32 %59, i32* %7
%60 = load i8*, i8** %4
%61 = load i32, i32* %7
%62 = call i32 @lcd_getnextcharacterpos(i8* %60, i32 %61)
store i32 %62, i32* %7
%63 = load i8*, i8** %4
%64 = load i32, i32* %7
%65 = call i32 @lcd_getnextcharacterpos(i8* %63, i32 %64)
store i32 %65, i32* %7
br label %90
66: ; preds = %48
%67 = load i8*, i8** %8
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %81
70: ; preds = %66
%71 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%72 = load i8*, i8** %4
%73 = load i32, i32* %7
%74 = call i32 @lcd_getnextcharacterpos(i8* %72, i32 %73)
store i32 %74, i32* %7
%75 = load i8*, i8** %4
%76 = load i32, i32* %7
%77 = call i32 @lcd_getnextcharacterpos(i8* %75, i32 %76)
store i32 %77, i32* %7
%78 = load i8*, i8** %4
%79 = load i32, i32* %7
%80 = call i32 @lcd_getnextcharacterpos(i8* %78, i32 %79)
store i32 %80, i32* %7
br label %89
81: ; preds = %66
%82 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%83 = load i8*, i8** %8
%84 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %83)
%85 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%86 = load i8*, i8** %4
%87 = load i32, i32* %7
%88 = call i32 @lcd_getnextcharacterpos(i8* %86, i32 %87)
store i32 %88, i32* %7
br label %89
89: ; preds = %81, %70
br label %90
90: ; preds = %89, %55
store i32 0, i32* %6
br label %91
91: ; preds = %105, %90
%92 = load i32, i32* %6
%93 = load i32, i32* %9
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %108
95: ; preds = %91
%96 = load i8*, i8** %4
%97 = load i32, i32* %7
%98 = call i8* @lcd_getutf8char(i8* %96, i32 %97)
store i8* %98, i8** %8
%99 = load i8*, i8** %8
%100 = call i8* @lcd_parsespecial(i8* %99)
%101 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %100)
%102 = load i8*, i8** %4
%103 = load i32, i32* %7
%104 = call i32 @lcd_getnextcharacterpos(i8* %102, i32 %103)
store i32 %104, i32* %7
br label %105
105: ; preds = %95
%106 = load i32, i32* %6
%107 = add nsw i32 %106, 1
store i32 %107, i32* %6
br label %91
108: ; preds = %91
%109 = call i32 (...) @lcd_width()
%110 = load i32, i32* %9
%111 = add nsw i32 %110, 5
%112 = load i32, i32* %9
%113 = add nsw i32 %111, %112
%114 = icmp ne i32 %109, %113
br i1 %114, label %115, label %117
115: ; preds = %108
%116 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %117
117: ; preds = %115, %108
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8** %3
br label %118
118: ; preds = %117, %12
%119 = load i8*, i8** %3
ret i8* %119
}

LLVM IR (-O2):
@lcd_inputbuildscrollingline.linebuf = internal global [128 x i8] zeroinitializer
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"\EE\80\80\00"
@.str.2 = [6 x i8] c" END \00"
@.str.3 = [4 x i8] c"\EE\80\83\00"
@.str.4 = [6 x i8] c" DEL \00"
@.str.5 = [3 x i8] c" <\00"
@.str.6 = [3 x i8] c"> \00"
@.str.7 = [2 x i8] c" \00"
define i8* @lcd_inputbuildscrollingline(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %71, label %4
4: ; preds = %2
%5 = tail call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @lcd_width()
%7 = add nsw i32 %6, -5
%8 = sdiv i32 %7, 2
%9 = icmp sgt i32 %6, 6
br i1 %9, label %10, label %30
10: ; preds = %4
%11 = call i32 @llvm.smax.i32(i32 %8, i32 1)
br label %15
12: ; preds = %15
br i1 %9, label %13, label %30
13: ; preds = %12
%14 = call i32 @llvm.smax.i32(i32 %8, i32 1)
br label %21
15: ; preds = %10, %15
%16 = phi i32 [ %18, %15 ], [ %1, %10 ]
%17 = phi i32 [ %19, %15 ], [ 0, %10 ]
%18 = tail call i32 @lcd_getprevcharacterpos(i8* %0, i32 %16)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, %11
br i1 %20, label %12, label %15
21: ; preds = %13, %21
%22 = phi i32 [ %27, %21 ], [ %18, %13 ]
%23 = phi i32 [ %28, %21 ], [ 0, %13 ]
%24 = tail call i8* @lcd_getutf8char(i8* %0, i32 %22)
%25 = tail call i8* @lcd_parsespecial(i8* %24)
%26 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %25)
%27 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %22)
%28 = add nuw nsw i32 %23, 1
%29 = icmp eq i32 %28, %14
br i1 %29, label %30, label %21
30: ; preds = %21, %4, %12
%31 = phi i32 [ %18, %12 ], [ %1, %4 ], [ %27, %21 ]
%32 = tail call i8* @lcd_getutf8char(i8* %0, i32 %31)
%33 = tail call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %30
%36 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%37 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %31)
%38 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %37)
br label %50
39: ; preds = %30
%40 = tail call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%44 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %31)
%45 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %44)
br label %50
46: ; preds = %39
%47 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%48 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %32)
%49 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %42, %46, %35
%51 = phi i32 [ %45, %42 ], [ %31, %46 ], [ %38, %35 ]
%52 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %51)
br i1 %9, label %53, label %64
53: ; preds = %50
%54 = call i32 @llvm.smax.i32(i32 %8, i32 1)
br label %55
55: ; preds = %53, %55
%56 = phi i32 [ %61, %55 ], [ %52, %53 ]
%57 = phi i32 [ %62, %55 ], [ 0, %53 ]
%58 = tail call i8* @lcd_getutf8char(i8* %0, i32 %56)
%59 = tail call i8* @lcd_parsespecial(i8* %58)
%60 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* %59)
%61 = tail call i32 @lcd_getnextcharacterpos(i8* %0, i32 %56)
%62 = add nuw nsw i32 %57, 1
%63 = icmp eq i32 %62, %54
br i1 %63, label %64, label %55
64: ; preds = %55, %50
%65 = tail call i32 (...) @lcd_width()
%66 = shl nsw i32 %8, 1
%67 = add i32 %66, 5
%68 = icmp eq i32 %65, %67
br i1 %68, label %71, label %69
69: ; preds = %64
%70 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %71
71: ; preds = %64, %69, %2
%72 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), %69 ], [ getelementptr inbounds ([128 x i8], [128 x i8]* @lcd_inputbuildscrollingline.linebuf, i64 0, i64 0), %64 ]
ret i8* %72
}