#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 sscanf(char *, char *, int *, int *, ...);
int is_later_lastz_version(char *s1, char *s2) {
  int major1, minor1, subminor1;
  int major2, minor2, subminor2;
  char extra;
  if (sscanf(s1, "%d.%d%c", &major1, &minor1, &extra) == 2)
    subminor1 = 0;
  else
    sscanf(s1, "%d.%d.%d", &major1, &minor1, &subminor1);
  if (sscanf(s2, "%d.%d%c", &major2, &minor2, &extra) == 2)
    subminor2 = 0;
  else
    sscanf(s2, "%d.%d.%d", &major2, &minor2, &subminor2);
  if (major1 > major2)
    return 1;
  else if (major1 < major2)
    return 0;
  if (minor1 > minor2)
    return 1;
  else if (minor1 < minor2)
    return 0;
  return (subminor1 > subminor2);
}


x86 assembly (clang, -O0):
<is_later_lastz_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x31(%rbp),%r8
mov    $0x0,%al
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    1153 <is_later_lastz_version+0x43>
movl   $0x0,-0x24(%rbp)
jmp    1171 <is_later_lastz_version+0x61>
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe84(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x31(%rbp),%r8
mov    $0x0,%al
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    11a4 <is_later_lastz_version+0x94>
movl   $0x0,-0x30(%rbp)
jmp    11c2 <is_later_lastz_version+0xb2>
mov    -0x18(%rbp),%rdi
lea    0xe59(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    11da <is_later_lastz_version+0xca>
movl   $0x1,-0x4(%rbp)
jmp    123d <is_later_lastz_version+0x12d>
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11f2 <is_later_lastz_version+0xe2>
movl   $0x0,-0x4(%rbp)
jmp    123d <is_later_lastz_version+0x12d>
jmp    11f7 <is_later_lastz_version+0xe7>
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    120f <is_later_lastz_version+0xff>
movl   $0x1,-0x4(%rbp)
jmp    123d <is_later_lastz_version+0x12d>
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1227 <is_later_lastz_version+0x117>
movl   $0x0,-0x4(%rbp)
jmp    123d <is_later_lastz_version+0x12d>
jmp    122c <is_later_lastz_version+0x11c>
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_later_lastz_version>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedc(%rip),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0xf(%rsp),%r8
xor    %eax,%eax
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    1149 <is_later_lastz_version+0x39>
movl   $0x0,0x1c(%rsp)
jmp    1169 <is_later_lastz_version+0x59>
lea    0xeb8(%rip),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sscanf@plt>
lea    0xe90(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0xf(%rsp),%r8
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    1198 <is_later_lastz_version+0x88>
movl   $0x0,0x10(%rsp)
jmp    11b8 <is_later_lastz_version+0xa8>
lea    0xe69(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0x24(%rsp),%ecx
mov    0x18(%rsp),%edx
mov    $0x1,%eax
cmp    %edx,%ecx
jg     11ef <is_later_lastz_version+0xdf>
cmp    %edx,%ecx
jge    11d1 <is_later_lastz_version+0xc1>
xor    %eax,%eax
jmp    11ef <is_later_lastz_version+0xdf>
mov    0x14(%rsp),%ecx
cmp    %ecx,0x20(%rsp)
jg     11ef <is_later_lastz_version+0xdf>
mov    $0x0,%eax
jl     11ef <is_later_lastz_version+0xdf>
mov    0x1c(%rsp),%ecx
xor    %eax,%eax
cmp    0x10(%rsp),%ecx
setg   %al
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d.%d%c\00"
@.str.1 = [9 x i8] c"%d.%d.%d\00"
define i32 @is_later_lastz_version(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
%13 = load i8*, i8** %4
%14 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i8* %12)
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 0, i32* %8
br label %20
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
br label %20
20: ; preds = %17, %16
%21 = load i8*, i8** %5
%22 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %10, i8* %12)
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %11
br label %28
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
br label %28
28: ; preds = %25, %24
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 1, i32* %3
br label %55
33: ; preds = %28
%34 = load i32, i32* %6
%35 = load i32, i32* %9
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 0, i32* %3
br label %55
38: ; preds = %33
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = load i32, i32* %10
%42 = icmp sgt i32 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %39
store i32 1, i32* %3
br label %55
44: ; preds = %39
%45 = load i32, i32* %7
%46 = load i32, i32* %10
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %49
48: ; preds = %44
store i32 0, i32* %3
br label %55
49: ; preds = %44
br label %50
50: ; preds = %49
%51 = load i32, i32* %8
%52 = load i32, i32* %11
%53 = icmp sgt i32 %51, %52
%54 = zext i1 %53 to i32
store i32 %54, i32* %3
br label %55
55: ; preds = %50, %48, %43, %37, %32
%56 = load i32, i32* %3
ret i32 %56
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d.%d%c\00"
@.str.1 = [9 x i8] c"%d.%d.%d\00"
define i32 @is_later_lastz_version(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 i8
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i8* %9)
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 0, i32* %5
br label %21
19: ; preds = %2
%20 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
br label %21
21: ; preds = %19, %18
%22 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i8* %9)
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 0, i32* %8
br label %27
25: ; preds = %21
%26 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
br label %27
27: ; preds = %25, %24
%28 = load i32, i32* %3
%29 = load i32, i32* %6
%30 = icmp sgt i32 %28, %29
br i1 %30, label %44, label %31
31: ; preds = %27
%32 = icmp slt i32 %28, %29
br i1 %32, label %44, label %33
33: ; preds = %31
%34 = load i32, i32* %4
%35 = load i32, i32* %7
%36 = icmp sgt i32 %34, %35
br i1 %36, label %44, label %37
37: ; preds = %33
%38 = icmp slt i32 %34, %35
br i1 %38, label %44, label %39
39: ; preds = %37
%40 = load i32, i32* %5
%41 = load i32, i32* %8
%42 = icmp sgt i32 %40, %41
%43 = zext i1 %42 to i32
br label %44
44: ; preds = %37, %33, %31, %27, %39
%45 = phi i32 [ %43, %39 ], [ 1, %27 ], [ 0, %31 ], [ 1, %33 ], [ 0, %37 ]
ret i32 %45
}