#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*/ LCD_function(unsigned char);
int /*<<< orphan*/ output_char(unsigned char);
void output_char_string(unsigned char line_num, const char output_string[]) {
  unsigned char i, character;
  LCD_function(line_num);
  for (i = 0; output_string[i] != 0; i++) {
    character = output_string[i];
    output_char(character);
  }
}


x86 assembly (clang, -O0):
<output_char_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <LCD_function@plt>
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1178 <output_char_string+0x58>
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%edi
call   1030 <output_char@plt>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    113f <output_char_string+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_char_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <LCD_function@plt>
mov    (%r14),%al
test   %al,%al
je     1157 <output_char_string+0x37>
mov    $0x1,%bl
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <output_char@plt>
movzbl %bl,%ebx
movzbl (%r14,%rbx,1),%eax
add    $0x1,%bl
test   %al,%al
jne    1140 <output_char_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @output_char_string(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8* %1, i8** %4
%7 = load i8, i8* %3
%8 = call i32 @LCD_function(i8 zeroext %7)
store i8 0, i8* %5
br label %9
9: ; preds = %25, %2
%10 = load i8*, i8** %4
%11 = load i8, i8* %5
%12 = zext i8 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %9
%18 = load i8*, i8** %4
%19 = load i8, i8* %5
%20 = zext i8 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
store i8 %22, i8* %6
%23 = load i8, i8* %6
%24 = call i32 @output_char(i8 zeroext %23)
br label %25
25: ; preds = %17
%26 = load i8, i8* %5
%27 = add i8 %26, 1
store i8 %27, i8* %5
br label %9
28: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @output_char_string(i8 zeroext %0, i8* nocapture %1) {
%3 = tail call i32 @LCD_function(i8 zeroext %0)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %13, %6 ], [ %4, %2 ]
%8 = phi i8 [ %10, %6 ], [ 0, %2 ]
%9 = tail call i32 @output_char(i8 zeroext %7)
%10 = add i8 %8, 1
%11 = zext i8 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}