#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*/ assert(int);
void assert_lsbversion_valid(const char *lsbversion) {
  assert(lsbversion != NULL);
  assert(
      (lsbversion[0] >= '0' && lsbversion[0] <= '9') && lsbversion[1] == '.' &&
      (lsbversion[2] >= '0' && lsbversion[2] <= '9') && lsbversion[3] == '\0');
}


x86 assembly (clang, -O0):
<assert_lsbversion_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     11ab <assert_lsbversion_valid+0x9b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jg     11ab <assert_lsbversion_valid+0x9b>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    11ab <assert_lsbversion_valid+0x9b>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     11ab <assert_lsbversion_valid+0x9b>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jg     11ab <assert_lsbversion_valid+0x9b>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_lsbversion_valid>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%al
add    $0xd0,%al
xor    %edi,%edi
cmp    $0x9,%al
ja     1145 <assert_lsbversion_valid+0x35>
cmpb   $0x2e,0x1(%rbx)
jne    1145 <assert_lsbversion_valid+0x35>
mov    0x2(%rbx),%al
add    $0xd0,%al
cmp    $0x9,%al
ja     1145 <assert_lsbversion_valid+0x35>
xor    %edi,%edi
cmpb   $0x0,0x3(%rbx)
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @assert_lsbversion_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %42
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %42
18: ; preds = %12
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 46
br i1 %23, label %24, label %42
24: ; preds = %18
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 48
br i1 %29, label %30, label %42
30: ; preds = %24
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sle i32 %34, 57
br i1 %35, label %36, label %42
36: ; preds = %30
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 0
br label %42
42: ; preds = %36, %30, %24, %18, %12, %1
%43 = phi i1 [ false, %30 ], [ false, %24 ], [ false, %18 ], [ false, %12 ], [ false, %1 ], [ %41, %36 ]
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
ret void
}

LLVM IR (-O2):
define void @assert_lsbversion_valid(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = add i8 %5, -48
%7 = icmp ult i8 %6, 10
br i1 %7, label %8, label %22
8: ; preds = %1
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 46
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = getelementptr inbounds i8, i8* %0, i64 3
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %17, %12, %8, %1
%23 = phi i32 [ 0, %12 ], [ 0, %8 ], [ 0, %1 ], [ %21, %17 ]
%24 = tail call i32 @assert(i32 %23)
ret void
}