#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*/ clear_display(int, unsigned char *);
int /*<<< orphan*/ disable_lcd(int, unsigned char *);
int /*<<< orphan*/ enable_blink_cursor(int, unsigned char *);
int /*<<< orphan*/ enable_cursor(int, unsigned char *);
int /*<<< orphan*/ enable_lcd(int, unsigned char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ return_home(int, unsigned char *);
int /*<<< orphan*/ set_line(int, unsigned char *, int);
int /*<<< orphan*/ sleep(int);
void do_some_testing(int fd, unsigned char *data) {
  printf("\n--------------- start testing --------------- \n");
  printf("test-01: enable_cursor \n");
  enable_cursor(fd, data);
  sleep(5);
  printf("test-02: return_home\n");
  return_home(fd, data);
  sleep(5);
  printf("test-03: disable_lcd\n");
  disable_lcd(fd, data);
  sleep(5);
  printf("test-04: enable_lcd\n");
  enable_lcd(fd, data);
  sleep(5);
  printf("test-05: enable_cursor\n");
  enable_cursor(fd, data);
  sleep(5);
  printf("test-06: clear_display\n");
  clear_display(fd, data);
  sleep(5);
  printf("test-07: enable_blinking_cursor\n");
  enable_blink_cursor(fd, data);
  sleep(5);
  printf("test-08: set_line -> SECOND_LINE\n");
  set_line(fd, data, 0xC0);
  printf("--------------- test finished --------------- \n\n");
}


x86 assembly (clang, -O0):
<do_some_testing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe5a(%rip),%rdi
call   1070 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <enable_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe76(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <return_home@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe6a(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <disable_lcd@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe5e(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <enable_lcd@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe51(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <enable_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe47(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <clear_display@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe3d(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <enable_blink_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe3c(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xc0,%edx
call   1040 <set_line@plt>
lea    0xe41(%rip),%rdi
call   1070 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_some_testing>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <enable_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe7d(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <return_home@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <disable_lcd@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe67(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10b0 <enable_lcd@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe5b(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <enable_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe52(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1080 <clear_display@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe49(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <enable_blink_cursor@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
lea    0xe49(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xc0,%edx
call   1050 <set_line@plt>
lea    0xe4f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0A--------------- start testing --------------- \0A\00"
@.str.1 = [25 x i8] c"test-01: enable_cursor \0A\00"
@.str.2 = [22 x i8] c"test-02: return_home\0A\00"
@.str.3 = [22 x i8] c"test-03: disable_lcd\0A\00"
@.str.4 = [21 x i8] c"test-04: enable_lcd\0A\00"
@.str.5 = [24 x i8] c"test-05: enable_cursor\0A\00"
@.str.6 = [24 x i8] c"test-06: clear_display\0A\00"
@.str.7 = [33 x i8] c"test-07: enable_blinking_cursor\0A\00"
@.str.8 = [34 x i8] c"test-08: set_line -> SECOND_LINE\0A\00"
@.str.9 = [49 x i8] c"--------------- test finished --------------- \0A\0A\00"
define void @do_some_testing(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @enable_cursor(i32 %7, i8* %8)
%10 = call i32 @sleep(i32 5)
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = load i8*, i8** %4
%14 = call i32 @return_home(i32 %12, i8* %13)
%15 = call i32 @sleep(i32 5)
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = load i8*, i8** %4
%19 = call i32 @disable_lcd(i32 %17, i8* %18)
%20 = call i32 @sleep(i32 5)
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = load i8*, i8** %4
%24 = call i32 @enable_lcd(i32 %22, i8* %23)
%25 = call i32 @sleep(i32 5)
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = load i8*, i8** %4
%29 = call i32 @enable_cursor(i32 %27, i8* %28)
%30 = call i32 @sleep(i32 5)
%31 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%32 = load i32, i32* %3
%33 = load i8*, i8** %4
%34 = call i32 @clear_display(i32 %32, i8* %33)
%35 = call i32 @sleep(i32 5)
%36 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%37 = load i32, i32* %3
%38 = load i8*, i8** %4
%39 = call i32 @enable_blink_cursor(i32 %37, i8* %38)
%40 = call i32 @sleep(i32 5)
%41 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%42 = load i32, i32* %3
%43 = load i8*, i8** %4
%44 = call i32 @set_line(i32 %42, i8* %43, i32 192)
%45 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"\0A--------------- start testing --------------- \00"
@str.10 = [24 x i8] c"test-01: enable_cursor \00"
@str.11 = [21 x i8] c"test-02: return_home\00"
@str.12 = [21 x i8] c"test-03: disable_lcd\00"
@str.13 = [20 x i8] c"test-04: enable_lcd\00"
@str.14 = [23 x i8] c"test-05: enable_cursor\00"
@str.15 = [23 x i8] c"test-06: clear_display\00"
@str.16 = [32 x i8] c"test-07: enable_blinking_cursor\00"
@str.17 = [33 x i8] c"test-08: set_line -> SECOND_LINE\00"
@str.18 = [48 x i8] c"--------------- test finished --------------- \0A\00"
define void @do_some_testing(i32 %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @enable_cursor(i32 %0, i8* %1)
%6 = tail call i32 @sleep(i32 5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @return_home(i32 %0, i8* %1)
%9 = tail call i32 @sleep(i32 5)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%11 = tail call i32 @disable_lcd(i32 %0, i8* %1)
%12 = tail call i32 @sleep(i32 5)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
%14 = tail call i32 @enable_lcd(i32 %0, i8* %1)
%15 = tail call i32 @sleep(i32 5)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.14, i64 0, i64 0))
%17 = tail call i32 @enable_cursor(i32 %0, i8* %1)
%18 = tail call i32 @sleep(i32 5)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.15, i64 0, i64 0))
%20 = tail call i32 @clear_display(i32 %0, i8* %1)
%21 = tail call i32 @sleep(i32 5)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.16, i64 0, i64 0))
%23 = tail call i32 @enable_blink_cursor(i32 %0, i8* %1)
%24 = tail call i32 @sleep(i32 5)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.17, i64 0, i64 0))
%26 = tail call i32 @set_line(i32 %0, i8* %1, i32 192)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.18, i64 0, i64 0))
ret void
}