#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ OLED_MsDelay(int);
int /*<<< orphan*/ SendCMD(int);
int /*<<< orphan*/ SendData(int);
void ColorSet(uint32_t ptr1) {
  uint8_t i, j;
  SendCMD(0x15);
  SendCMD(0x00);
  SendCMD(0x7f);
  SendCMD(0x75);
  SendCMD(0x00);
  SendCMD(0x7f);
  SendCMD(0x5c);
  for (j = 0; j < 256; j++) {
    SendData(0xff);
  }
  for (i = 0; i < 126; i++) {
    SendData(0xffff);
    for (j = 0; j < 126; j++) {
      SendData(ptr1);
    }
    SendData(0xffff);
  }
  for (j = 0; j < 128; j++) {
    SendData(0xffff);
  }
  OLED_MsDelay(700);
}


x86 assembly (clang, -O0):
<ColorSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x15,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1030 <SendCMD@plt>
mov    $0x7f,%edi
call   1030 <SendCMD@plt>
mov    $0x75,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1030 <SendCMD@plt>
mov    $0x7f,%edi
call   1030 <SendCMD@plt>
mov    $0x5c,%edi
call   1030 <SendCMD@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    11a7 <ColorSet+0x77>
mov    $0xff,%edi
call   1050 <SendData@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <ColorSet+0x52>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jge    1201 <ColorSet+0xd1>
mov    $0xffff,%edi
call   1050 <SendData@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7e,-0xc(%rbp)
jge    11e9 <ColorSet+0xb9>
mov    -0x4(%rbp),%edi
call   1050 <SendData@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c9 <ColorSet+0x99>
mov    $0xffff,%edi
call   1050 <SendData@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ae <ColorSet+0x7e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    122d <ColorSet+0xfd>
mov    $0xffff,%edi
call   1050 <SendData@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1208 <ColorSet+0xd8>
mov    $0x2bc,%edi
call   1040 <OLED_MsDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ColorSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x15,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1030 <SendCMD@plt>
mov    $0x7f,%edi
call   1030 <SendCMD@plt>
mov    $0x75,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1030 <SendCMD@plt>
mov    $0x7f,%edi
call   1030 <SendCMD@plt>
mov    $0x5c,%edi
call   1030 <SendCMD@plt>
mov    $0x100,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0xff,%edi
call   1050 <SendData@plt>
add    $0xffffffff,%ebp
jne    1180 <ColorSet+0x50>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xffff,%edi
call   1050 <SendData@plt>
mov    $0x7e,%ebp
nop
mov    %ebx,%edi
call   1050 <SendData@plt>
add    $0xffffffff,%ebp
jne    11b0 <ColorSet+0x80>
mov    $0xffff,%edi
call   1050 <SendData@plt>
add    $0x1,%r14d
cmp    $0x7e,%r14d
jne    11a0 <ColorSet+0x70>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xffff,%edi
call   1050 <SendData@plt>
add    $0xffffffff,%ebx
jne    11e0 <ColorSet+0xb0>
mov    $0x2bc,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <OLED_MsDelay@plt>

LLVM IR (-O0):
define void @ColorSet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @SendCMD(i32 21)
%6 = call i32 @SendCMD(i32 0)
%7 = call i32 @SendCMD(i32 127)
%8 = call i32 @SendCMD(i32 117)
%9 = call i32 @SendCMD(i32 0)
%10 = call i32 @SendCMD(i32 127)
%11 = call i32 @SendCMD(i32 92)
store i32 0, i32* %4
br label %12
12: ; preds = %17, %1
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 256
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = call i32 @SendData(i32 255)
br label %17
17: ; preds = %15
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %12
20: ; preds = %12
store i32 0, i32* %3
br label %21
21: ; preds = %37, %20
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 126
br i1 %23, label %24, label %40
24: ; preds = %21
%25 = call i32 @SendData(i32 65535)
store i32 0, i32* %4
br label %26
26: ; preds = %32, %24
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 126
br i1 %28, label %29, label %35
29: ; preds = %26
%30 = load i32, i32* %2
%31 = call i32 @SendData(i32 %30)
br label %32
32: ; preds = %29
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %26
35: ; preds = %26
%36 = call i32 @SendData(i32 65535)
br label %37
37: ; preds = %35
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %21
40: ; preds = %21
store i32 0, i32* %4
br label %41
41: ; preds = %46, %40
%42 = load i32, i32* %4
%43 = icmp slt i32 %42, 128
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = call i32 @SendData(i32 65535)
br label %46
46: ; preds = %44
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %41
49: ; preds = %41
%50 = call i32 @OLED_MsDelay(i32 700)
ret void
}

LLVM IR (-O2):
define void @ColorSet(i32 %0) {
%2 = tail call i32 @SendCMD(i32 21)
%3 = tail call i32 @SendCMD(i32 0)
%4 = tail call i32 @SendCMD(i32 127)
%5 = tail call i32 @SendCMD(i32 117)
%6 = tail call i32 @SendCMD(i32 0)
%7 = tail call i32 @SendCMD(i32 127)
%8 = tail call i32 @SendCMD(i32 92)
br label %9
9: ; preds = %1, %9
%10 = phi i32 [ 0, %1 ], [ %12, %9 ]
%11 = tail call i32 @SendData(i32 255)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 256
br i1 %13, label %14, label %9
14: ; preds = %9, %22
%15 = phi i32 [ %24, %22 ], [ 0, %9 ]
%16 = tail call i32 @SendData(i32 65535)
br label %17
17: ; preds = %14, %17
%18 = phi i32 [ 0, %14 ], [ %20, %17 ]
%19 = tail call i32 @SendData(i32 %0)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, 126
br i1 %21, label %22, label %17
22: ; preds = %17
%23 = tail call i32 @SendData(i32 65535)
%24 = add nuw nsw i32 %15, 1
%25 = icmp eq i32 %24, 126
br i1 %25, label %26, label %14
26: ; preds = %22, %26
%27 = phi i32 [ %29, %26 ], [ 0, %22 ]
%28 = tail call i32 @SendData(i32 65535)
%29 = add nuw nsw i32 %27, 1
%30 = icmp eq i32 %29, 128
br i1 %30, label %31, label %26
31: ; preds = %26
%32 = tail call i32 @OLED_MsDelay(i32 700)
ret void
}