#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 ARCOMMANDS_Version_CompareVersions(int, int, int, int, int, int, int, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *, int *, int *, int *);
int ARCOMMANDS_Version_CompareVersionCodes(const char *v1, const char *v2) {
  int v1M = 0, v1m = 0, v1r = 0, v1c = 0;
  int v2M = 0, v2m = 0, v2r = 0, v2c = 0;
  sscanf(v1, "%d.%d.%d.%d", &v1M, &v1m, &v1r, &v1c);
  sscanf(v2, "%d.%d.%d.%d", &v2M, &v2m, &v2r, &v2c);
  return ARCOMMANDS_Version_CompareVersions(v1M, v1m, v1r, v1c, v2M, v2m, v2r,
                                            v2c);
}


x86 assembly (clang, -O0):
<ARCOMMANDS_Version_CompareVersionCodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8d(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
call   1040 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe6d(%rip),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1040 <sscanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <ARCOMMANDS_Version_CompareVersions@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARCOMMANDS_Version_CompareVersionCodes>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe8f(%rip),%r14
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
mov    %r14,%rsi
call   1040 <sscanf@plt>
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sscanf@plt>
mov    0x24(%rsp),%edi
mov    0x20(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebx
push   %rbx
push   %rax
call   1030 <ARCOMMANDS_Version_CompareVersions@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i32 @ARCOMMANDS_Version_CompareVersionCodes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%13 = load i8*, i8** %3
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%15 = load i8*, i8** %4
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = load i32, i32* %11
%24 = load i32, i32* %12
%25 = call i32 @ARCOMMANDS_Version_CompareVersions(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
ret i32 %25
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i32 @ARCOMMANDS_Version_CompareVersionCodes(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%12 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%13 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%14 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%15 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%16 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%17 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%18 = bitcast i32* %10 to i8*
store i32 0, i32* %10
%19 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%20 = call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, i32* %9, i32* %10)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = call i32 @ARCOMMANDS_Version_CompareVersions(i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28)
ret i32 %29
}