#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 */
long get_num(char *, char *);
char *macnumcmp(char *arg) {
  long int num;
  num = get_num("numcmp", arg) - get_num("numcmp", arg);
  arg[1] = '\0';
  if (num < 0)
    *arg = '>';
  else if (num > 0)
    *arg = '<';
  else
    *arg = '=';
  return (arg);
}


x86 assembly (clang, -O0):
<macnumcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
cmpq   $0x0,-0x10(%rbp)
jge    116d <macnumcmp+0x5d>
mov    -0x8(%rbp),%rax
movb   $0x3e,(%rax)
jmp    1190 <macnumcmp+0x80>
cmpq   $0x0,-0x10(%rbp)
jle    1184 <macnumcmp+0x74>
mov    -0x8(%rbp),%rax
movb   $0x3c,(%rax)
jmp    118b <macnumcmp+0x7b>
mov    -0x8(%rbp),%rax
movb   $0x3d,(%rax)
jmp    1190 <macnumcmp+0x80>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macnumcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
cmp    %rax,%r15
sete   %cl
or     $0x3c,%cl
cmp    %rax,%r15
movb   $0x0,0x1(%rbx)
movzbl %cl,%eax
mov    $0x3e,%ecx
cmovns %eax,%ecx
mov    %cl,(%rbx)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"numcmp\00"
define i8* @macnumcmp(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @get_num(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @get_num(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = sub nsw i64 %5, %7
store i64 %8, i64* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = load i64, i64* %3
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i8*, i8** %2
store i8 62, i8* %14
br label %23
15: ; preds = %1
%16 = load i64, i64* %3
%17 = icmp sgt i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load i8*, i8** %2
store i8 60, i8* %19
br label %22
20: ; preds = %15
%21 = load i8*, i8** %2
store i8 61, i8* %21
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22, %13
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
@.str = [7 x i8] c"numcmp\00"
define i8* @macnumcmp(i8* returned %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = sub nsw i64 %2, %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %5
%6 = icmp slt i64 %4, 0
%7 = icmp eq i64 %4, 0
%8 = select i1 %7, i8 61, i8 60
%9 = select i1 %6, i8 62, i8 %8
store i8 %9, i8* %0
ret i8* %0
}