#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 */
char *convertIntToRomanNumeralString(int);
scalar_t__ goodInput(char *, char *, int *, int *);
int /*<<< orphan*/ showNonValidSubtractionResultMessage();
char *sub(char *a, char *b) {
  int termA, termB;
  if (goodInput(a, b, &termA, &termB)) {
    int diff = termA - termB;
    if (diff > 0)
      return convertIntToRomanNumeralString(diff);
  }
  showNonValidSubtractionResultMessage();
  return NULL;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <goodInput@plt>
cmp    $0x0,%rax
je     1188 <sub+0x58>
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1183 <sub+0x53>
mov    -0x24(%rbp),%edi
call   1030 <convertIntToRomanNumeralString@plt>
mov    %rax,-0x8(%rbp)
jmp    1197 <sub+0x67>
jmp    1188 <sub+0x58>
mov    $0x0,%al
call   1040 <showNonValidSubtractionResultMessage@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <goodInput@plt>
test   %rax,%rax
je     115d <sub+0x2d>
mov    0xc(%rsp),%edi
sub    0x8(%rsp),%edi
jle    115d <sub+0x2d>
call   1030 <convertIntToRomanNumeralString@plt>
mov    %rax,%rbx
jmp    1166 <sub+0x36>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <showNonValidSubtractionResultMessage@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sub(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i64 @goodInput(i8* %9, i8* %10, i32* %6, i32* %7)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %8
%21 = call i8* @convertIntToRomanNumeralString(i32 %20)
store i8* %21, i8** %3
br label %25
22: ; preds = %13
br label %23
23: ; preds = %22, %2
%24 = call i32 (...) @showNonValidSubtractionResultMessage()
store i8* null, i8** %3
br label %25
25: ; preds = %23, %19
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @sub(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i64 @goodInput(i8* %0, i8* %1, i32* %3, i32* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i8* @convertIntToRomanNumeralString(i32 %12)
br label %18
16: ; preds = %9, %2
%17 = call i32 (...) @showNonValidSubtractionResultMessage()
br label %18
18: ; preds = %14, %16
%19 = phi i8* [ null, %16 ], [ %15, %14 ]
ret i8* %19
}