#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 fontCharWidth(int /*<<< orphan*/, char);
int /*<<< orphan*/ oledDrawString(int, int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ oledInvert(int /*<<< orphan*/, int, scalar_t__, int);
scalar_t__ oledStringWidth(char const *, int /*<<< orphan*/);
void layoutButtonNo(const char *btnNo) {
  oledDrawString(1, 64 - 8, "\x15", 0);
  oledDrawString(fontCharWidth(0, '\x15') + 3, 64 - 8, btnNo, 0);
  oledInvert(0, 64 - 9,
             fontCharWidth(0, '\x15') + oledStringWidth(btnNo, 0) + 2, 64 - 1);
}


x86 assembly (clang, -O0):
<layoutButtonNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x38,%esi
lea    0xea3(%rip),%rdx
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x15,%esi
call   1040 <fontCharWidth@plt>
mov    %eax,%edi
add    $0x3,%edi
mov    -0x8(%rbp),%rdx
mov    $0x38,%esi
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x15,%esi
call   1040 <fontCharWidth@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <oledStringWidth@plt>
mov    -0x10(%rbp),%rdx
add    %rax,%rdx
add    $0x2,%rdx
xor    %edi,%edi
mov    $0x37,%esi
mov    $0x3f,%ecx
call   1060 <oledInvert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layoutButtonNo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdx
mov    $0x1,%edi
mov    $0x38,%esi
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x15,%esi
call   1040 <fontCharWidth@plt>
lea    0x3(%rax),%edi
mov    $0x38,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x15,%esi
call   1040 <fontCharWidth@plt>
movslq %eax,%rbx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <oledStringWidth@plt>
lea    (%rbx,%rax,1),%rdx
add    $0x2,%rdx
xor    %edi,%edi
mov    $0x37,%esi
mov    $0x3f,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <oledInvert@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\15\00"
define void @layoutButtonNo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @oledDrawString(i32 1, i32 56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 @fontCharWidth(i32 0, i8 signext 21)
%5 = add nsw i32 %4, 3
%6 = load i8*, i8** %2
%7 = call i32 @oledDrawString(i32 %5, i32 56, i8* %6, i32 0)
%8 = call i32 @fontCharWidth(i32 0, i8 signext 21)
%9 = sext i32 %8 to i64
%10 = load i8*, i8** %2
%11 = call i64 @oledStringWidth(i8* %10, i32 0)
%12 = add nsw i64 %9, %11
%13 = add nsw i64 %12, 2
%14 = call i32 @oledInvert(i32 0, i32 55, i64 %13, i32 63)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\15\00"
define void @layoutButtonNo(i8* %0) {
%2 = tail call i32 @oledDrawString(i32 1, i32 56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @fontCharWidth(i32 0, i8 signext 21)
%4 = add nsw i32 %3, 3
%5 = tail call i32 @oledDrawString(i32 %4, i32 56, i8* %0, i32 0)
%6 = tail call i32 @fontCharWidth(i32 0, i8 signext 21)
%7 = sext i32 %6 to i64
%8 = tail call i64 @oledStringWidth(i8* %0, i32 0)
%9 = add nsw i64 %7, 2
%10 = add i64 %9, %8
%11 = tail call i32 @oledInvert(i32 0, i32 55, i64 %10, i32 63)
ret void
}