#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 /*<<< orphan*/ strncpy(char *, char const *, size_t);
extern void generateHelpMessage(char *helpMessage,
                                const size_t helpMessageSizeInBytes) {
  size_t maxLength = 0;
  const char message[] =
      "                                                            \n"
      "============================================================\n"
      "                                                            \n"
      "                Roman Numeral Calculator                    \n"
      "                                                            \n"
      "           $>romancalc  MMCCDLX    +    XXVII               \n"
      "                       |_______|   ^   |_____|              \n"
      "                          |        |      |                 \n"
      "             numeral ------        |      |                 \n"
      "                operand [+/-]-------      |                 \n"
      "                   numeral ----------------                 \n"
      "                                                            \n"
      "============================================================\n"
      "                                                            \n";
  if ((helpMessage != NULL) && (helpMessageSizeInBytes >= (1))) {
    maxLength = helpMessageSizeInBytes - sizeof(char);
    strncpy(helpMessage, message, maxLength);
    helpMessage[maxLength] = '\0';
  }
}


x86 assembly (clang, -O0):
<generateHelpMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x370(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x357,%edx
call   1040 <memcpy@plt>
cmpq   $0x0,-0x8(%rbp)
je     1195 <generateHelpMessage+0x75>
cmpq   $0x1,-0x10(%rbp)
jb     1195 <generateHelpMessage+0x75>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x370(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateHelpMessage>:
push   %r14
push   %rbx
sub    $0x358,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec9(%rip),%rsi
mov    %rsp,%rdi
mov    $0x357,%edx
call   1040 <memcpy@plt>
test   %rbx,%rbx
je     1163 <generateHelpMessage+0x43>
test   %r14,%r14
je     1163 <generateHelpMessage+0x43>
lea    -0x1(%r14),%rdx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x358,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.generateHelpMessage.message = [855 x i8] c" \0A============================================================\0A \0A Roman Numeral Calculator \0A \0A $>romancalc MMCCDLX + XXVII \0A |_______| ^ |_____| \0A | | | \0A numeral ------ | | \0A operand [+/-]------- | \0A numeral ---------------- \0A \0A============================================================\0A \0A\00"
define void @generateHelpMessage(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca [855 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
%7 = bitcast [855 x i8]* %6 to i8*
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp uge i64 %11, 1
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i64, i64* %4
%15 = sub i64 %14, 1
store i64 %15, i64* %5
%16 = load i8*, i8** %3
%17 = getelementptr inbounds [855 x i8], [855 x i8]* %6, i64 0, i64 0
%18 = load i64, i64* %5
%19 = call i32 @strncpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %3
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %13, %10, %2
ret void
}

LLVM IR (-O2):
@__const.generateHelpMessage.message = [855 x i8] c" \0A============================================================\0A \0A Roman Numeral Calculator \0A \0A $>romancalc MMCCDLX + XXVII \0A |_______| ^ |_____| \0A | | | \0A numeral ------ | | \0A operand [+/-]------- | \0A numeral ---------------- \0A \0A============================================================\0A \0A\00"
define void @generateHelpMessage(i8* %0, i64 %1) {
%3 = alloca [855 x i8]
%4 = getelementptr inbounds [855 x i8], [855 x i8]* %3, i64 0, i64 0
%5 = icmp ne i8* %0, null
%6 = icmp ne i64 %1, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = add i64 %1, -1
%10 = call i32 @strncpy(i8* %0, i8* %4, i64 %9)
%11 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %11
br label %12
12: ; preds = %8, %2
ret void
}