#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 ST7735_DrawInt(int, int, long, int, int /*<<< orphan*/, int);
int ST7735_DrawString(int /*<<< orphan*/, int, char *, int, int /*<<< orphan*/,
                      int);
int /*<<< orphan*/ ST7735_FillEnd(int, int, int, int /*<<< orphan*/, int);
void ST7735_MSG(int line, char *string, long value) {
  int position;
  if (line > 16)
    return;
  position = ST7735_DrawString(0, line * 8 * 1, string, 0xFFFF, 0, 1);
  position = ST7735_DrawInt(position, line * 8 * 1, value, 0xFFFF, 0, 1);
  ST7735_FillEnd(position, line * 8 * 1, 0xFFFF, 0, 1);
}


x86 assembly (clang, -O0):
<ST7735_MSG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x10,-0x4(%rbp)
jle    1152 <ST7735_MSG+0x22>
jmp    11bc <ST7735_MSG+0x8c>
mov    -0x4(%rbp),%esi
shl    $0x3,%esi
shl    $0x0,%esi
mov    -0x10(%rbp),%rdx
xor    %r8d,%r8d
mov    $0xffff,%ecx
mov    $0x1,%r9d
mov    %r8d,%edi
call   1040 <ST7735_DrawString@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
shl    $0x3,%esi
shl    $0x0,%esi
mov    -0x18(%rbp),%rdx
mov    $0xffff,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <ST7735_DrawInt@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
shl    $0x3,%esi
shl    $0x0,%esi
mov    $0xffff,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1050 <ST7735_FillEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST7735_MSG>:
cmp    $0x10,%edi
jle    1136 <ST7735_MSG+0x6>
ret
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %edi,%ebx
shl    $0x3,%ebx
xor    %edi,%edi
mov    %ebx,%esi
mov    $0xffff,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1040 <ST7735_DrawString@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    $0xffff,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <ST7735_DrawInt@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    $0xffff,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ST7735_FillEnd@plt>

LLVM IR (-O0):
define void @ST7735_MSG(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 16
br i1 %9, label %10, label %11
10: ; preds = %3
br label %28
11: ; preds = %3
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 8
%14 = mul nsw i32 %13, 1
%15 = load i8*, i8** %5
%16 = call i32 @ST7735_DrawString(i32 0, i32 %14, i8* %15, i32 65535, i32 0, i32 1)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %4
%19 = mul nsw i32 %18, 8
%20 = mul nsw i32 %19, 1
%21 = load i64, i64* %6
%22 = call i32 @ST7735_DrawInt(i32 %17, i32 %20, i64 %21, i32 65535, i32 0, i32 1)
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %4
%25 = mul nsw i32 %24, 8
%26 = mul nsw i32 %25, 1
%27 = call i32 @ST7735_FillEnd(i32 %23, i32 %26, i32 65535, i32 0, i32 1)
br label %28
28: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @ST7735_MSG(i32 %0, i8* %1, i64 %2) {
%4 = icmp sgt i32 %0, 16
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = shl nsw i32 %0, 3
%7 = tail call i32 @ST7735_DrawString(i32 0, i32 %6, i8* %1, i32 65535, i32 0, i32 1)
%8 = tail call i32 @ST7735_DrawInt(i32 %7, i32 %6, i64 %2, i32 65535, i32 0, i32 1)
%9 = tail call i32 @ST7735_FillEnd(i32 %8, i32 %6, i32 65535, i32 0, i32 1)
br label %10
10: ; preds = %3, %5
ret void
}