#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 */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ OSD9616_multiSend(int *, int);
int /*<<< orphan*/ OSD9616_send(int, int);
int /*<<< orphan*/ printMessage(char *);
int oled_display_message(char *topline, char *bottomline) {
  uint16_t cmd[10];
  OSD9616_send(0x00, 0x2E);
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0x10);
  OSD9616_send(0x00, 0xb0 + 0);
  printMessage(&topline[0]);
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0x10);
  OSD9616_send(0x00, 0xb0 + 1);
  printMessage(&bottomline[0]);
  cmd[0] = 0x00;
  cmd[1] = 0x29;
  cmd[2] = 0x00;
  cmd[3] = 0x00;
  cmd[4] = 0x03;
  cmd[5] = 0x01;
  cmd[6] = 0x01;
  OSD9616_multiSend(cmd, 7);
  OSD9616_send(0x00, 0x2E);
  cmd[0] = 0x00;
  cmd[1] = 0xa3;
  cmd[2] = 0x08;
  cmd[3] = 0x08;
  OSD9616_multiSend(cmd, 4);
  return 0;
}


x86 assembly (clang, -O0):
<oled_display_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x2e,%esi
call   1050 <OSD9616_send@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb0,%esi
call   1050 <OSD9616_send@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printMessage@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb1,%esi
call   1050 <OSD9616_send@plt>
mov    -0x10(%rbp),%rdi
call   1040 <printMessage@plt>
movl   $0x0,-0x40(%rbp)
movl   $0x29,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x3,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x7,%esi
call   1030 <OSD9616_multiSend@plt>
xor    %edi,%edi
mov    $0x2e,%esi
call   1050 <OSD9616_send@plt>
movl   $0x0,-0x40(%rbp)
movl   $0xa3,-0x3c(%rbp)
movl   $0x8,-0x38(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x4,%esi
call   1030 <OSD9616_multiSend@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_display_message>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x2e,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb0,%esi
call   1050 <OSD9616_send@plt>
mov    %rbx,%rdi
call   1040 <printMessage@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1050 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb1,%esi
call   1050 <OSD9616_send@plt>
mov    %r14,%rdi
call   1040 <printMessage@plt>
movaps 0xe5e(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x100000003,%rax
mov    %rax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <OSD9616_multiSend@plt>
xor    %edi,%edi
mov    $0x2e,%esi
call   1050 <OSD9616_send@plt>
movaps 0xe30(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <OSD9616_multiSend@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @oled_display_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [10 x i32]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 @OSD9616_send(i32 0, i32 46)
%7 = call i32 @OSD9616_send(i32 0, i32 0)
%8 = call i32 @OSD9616_send(i32 0, i32 16)
%9 = call i32 @OSD9616_send(i32 0, i32 176)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = call i32 @printMessage(i8* %11)
%13 = call i32 @OSD9616_send(i32 0, i32 0)
%14 = call i32 @OSD9616_send(i32 0, i32 16)
%15 = call i32 @OSD9616_send(i32 0, i32 177)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = call i32 @printMessage(i8* %17)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32 0, i32* %19
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 1
store i32 41, i32* %20
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 2
store i32 0, i32* %21
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 3
store i32 0, i32* %22
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 4
store i32 3, i32* %23
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 5
store i32 1, i32* %24
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 6
store i32 1, i32* %25
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%27 = call i32 @OSD9616_multiSend(i32* %26, i32 7)
%28 = call i32 @OSD9616_send(i32 0, i32 46)
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32 0, i32* %29
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 1
store i32 163, i32* %30
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 2
store i32 8, i32* %31
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 3
store i32 8, i32* %32
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%34 = call i32 @OSD9616_multiSend(i32* %33, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @oled_display_message(i8* %0, i8* %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = tail call i32 @OSD9616_send(i32 0, i32 46)
%6 = tail call i32 @OSD9616_send(i32 0, i32 0)
%7 = tail call i32 @OSD9616_send(i32 0, i32 16)
%8 = tail call i32 @OSD9616_send(i32 0, i32 176)
%9 = tail call i32 @printMessage(i8* %0)
%10 = tail call i32 @OSD9616_send(i32 0, i32 0)
%11 = tail call i32 @OSD9616_send(i32 0, i32 16)
%12 = tail call i32 @OSD9616_send(i32 0, i32 177)
%13 = tail call i32 @printMessage(i8* %1)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%15 = bitcast [10 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 41, i32 0, i32 0>, <4 x i32>* %15
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
store i32 3, i32* %16
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
store i32 1, i32* %17
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
store i32 1, i32* %18
%19 = call i32 @OSD9616_multiSend(i32* %14, i32 7)
%20 = call i32 @OSD9616_send(i32 0, i32 46)
%21 = bitcast [10 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 163, i32 8, i32 8>, <4 x i32>* %21
%22 = call i32 @OSD9616_multiSend(i32* %14, i32 4)
ret i32 0
}