#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*/ st7036_clear();
int /*<<< orphan*/ st7036_cursor_position(int /*<<< orphan*/, int);
int /*<<< orphan*/ st7036_lcd_buffer(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void lcd_text_lines(char *s1, char *s2, char *s3) {
  char st[16];
  st7036_clear();
  strncpy(st, s1, 16);
  st7036_cursor_position(0, 0);
  st7036_lcd_buffer(st);
  strncpy(st, s2, 16);
  st7036_cursor_position(0, 1);
  st7036_lcd_buffer(st);
  strncpy(st, s3, 16);
  st7036_cursor_position(0, 2);
  st7036_lcd_buffer(st);
}


x86 assembly (clang, -O0):
<lcd_text_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <st7036_clear@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <st7036_cursor_position@plt>
lea    -0x30(%rbp),%rdi
call   1050 <st7036_lcd_buffer@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <st7036_cursor_position@plt>
lea    -0x30(%rbp),%rdi
call   1050 <st7036_lcd_buffer@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <st7036_cursor_position@plt>
lea    -0x30(%rbp),%rdi
call   1050 <st7036_lcd_buffer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_text_lines>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <st7036_clear@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <st7036_cursor_position@plt>
mov    %r12,%rdi
call   1050 <st7036_lcd_buffer@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <st7036_cursor_position@plt>
mov    %r12,%rdi
call   1050 <st7036_lcd_buffer@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <st7036_cursor_position@plt>
mov    %r12,%rdi
call   1050 <st7036_lcd_buffer@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @lcd_text_lines(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 (...) @st7036_clear()
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @strncpy(i8* %9, i8* %10, i32 16)
%12 = call i32 @st7036_cursor_position(i32 0, i32 0)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%14 = call i32 @st7036_lcd_buffer(i8* %13)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %5
%17 = call i32 @strncpy(i8* %15, i8* %16, i32 16)
%18 = call i32 @st7036_cursor_position(i32 0, i32 1)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%20 = call i32 @st7036_lcd_buffer(i8* %19)
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%22 = load i8*, i8** %6
%23 = call i32 @strncpy(i8* %21, i8* %22, i32 16)
%24 = call i32 @st7036_cursor_position(i32 0, i32 2)
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%26 = call i32 @st7036_lcd_buffer(i8* %25)
ret void
}

LLVM IR (-O2):
define void @lcd_text_lines(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 (...) @st7036_clear()
%7 = call i32 @strncpy(i8* %5, i8* %0, i32 16)
%8 = call i32 @st7036_cursor_position(i32 0, i32 0)
%9 = call i32 @st7036_lcd_buffer(i8* %5)
%10 = call i32 @strncpy(i8* %5, i8* %1, i32 16)
%11 = call i32 @st7036_cursor_position(i32 0, i32 1)
%12 = call i32 @st7036_lcd_buffer(i8* %5)
%13 = call i32 @strncpy(i8* %5, i8* %2, i32 16)
%14 = call i32 @st7036_cursor_position(i32 0, i32 2)
%15 = call i32 @st7036_lcd_buffer(i8* %5)
ret void
}