#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*/ printf(char *, ...);
void usage(char *argv) {
  printf("\nRoman v%s.  Copyright (c) 1998 Simon Kittle\n", "2.0");
  printf("Copying policy: GNU GPL v2.0 or later.  Compiled at "
         "08:11:27"
         " on "
         "Mar 17 2022"
         "\n\n");
  printf("Usage: %s <roman number>              (to be converted to decimal "
         "number)\n",
         argv);
  printf("       %s [-a] [-s] <decimal number>  (to be converted to roman "
         "number)\n",
         argv);
  printf("\nOption -a stands for additive mode,  e.g. 4 = IIII, 9 = VIIII\n");
  printf("Option -s stands for subtractive mode, e.g. 4 = IV, 9 = IX\n");
  printf("\nOnly positive integers are allowed.\n");
  printf("Roman takes any number of arguments in any order.\n");
  printf("\nEncoding of roman symbols:\n\n");
  printf("I = 1      \\\nV = 5       |\nX = 10      |\nL = 50      |-- normal "
         "symbols\nC = 100     |\nD = 500     |\nM = 1000   /\nV^ = 5000      "
         "(should be V^bar)\nX^ = 10000     (should be X^bar) \nL^ = 50000     "
         "(should be L^bar)\nC^ = 100000    (should be C^bar)\nD^ = 500000    "
         "(should be D^bar)\nM^ = 1000000   (should be M^bar)\nV^^ = 5000000  "
         "(should be V^bar^bar)\netc...\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xf04(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfdc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1022(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1047(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1057(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xefc(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf86(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf20(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfa5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd8(%rip),%rdi
call   1030 <puts@plt>
lea    0x1007(%rip),%rdi
call   1030 <puts@plt>
lea    0x1020(%rip),%rdi
call   1030 <puts@plt>
lea    0x1046(%rip),%rdi
call   1030 <puts@plt>
lea    0x1057(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0ARoman v%s. Copyright (c) 1998 Simon Kittle\0A\00"
@.str.1 = [4 x i8] c"2.0\00"
@.str.2 = [78 x i8] c"Copying policy: GNU GPL v2.0 or later. Compiled at 08:11:27 on Mar 17 2022\0A\0A\00"
@.str.3 = [75 x i8] c"Usage: %s <roman number> (to be converted to decimal number)\0A\00"
@.str.4 = [73 x i8] c" %s [-a] [-s] <decimal number> (to be converted to roman number)\0A\00"
@.str.5 = [64 x i8] c"\0AOption -a stands for additive mode, e.g. 4 = IIII, 9 = VIIII\0A\00"
@.str.6 = [60 x i8] c"Option -s stands for subtractive mode, e.g. 4 = IV, 9 = IX\0A\00"
@.str.7 = [38 x i8] c"\0AOnly positive integers are allowed.\0A\00"
@.str.8 = [51 x i8] c"Roman takes any number of arguments in any order.\0A\00"
@.str.9 = [30 x i8] c"\0AEncoding of roman symbols:\0A\0A\00"
@.str.10 = [358 x i8] c"I = 1 \\\0AV = 5 |\0AX = 10 |\0AL = 50 |-- normal symbols\0AC = 100 |\0AD = 500 |\0AM = 1000 /\0AV^ = 5000 (should be V^bar)\0AX^ = 10000 (should be X^bar) \0AL^ = 50000 (should be L^bar)\0AC^ = 100000 (should be C^bar)\0AD^ = 500000 (should be D^bar)\0AM^ = 1000000 (should be M^bar)\0AV^^ = 5000000 (should be V^bar^bar)\0Aetc...\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0ARoman v%s. Copyright (c) 1998 Simon Kittle\0A\00"
@.str.1 = [4 x i8] c"2.0\00"
@.str.3 = [75 x i8] c"Usage: %s <roman number> (to be converted to decimal number)\0A\00"
@.str.4 = [73 x i8] c" %s [-a] [-s] <decimal number> (to be converted to roman number)\0A\00"
@str = [77 x i8] c"Copying policy: GNU GPL v2.0 or later. Compiled at 08:11:27 on Mar 17 2022\0A\00"
@str.11 = [63 x i8] c"\0AOption -a stands for additive mode, e.g. 4 = IIII, 9 = VIIII\00"
@str.12 = [59 x i8] c"Option -s stands for subtractive mode, e.g. 4 = IV, 9 = IX\00"
@str.13 = [37 x i8] c"\0AOnly positive integers are allowed.\00"
@str.14 = [50 x i8] c"Roman takes any number of arguments in any order.\00"
@str.15 = [29 x i8] c"\0AEncoding of roman symbols:\0A\00"
@str.16 = [357 x i8] c"I = 1 \\\0AV = 5 |\0AX = 10 |\0AL = 50 |-- normal symbols\0AC = 100 |\0AD = 500 |\0AM = 1000 /\0AV^ = 5000 (should be V^bar)\0AX^ = 10000 (should be X^bar) \0AL^ = 50000 (should be L^bar)\0AC^ = 100000 (should be C^bar)\0AD^ = 500000 (should be D^bar)\0AM^ = 1000000 (should be M^bar)\0AV^^ = 5000000 (should be V^bar^bar)\0Aetc...\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.11, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.15, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([357 x i8], [357 x i8]* @str.16, i64 0, i64 0))
ret void
}