#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 /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetupHorizontalScroll(char a, char b, char c, char e) {
  unsigned char d[] = {0x26, a & 0x07, b & 0x07, c & 0x03, e & 0x07};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetupHorizontalScroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movb   $0x26,-0x9(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x7(%rbp)
movsbl -0x3(%rbp),%eax
and    $0x3,%eax
mov    %al,-0x6(%rbp)
movsbl -0x4(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x5,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetupHorizontalScroll>:
push   %rax
movb   $0x26,0x3(%rsp)
and    $0x7,%dil
mov    %dil,0x4(%rsp)
and    $0x7,%sil
mov    %sil,0x5(%rsp)
and    $0x3,%dl
mov    %dl,0x6(%rsp)
and    $0x7,%cl
mov    %cl,0x7(%rsp)
lea    0x3(%rsp),%rdi
mov    $0x5,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetupHorizontalScroll(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [5 x i8]
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
store i8 38, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = and i32 %13, 7
%15 = trunc i32 %14 to i8
store i8 %15, i8* %11
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = and i32 %18, 7
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = getelementptr inbounds i8, i8* %16, i64 1
%22 = load i8, i8* %7
%23 = sext i8 %22 to i32
%24 = and i32 %23, 3
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
%26 = getelementptr inbounds i8, i8* %21, i64 1
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = and i32 %28, 7
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%32 = call i32 @oled_SendCommand(i8* %31, i32 5)
ret void
}

LLVM IR (-O2):
define void @SetupHorizontalScroll(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8 38, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%8 = and i8 %0, 7
store i8 %8, i8* %7
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
%10 = and i8 %1, 7
store i8 %10, i8* %9
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
%12 = and i8 %2, 3
store i8 %12, i8* %11
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
%14 = and i8 %3, 7
store i8 %14, i8* %13
%15 = call i32 @oled_SendCommand(i8* %6, i32 5)
ret void
}