#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*/ CMT1_delay_10us(int);
int /*<<< orphan*/ LCD_AQM_wrdat(char);
void LCD_AQM_wrstr(char *s) {
  int i;
  char c;
  for (i = 0; i < 16; i++) {
    c = *(s++);
    if (c == '\0')
      return;
    LCD_AQM_wrdat(c);
    CMT1_delay_10us(3);
  }
  return;
}


x86 assembly (clang, -O0):
<LCD_AQM_wrstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1184 <LCD_AQM_wrstr+0x64>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x0,%eax
jne    1163 <LCD_AQM_wrstr+0x43>
jmp    1189 <LCD_AQM_wrstr+0x69>
movsbl -0xd(%rbp),%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <LCD_AQM_wrstr+0x13>
jmp    1189 <LCD_AQM_wrstr+0x69>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_AQM_wrstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
mov    %rdi,%rbx
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x1(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x2(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x3(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x4(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x5(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x6(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x7(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x8(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0x9(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xa(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xb(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xc(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xd(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xe(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    0xf(%rbx),%al
test   %al,%al
je     12e0 <LCD_AQM_wrstr+0x1c0>
movsbl %al,%edi
call   1030 <LCD_AQM_wrdat@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1040 <CMT1_delay_10us@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @LCD_AQM_wrstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %24
16: ; preds = %8
%17 = load i8, i8* %4
%18 = call i32 @LCD_AQM_wrdat(i8 signext %17)
%19 = call i32 @CMT1_delay_10us(i32 3)
br label %20
20: ; preds = %16
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
br label %24
24: ; preds = %23, %15
ret void
}

LLVM IR (-O2):
define void @LCD_AQM_wrstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %97, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @LCD_AQM_wrdat(i8 signext %2)
%7 = tail call i32 @CMT1_delay_10us(i32 3)
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %97, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = tail call i32 @LCD_AQM_wrdat(i8 signext %8)
%13 = tail call i32 @CMT1_delay_10us(i32 3)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %97, label %16
16: ; preds = %10
%17 = getelementptr inbounds i8, i8* %0, i64 3
%18 = tail call i32 @LCD_AQM_wrdat(i8 signext %14)
%19 = tail call i32 @CMT1_delay_10us(i32 3)
%20 = load i8, i8* %17
%21 = icmp eq i8 %20, 0
br i1 %21, label %97, label %22
22: ; preds = %16
%23 = getelementptr inbounds i8, i8* %0, i64 4
%24 = tail call i32 @LCD_AQM_wrdat(i8 signext %20)
%25 = tail call i32 @CMT1_delay_10us(i32 3)
%26 = load i8, i8* %23
%27 = icmp eq i8 %26, 0
br i1 %27, label %97, label %28
28: ; preds = %22
%29 = getelementptr inbounds i8, i8* %0, i64 5
%30 = tail call i32 @LCD_AQM_wrdat(i8 signext %26)
%31 = tail call i32 @CMT1_delay_10us(i32 3)
%32 = load i8, i8* %29
%33 = icmp eq i8 %32, 0
br i1 %33, label %97, label %34
34: ; preds = %28
%35 = getelementptr inbounds i8, i8* %0, i64 6
%36 = tail call i32 @LCD_AQM_wrdat(i8 signext %32)
%37 = tail call i32 @CMT1_delay_10us(i32 3)
%38 = load i8, i8* %35
%39 = icmp eq i8 %38, 0
br i1 %39, label %97, label %40
40: ; preds = %34
%41 = getelementptr inbounds i8, i8* %0, i64 7
%42 = tail call i32 @LCD_AQM_wrdat(i8 signext %38)
%43 = tail call i32 @CMT1_delay_10us(i32 3)
%44 = load i8, i8* %41
%45 = icmp eq i8 %44, 0
br i1 %45, label %97, label %46
46: ; preds = %40
%47 = getelementptr inbounds i8, i8* %0, i64 8
%48 = tail call i32 @LCD_AQM_wrdat(i8 signext %44)
%49 = tail call i32 @CMT1_delay_10us(i32 3)
%50 = load i8, i8* %47
%51 = icmp eq i8 %50, 0
br i1 %51, label %97, label %52
52: ; preds = %46
%53 = getelementptr inbounds i8, i8* %0, i64 9
%54 = tail call i32 @LCD_AQM_wrdat(i8 signext %50)
%55 = tail call i32 @CMT1_delay_10us(i32 3)
%56 = load i8, i8* %53
%57 = icmp eq i8 %56, 0
br i1 %57, label %97, label %58
58: ; preds = %52
%59 = getelementptr inbounds i8, i8* %0, i64 10
%60 = tail call i32 @LCD_AQM_wrdat(i8 signext %56)
%61 = tail call i32 @CMT1_delay_10us(i32 3)
%62 = load i8, i8* %59
%63 = icmp eq i8 %62, 0
br i1 %63, label %97, label %64
64: ; preds = %58
%65 = getelementptr inbounds i8, i8* %0, i64 11
%66 = tail call i32 @LCD_AQM_wrdat(i8 signext %62)
%67 = tail call i32 @CMT1_delay_10us(i32 3)
%68 = load i8, i8* %65
%69 = icmp eq i8 %68, 0
br i1 %69, label %97, label %70
70: ; preds = %64
%71 = getelementptr inbounds i8, i8* %0, i64 12
%72 = tail call i32 @LCD_AQM_wrdat(i8 signext %68)
%73 = tail call i32 @CMT1_delay_10us(i32 3)
%74 = load i8, i8* %71
%75 = icmp eq i8 %74, 0
br i1 %75, label %97, label %76
76: ; preds = %70
%77 = getelementptr inbounds i8, i8* %0, i64 13
%78 = tail call i32 @LCD_AQM_wrdat(i8 signext %74)
%79 = tail call i32 @CMT1_delay_10us(i32 3)
%80 = load i8, i8* %77
%81 = icmp eq i8 %80, 0
br i1 %81, label %97, label %82
82: ; preds = %76
%83 = getelementptr inbounds i8, i8* %0, i64 14
%84 = tail call i32 @LCD_AQM_wrdat(i8 signext %80)
%85 = tail call i32 @CMT1_delay_10us(i32 3)
%86 = load i8, i8* %83
%87 = icmp eq i8 %86, 0
br i1 %87, label %97, label %88
88: ; preds = %82
%89 = getelementptr inbounds i8, i8* %0, i64 15
%90 = tail call i32 @LCD_AQM_wrdat(i8 signext %86)
%91 = tail call i32 @CMT1_delay_10us(i32 3)
%92 = load i8, i8* %89
%93 = icmp eq i8 %92, 0
br i1 %93, label %97, label %94
94: ; preds = %88
%95 = tail call i32 @LCD_AQM_wrdat(i8 signext %92)
%96 = tail call i32 @CMT1_delay_10us(i32 3)
br label %97
97: ; preds = %94, %88, %82, %76, %70, %64, %58, %52, %46, %40, %34, %28, %22, %16, %10, %4, %1
ret void
}