#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 *, int /*<<< orphan*/);
int /*<<< orphan*/ oledDrawStringRight(int, int, char const *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ oledInvert(int, int, int, int);
int oledStringWidth(char const *, int /*<<< orphan*/);
void layoutButtonYes(const char *btnYes) {
  oledDrawString(128 - fontCharWidth(0, '\x06') - 1, 64 - 8, "\x06", 0);
  oledDrawStringRight(128 - fontCharWidth(0, '\x06') - 3, 64 - 8, btnYes, 0);
  oledInvert(128 - oledStringWidth(btnYes, 0) - fontCharWidth(0, '\x06') - 4,
             64 - 9, 128 - 1, 64 - 1);
}


x86 assembly (clang, -O0):
<layoutButtonYes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
mov    $0x80,%edi
sub    %eax,%edi
sub    $0x1,%edi
mov    $0x38,%esi
lea    0xe82(%rip),%rdx
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
mov    $0x80,%edi
sub    %eax,%edi
sub    $0x3,%edi
mov    -0x8(%rbp),%rdx
mov    $0x38,%esi
xor    %ecx,%ecx
call   1070 <oledDrawStringRight@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <oledStringWidth@plt>
mov    %eax,%ecx
mov    $0x80,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
mov    -0xc(%rbp),%edi
sub    %eax,%edi
sub    $0x4,%edi
mov    $0x37,%esi
mov    $0x7f,%edx
mov    $0x3f,%ecx
call   1060 <oledInvert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layoutButtonYes>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
mov    $0x7f,%edi
sub    %eax,%edi
lea    0xe92(%rip),%rdx
mov    $0x38,%esi
xor    %ecx,%ecx
call   1030 <oledDrawString@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
mov    $0x7d,%edi
sub    %eax,%edi
mov    $0x38,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1070 <oledDrawStringRight@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <oledStringWidth@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <fontCharWidth@plt>
add    %ebx,%eax
mov    $0x7c,%edi
sub    %eax,%edi
mov    $0x37,%esi
mov    $0x7f,%edx
mov    $0x3f,%ecx
pop    %rbx
jmp    1060 <oledInvert@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\06\00"
define void @layoutButtonYes(i8* %0) {
%2 = tail call i32 @fontCharWidth(i32 0, i8 signext 6)
%3 = sub i32 127, %2
%4 = tail call i32 @oledDrawString(i32 %3, i32 56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 @fontCharWidth(i32 0, i8 signext 6)
%6 = sub i32 125, %5
%7 = tail call i32 @oledDrawStringRight(i32 %6, i32 56, i8* %0, i32 0)
%8 = tail call i32 @oledStringWidth(i8* %0, i32 0)
%9 = tail call i32 @fontCharWidth(i32 0, i8 signext 6)
%10 = add i32 %8, %9
%11 = sub i32 124, %10
%12 = tail call i32 @oledInvert(i32 %11, i32 55, i32 127, i32 63)
ret void
}