#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 drawString(char const *, int, int, int);
int /*<<< orphan*/ initScreens();
int /*<<< orphan*/ mcuShutDown();
int /*<<< orphan*/ waitInput();
void error(const char *message) {
  initScreens();
  drawString("An error has occurred:", 10, 10, 0x0000FF);
  int posY = drawString(message, 10, 30, 0xFFFFFF);
  drawString("Press any button to shutdown", 10, posY + 2 * 10, 0xFFFFFF);
  waitInput();
  mcuShutDown();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <initScreens@plt>
lea    0xea6(%rip),%rdi
mov    $0xa,%edx
mov    $0xff,%ecx
mov    %edx,%esi
call   1050 <drawString@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1e,%edx
mov    $0xffffff,%ecx
call   1050 <drawString@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
add    $0x14,%edx
lea    0xe84(%rip),%rdi
mov    $0xa,%esi
mov    $0xffffff,%ecx
call   1050 <drawString@plt>
mov    $0x0,%al
call   1040 <waitInput@plt>
mov    $0x0,%al
call   1060 <mcuShutDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <initScreens@plt>
lea    0xeae(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xff,%ecx
call   1050 <drawString@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1e,%edx
mov    $0xffffff,%ecx
call   1050 <drawString@plt>
lea    0x14(%rax),%edx
lea    0xe90(%rip),%rdi
mov    $0xa,%esi
mov    $0xffffff,%ecx
call   1050 <drawString@plt>
xor    %eax,%eax
call   1040 <waitInput@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <mcuShutDown@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"An error has occurred:\00"
@.str.1 = [29 x i8] c"Press any button to shutdown\00"
define void @error(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @initScreens()
%5 = call i32 @drawString(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 255)
%6 = load i8*, i8** %2
%7 = call i32 @drawString(i8* %6, i32 10, i32 30, i32 16777215)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 20
%10 = call i32 @drawString(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %9, i32 16777215)
%11 = call i32 (...) @waitInput()
%12 = call i32 (...) @mcuShutDown()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"An error has occurred:\00"
@.str.1 = [29 x i8] c"Press any button to shutdown\00"
define void @error(i8* %0) {
%2 = tail call i32 (...) @initScreens()
%3 = tail call i32 @drawString(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 255)
%4 = tail call i32 @drawString(i8* %0, i32 10, i32 30, i32 16777215)
%5 = add nsw i32 %4, 20
%6 = tail call i32 @drawString(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %5, i32 16777215)
%7 = tail call i32 (...) @waitInput()
%8 = tail call i32 (...) @mcuShutDown()
ret void
}