#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 */
scalar_t__ atoi(char *const);
int numcmp_inv(const void *s1, const void *s2) {
  if (((atoi(*(char *const *)s1)) - (atoi(*(char *const *)s2))) < 0)
    return 1;
  else if (((atoi(*(char *const *)s1)) - (atoi(*(char *const *)s2))) > 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<numcmp_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
jge    115c <numcmp_inv+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <numcmp_inv+0x94>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
jle    1198 <numcmp_inv+0x88>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a4 <numcmp_inv+0x94>
jmp    119d <numcmp_inv+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp_inv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%rdi
call   1030 <atoi@plt>
mov    %rax,%rbx
mov    (%r14),%rdi
call   1030 <atoi@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setne  %cl
neg    %ecx
cmp    %rax,%rbx
mov    $0x1,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @numcmp_inv(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = call i64 @atoi(i8* %8)
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
%13 = call i64 @atoi(i8* %12)
%14 = sub nsw i64 %9, %13
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %31
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i8**
%20 = load i8*, i8** %19
%21 = call i64 @atoi(i8* %20)
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i8**
%24 = load i8*, i8** %23
%25 = call i64 @atoi(i8* %24)
%26 = sub nsw i64 %21, %25
%27 = icmp sgt i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %17
store i32 -1, i32* %3
br label %31
29: ; preds = %17
br label %30
30: ; preds = %29
store i32 0, i32* %3
br label %31
31: ; preds = %30, %28, %16
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @numcmp_inv(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = tail call i64 @atoi(i8* %7)
%9 = sub nsw i64 %5, %8
%10 = icmp slt i64 %9, 0
%11 = icmp ne i64 %9, 0
%12 = sext i1 %11 to i32
%13 = select i1 %10, i32 1, i32 %12
ret i32 %13
}