#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 *cloneString(char const *);
int cmpStringsWithEmbeddedNumbers(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ freeMem(char *);
int /*<<< orphan*/ strUpper(char *);
int cmpWordsWithEmbeddedNumbers(const char *a, const char *b) {
  char *A = cloneString(a);
  char *B = cloneString(b);
  int diff = cmpStringsWithEmbeddedNumbers(strUpper(A), strUpper(B));
  freeMem(A);
  freeMem(B);
  return diff;
}


x86 assembly (clang, -O0):
<cmpWordsWithEmbeddedNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cloneString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cloneString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strUpper@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strUpper@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1050 <cmpStringsWithEmbeddedNumbers@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <freeMem@plt>
mov    -0x20(%rbp),%rdi
call   1030 <freeMem@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpWordsWithEmbeddedNumbers>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <cloneString@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <cloneString@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1060 <strUpper@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <strUpper@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <cmpStringsWithEmbeddedNumbers@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <freeMem@plt>
mov    %rbx,%rdi
call   1030 <freeMem@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cmpWordsWithEmbeddedNumbers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @cloneString(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @cloneString(i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = call i32 @strUpper(i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @strUpper(i8* %14)
%16 = call i32 @cmpStringsWithEmbeddedNumbers(i32 %13, i32 %15)
store i32 %16, i32* %7
%17 = load i8*, i8** %5
%18 = call i32 @freeMem(i8* %17)
%19 = load i8*, i8** %6
%20 = call i32 @freeMem(i8* %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmpWordsWithEmbeddedNumbers(i8* %0, i8* %1) {
%3 = tail call i8* @cloneString(i8* %0)
%4 = tail call i8* @cloneString(i8* %1)
%5 = tail call i32 @strUpper(i8* %3)
%6 = tail call i32 @strUpper(i8* %4)
%7 = tail call i32 @cmpStringsWithEmbeddedNumbers(i32 %5, i32 %6)
%8 = tail call i32 @freeMem(i8* %3)
%9 = tail call i32 @freeMem(i8* %4)
ret i32 %7
}