#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 /*<<< orphan*/ sscanf(char const *, char *, unsigned int *, unsigned int *,
                          unsigned int *);
int old_module_version(const char *version) {
  unsigned int major, sub, minor;
  sscanf(version, "%u.%u.%u", &major, &sub, &minor);
  if (major > 2)
    return 0;
  if (major < 2)
    return 1;
  if (sub > 5)
    return 0;
  if (sub < 5)
    return 1;
  if (minor >= 48)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<old_module_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1030 <sscanf@plt>
cmpl   $0x2,-0x14(%rbp)
jbe    114e <old_module_version+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    11ad <old_module_version+0x9d>
cmpl   $0x2,-0x14(%rbp)
jae    1164 <old_module_version+0x54>
movl   $0x1,-0x4(%rbp)
jmp    11ad <old_module_version+0x9d>
cmpl   $0x5,-0x18(%rbp)
jbe    117a <old_module_version+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    11ad <old_module_version+0x9d>
cmpl   $0x5,-0x18(%rbp)
jae    1190 <old_module_version+0x80>
movl   $0x1,-0x4(%rbp)
jmp    11ad <old_module_version+0x9d>
cmpl   $0x30,-0x1c(%rbp)
jb     11a6 <old_module_version+0x96>
movl   $0x0,-0x4(%rbp)
jmp    11ad <old_module_version+0x9d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<old_module_version>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <sscanf@plt>
xor    %eax,%eax
cmpl   $0x2,0x14(%rsp)
jbe    113d <old_module_version+0x2d>
add    $0x18,%rsp
ret
jne    115c <old_module_version+0x4c>
cmpl   $0x5,0x10(%rsp)
ja     1138 <old_module_version+0x28>
mov    $0x1,%eax
jne    1138 <old_module_version+0x28>
xor    %eax,%eax
cmpl   $0x30,0xc(%rsp)
setb   %al
add    $0x18,%rsp
ret
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%u.%u.%u\00"
define i32 @old_module_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %4
%10 = icmp ugt i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %29
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %2
br label %29
16: ; preds = %12
%17 = load i32, i32* %5
%18 = icmp ugt i32 %17, 5
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %2
br label %29
20: ; preds = %16
%21 = load i32, i32* %5
%22 = icmp ult i32 %21, 5
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %29
24: ; preds = %20
%25 = load i32, i32* %6
%26 = icmp uge i32 %25, 48
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 0, i32* %2
br label %29
28: ; preds = %24
store i32 1, i32* %2
br label %29
29: ; preds = %28, %27, %23, %19, %15, %11
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str = [9 x i8] c"%u.%u.%u\00"
define i32 @old_module_version(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = icmp ugt i32 %9, 2
br i1 %10, label %22, label %11
11: ; preds = %1
%12 = icmp eq i32 %9, 2
br i1 %12, label %13, label %22
13: ; preds = %11
%14 = load i32, i32* %3
%15 = icmp ugt i32 %14, 5
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = icmp eq i32 %14, 5
br i1 %17, label %18, label %22
18: ; preds = %16
%19 = load i32, i32* %4
%20 = icmp ult i32 %19, 48
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %18, %16, %13, %11, %1
%23 = phi i32 [ 0, %1 ], [ 1, %11 ], [ 0, %13 ], [ 1, %16 ], [ %21, %18 ]
ret i32 %23
}