#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 oled_display_picture(int *message) {
  uint16_t cmd[10];
  int i;
  uint16_t input;
  uint16_t pixels;
  OSD9616_send(0x00, 0x2E);
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0x10);
  OSD9616_send(0x00, 0xb0 + 0);
  for (i = 95; i >= 0; i--) {
    input = message[i];
    pixels = (input & 0xFF);
    OSD9616_send(0x40, pixels);
  }
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0x10);
  OSD9616_send(0x00, 0xb0 + 1);
  for (i = 95; i >= 0; i--) {
    input = message[i];
    pixels = (input >> 8);
    OSD9616_send(0x40, pixels);
  }
  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_picture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x2e,%esi
call   1040 <OSD9616_send@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb0,%esi
call   1040 <OSD9616_send@plt>
movl   $0x5f,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     119e <oled_display_picture+0x7e>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
mov    $0x40,%edi
call   1040 <OSD9616_send@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1160 <oled_display_picture+0x40>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb1,%esi
call   1040 <OSD9616_send@plt>
movl   $0x5f,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     1202 <oled_display_picture+0xe2>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
mov    $0x40,%edi
call   1040 <OSD9616_send@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    11c6 <oled_display_picture+0xa6>
movl   $0x0,-0x30(%rbp)
movl   $0x29,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x3,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1030 <OSD9616_multiSend@plt>
xor    %edi,%edi
mov    $0x2e,%esi
call   1040 <OSD9616_send@plt>
movl   $0x0,-0x30(%rbp)
movl   $0xa3,-0x2c(%rbp)
movl   $0x8,-0x28(%rbp)
movl   $0x8,-0x24(%rbp)
lea    -0x30(%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_picture>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
xor    %edi,%edi
mov    $0x2e,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb0,%esi
call   1040 <OSD9616_send@plt>
mov    $0x5f,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,4),%esi
mov    $0x40,%edi
call   1040 <OSD9616_send@plt>
add    $0xffffffffffffffff,%rbx
jb     1160 <oled_display_picture+0x40>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1040 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xb1,%esi
call   1040 <OSD9616_send@plt>
mov    $0x5f,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
sar    $0x8,%esi
mov    $0x40,%edi
call   1040 <OSD9616_send@plt>
add    $0xffffffffffffffff,%rbx
jb     11a0 <oled_display_picture+0x80>
movaps 0xe42(%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   1040 <OSD9616_send@plt>
movaps 0xe14(%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_picture(i32* %0) {
%2 = alloca i32*
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = call i32 @OSD9616_send(i32 0, i32 46)
%8 = call i32 @OSD9616_send(i32 0, i32 0)
%9 = call i32 @OSD9616_send(i32 0, i32 16)
%10 = call i32 @OSD9616_send(i32 0, i32 176)
store i32 95, i32* %4
br label %11
11: ; preds = %24, %1
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load i32*, i32** %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = and i32 %20, 255
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @OSD9616_send(i32 64, i32 %22)
br label %24
24: ; preds = %14
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %11
27: ; preds = %11
%28 = call i32 @OSD9616_send(i32 0, i32 0)
%29 = call i32 @OSD9616_send(i32 0, i32 16)
%30 = call i32 @OSD9616_send(i32 0, i32 177)
store i32 95, i32* %4
br label %31
31: ; preds = %44, %27
%32 = load i32, i32* %4
%33 = icmp sge i32 %32, 0
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = load i32*, i32** %2
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
%39 = load i32, i32* %38
store i32 %39, i32* %5
%40 = load i32, i32* %5
%41 = ashr i32 %40, 8
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = call i32 @OSD9616_send(i32 64, i32 %42)
br label %44
44: ; preds = %34
%45 = load i32, i32* %4
%46 = add nsw i32 %45, -1
store i32 %46, i32* %4
br label %31
47: ; preds = %31
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32 0, i32* %48
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
store i32 41, i32* %49
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
store i32 0, i32* %50
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
store i32 0, i32* %51
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
store i32 3, i32* %52
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
store i32 1, i32* %53
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
store i32 1, i32* %54
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%56 = call i32 @OSD9616_multiSend(i32* %55, i32 7)
%57 = call i32 @OSD9616_send(i32 0, i32 46)
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32 0, i32* %58
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
store i32 163, i32* %59
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
store i32 8, i32* %60
%61 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
store i32 8, i32* %61
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%63 = call i32 @OSD9616_multiSend(i32* %62, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @oled_display_picture(i32* nocapture %0) {
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %2 to i8*
%4 = tail call i32 @OSD9616_send(i32 0, i32 46)
%5 = tail call i32 @OSD9616_send(i32 0, i32 0)
%6 = tail call i32 @OSD9616_send(i32 0, i32 16)
%7 = tail call i32 @OSD9616_send(i32 0, i32 176)
br label %8
8: ; preds = %1, %8
%9 = phi i64 [ 95, %1 ], [ %14, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = and i32 %11, 255
%13 = tail call i32 @OSD9616_send(i32 64, i32 %12)
%14 = add nsw i64 %9, -1
%15 = icmp eq i64 %9, 0
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = tail call i32 @OSD9616_send(i32 0, i32 0)
%18 = tail call i32 @OSD9616_send(i32 0, i32 16)
%19 = tail call i32 @OSD9616_send(i32 0, i32 177)
br label %20
20: ; preds = %16, %20
%21 = phi i64 [ 95, %16 ], [ %26, %20 ]
%22 = getelementptr inbounds i32, i32* %0, i64 %21
%23 = load i32, i32* %22
%24 = ashr i32 %23, 8
%25 = tail call i32 @OSD9616_send(i32 64, i32 %24)
%26 = add nsw i64 %21, -1
%27 = icmp eq i64 %21, 0
br i1 %27, label %28, label %20
28: ; preds = %20
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%30 = bitcast [10 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 0, i32 41, i32 0, i32 0>, <4 x i32>* %30
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
store i32 3, i32* %31
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32 1, i32* %32
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 1, i32* %33
%34 = call i32 @OSD9616_multiSend(i32* %29, i32 7)
%35 = call i32 @OSD9616_send(i32 0, i32 46)
%36 = bitcast [10 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 0, i32 163, i32 8, i32 8>, <4 x i32>* %36
%37 = call i32 @OSD9616_multiSend(i32* %29, i32 4)
ret i32 0
}