#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ buff2;
struct TYPE_4__ {
  int length;
  unsigned char *data;
  scalar_t__ type;
  scalar_t__ flags;
};
typedef TYPE_1__ ASN1_TIME;

/* Variables and functions */
scalar_t__ V_ASN1_UTCTIME;
int /*<<< orphan*/ *X509_time_adj(TYPE_1__ *, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strcmp(char *, char *);
int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) {
  char *str;
  ASN1_TIME atm;
  long offset;
  char buff1[24], buff2[24], *p;
  int i, j;
  p = buff1;
  i = ctm->length;
  str = (char *)ctm->data;
  if (ctm->type == V_ASN1_UTCTIME) {
    if ((i < 11) || (i > 17))
      return 0;
    memcpy(p, str, 10);
    p += 10;
    str += 10;
  } else {
    if (i < 13)
      return 0;
    memcpy(p, str, 12);
    p += 12;
    str += 12;
  }
  if ((*str == 'Z') || (*str == '-') || (*str == '+')) {
    *(p++) = '0';
    *(p++) = '0';
  } else {
    *(p++) = *(str++);
    *(p++) = *(str++);
    if (*str == '.') {
      str++;
      while ((*str >= '0') && (*str <= '9'))
        str++;
    }
  }
  *(p++) = 'Z';
  *(p++) = '\0';
  if (*str == 'Z')
    offset = 0;
  else {
    if ((*str != '+') && (*str != '-'))
      return 0;
    offset = ((str[1] - '0') * 10 + (str[2] - '0')) * 60;
    offset += (str[3] - '0') * 10 + (str[4] - '0');
    if (*str == '-')
      offset = -offset;
  }
  atm.type = ctm->type;
  atm.flags = 0;
  atm.length = sizeof(buff2);
  atm.data = (unsigned char *)buff2;
  if (X509_time_adj(&atm, offset * 60, cmp_time) == NULL)
    return 0;
  if (ctm->type == V_ASN1_UTCTIME) {
    i = (buff1[0] - '0') * 10 + (buff1[1] - '0');
    if (i < 50)
      i += 100;
    j = (buff2[0] - '0') * 10 + (buff2[1] - '0');
    if (j < 50)
      j += 100;
    if (i < j)
      return -1;
    if (i > j)
      return 1;
  }
  i = strcmp(buff1, buff2);
  if (i == 0)
    return -1;
  else
    return i;
}


x86 assembly (clang, -O0):
<X509_cmp_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%rax
jne    11dc <X509_cmp_time+0xac>
cmpl   $0xb,-0x8c(%rbp)
jl     1198 <X509_cmp_time+0x68>
cmpl   $0x11,-0x8c(%rbp)
jle    11a4 <X509_cmp_time+0x74>
movl   $0x0,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x88(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
mov    -0x88(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x20(%rbp)
jmp    1228 <X509_cmp_time+0xf8>
cmpl   $0xd,-0x8c(%rbp)
jge    11f5 <X509_cmp_time+0xc5>
movl   $0x0,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x88(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   1040 <memcpy@plt>
mov    -0x88(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
je     1258 <X509_cmp_time+0x128>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1258 <X509_cmp_time+0x128>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    128d <X509_cmp_time+0x15d>
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movb   $0x30,(%rax)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movb   $0x30,(%rax)
jmp    1352 <X509_cmp_time+0x222>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    134d <X509_cmp_time+0x21d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x91(%rbp)
jl     1324 <X509_cmp_time+0x1f4>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x91(%rbp)
mov    -0x91(%rbp),%al
test   $0x1,%al
jne    1337 <X509_cmp_time+0x207>
jmp    1348 <X509_cmp_time+0x218>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    12f9 <X509_cmp_time+0x1c9>
jmp    134d <X509_cmp_time+0x21d>
jmp    1352 <X509_cmp_time+0x222>
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movb   $0x5a,(%rax)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jne    139f <X509_cmp_time+0x26f>
movq   $0x0,-0x48(%rbp)
jmp    1433 <X509_cmp_time+0x303>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     13cb <X509_cmp_time+0x29b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     13cb <X509_cmp_time+0x29b>
movl   $0x0,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x20(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
imul   $0x3c,%eax,%eax
cltq
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsbl 0x3(%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x20(%rbp),%rcx
movsbl 0x4(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
cltq
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    142e <X509_cmp_time+0x2fe>
xor    %eax,%eax
sub    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1433 <X509_cmp_time+0x303>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x18,-0x40(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x38(%rbp)
imul   $0x3c,-0x48(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x40(%rbp),%rdi
call   1050 <X509_time_adj@plt>
cmp    $0x0,%rax
jne    147e <X509_cmp_time+0x34e>
movl   $0x0,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x2b53(%rip),%rcx
cmp    (%rcx),%rax
jne    1541 <X509_cmp_time+0x411>
movsbl -0x60(%rbp),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
movsbl -0x5f(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x8c(%rbp)
cmpl   $0x32,-0x8c(%rbp)
jge    14cb <X509_cmp_time+0x39b>
mov    -0x8c(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x8c(%rbp)
movsbl -0x80(%rbp),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
movsbl -0x7f(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x90(%rbp)
cmpl   $0x32,-0x90(%rbp)
jge    1500 <X509_cmp_time+0x3d0>
mov    -0x90(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x90(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x90(%rbp),%eax
jge    151e <X509_cmp_time+0x3ee>
movl   $0xffffffff,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x8c(%rbp),%eax
cmp    -0x90(%rbp),%eax
jle    153c <X509_cmp_time+0x40c>
movl   $0x1,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
jmp    1541 <X509_cmp_time+0x411>
lea    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jne    156d <X509_cmp_time+0x43d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1576 <X509_cmp_time+0x446>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_cmp_time>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%eax
mov    0x8(%rdi),%rbx
mov    0x10(%rdi),%rcx
mov    0x2e8c(%rip),%r13
cmp    0x0(%r13),%rcx
jne    1176 <X509_cmp_time+0x46>
add    $0xffffffee,%eax
xor    %r12d,%r12d
cmp    $0xfffffff9,%eax
jb     132c <X509_cmp_time+0x1fc>
mov    $0xa,%r12d
mov    $0xa,%edx
jmp    118d <X509_cmp_time+0x5d>
xor    %r12d,%r12d
cmp    $0xd,%eax
jl     132c <X509_cmp_time+0x1fc>
mov    $0xc,%r12d
mov    $0xc,%edx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
lea    (%rbx,%r12,1),%rax
mov    (%rbx,%r12,1),%cl
lea    -0x2b(%rcx),%edx
cmp    $0x2f,%dl
ja     1234 <X509_cmp_time+0x104>
movzbl %dl,%edx
movabs $0x800000000005,%rsi
bt     %rdx,%rsi
jae    1234 <X509_cmp_time+0x104>
movw   $0x3030,(%rsp,%r12,1)
movw   $0x5a,0x2(%rsp,%r12,1)
mov    (%rax),%cl
xor    %r12d,%r12d
cmp    $0x2b,%cl
je     11ea <X509_cmp_time+0xba>
cmp    $0x5a,%cl
je     1275 <X509_cmp_time+0x145>
cmp    $0x2d,%cl
jne    132c <X509_cmp_time+0x1fc>
movsbq 0x1(%rax),%rdx
lea    (%rdx,%rdx,4),%rdx
movsbq 0x2(%rax),%rsi
lea    (%rsi,%rdx,2),%rdx
imul   $0x3c,%rdx,%rdx
movsbq 0x3(%rax),%rsi
lea    (%rsi,%rsi,4),%rsi
movsbq 0x4(%rax),%rax
lea    (%rax,%rsi,2),%rax
lea    (%rax,%rdx,1),%rsi
add    %rdx,%rax
add    $0xffffffffffff8230,%rax
mov    $0x7dd0,%edx
sub    %rsi,%rdx
cmp    $0x2d,%cl
cmovne %rax,%rdx
imul   $0x3c,%rdx,%rsi
jmp    1277 <X509_cmp_time+0x147>
mov    %cl,(%rsp,%r12,1)
mov    0x1(%rax),%cl
mov    %cl,0x1(%rsp,%r12,1)
cmpb   $0x2e,0x2(%rax)
jne    133d <X509_cmp_time+0x20d>
lea    (%r12,%rbx,1),%rax
add    $0x2,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1260 <X509_cmp_time+0x130>
jmp    11c6 <X509_cmp_time+0x96>
xor    %esi,%esi
mov    0x10(%r15),%rax
mov    %rax,0x50(%rsp)
movq   $0x0,0x58(%rsp)
movl   $0x18,0x40(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0x48(%rsp)
lea    0x40(%rsp),%rdi
mov    %r14,%rdx
call   1050 <X509_time_adj@plt>
test   %rax,%rax
je     132c <X509_cmp_time+0x1fc>
mov    0x10(%r15),%rax
cmp    0x0(%r13),%rax
jne    1316 <X509_cmp_time+0x1e6>
movsbl (%rsp),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x1(%rsp),%ecx
lea    (%rcx,%rax,2),%edx
cmp    $0x242,%edx
lea    -0x1ac(%rcx,%rax,2),%edx
lea    -0x210(%rcx,%rax,2),%eax
cmovl  %edx,%eax
movsbl 0x20(%rsp),%ecx
lea    (%rcx,%rcx,4),%ecx
movsbl 0x21(%rsp),%edx
lea    (%rdx,%rcx,2),%esi
cmp    $0x242,%esi
lea    -0x1ac(%rdx,%rcx,2),%esi
lea    -0x210(%rdx,%rcx,2),%ecx
cmovl  %esi,%ecx
mov    $0xffffffff,%r12d
cmp    %ecx,%eax
jl     132c <X509_cmp_time+0x1fc>
mov    $0x1,%r12d
jg     132c <X509_cmp_time+0x1fc>
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
sbb    %r12d,%r12d
or     %eax,%r12d
mov    %r12d,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
add    $0x2,%rax
jmp    11c6 <X509_cmp_time+0x96>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i8*, i64, i64 }
@V_ASN1_UTCTIME = global i64 0
define i32 @X509_cmp_time(%struct.TYPE_4__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.TYPE_4__
%8 = alloca i64
%9 = alloca [24 x i8]
%10 = alloca [24 x i8]
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32* %1, i32** %5
%14 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
store i8* %14, i8** %11
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 0
%17 = load i32, i32* %16
store i32 %17, i32* %12
%18 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%19 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %18, i32 0, i32 1
%20 = load i8*, i8** %19
store i8* %20, i8** %6
%21 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %21, i32 0, i32 2
%23 = load i64, i64* %22
%24 = load i64, i64* @V_ASN1_UTCTIME
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %41
26: ; preds = %2
%27 = load i32, i32* %12
%28 = icmp slt i32 %27, 11
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* %12
%31 = icmp sgt i32 %30, 17
br i1 %31, label %32, label %33
32: ; preds = %29, %26
store i32 0, i32* %3
br label %240
33: ; preds = %29
%34 = load i8*, i8** %11
%35 = load i8*, i8** %6
%36 = call i32 @memcpy(i8* %34, i8* %35, i32 10)
%37 = load i8*, i8** %11
%38 = getelementptr inbounds i8, i8* %37, i64 10
store i8* %38, i8** %11
%39 = load i8*, i8** %6
%40 = getelementptr inbounds i8, i8* %39, i64 10
store i8* %40, i8** %6
br label %53
41: ; preds = %2
%42 = load i32, i32* %12
%43 = icmp slt i32 %42, 13
br i1 %43, label %44, label %45
44: ; preds = %41
store i32 0, i32* %3
br label %240
45: ; preds = %41
%46 = load i8*, i8** %11
%47 = load i8*, i8** %6
%48 = call i32 @memcpy(i8* %46, i8* %47, i32 12)
%49 = load i8*, i8** %11
%50 = getelementptr inbounds i8, i8* %49, i64 12
store i8* %50, i8** %11
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i64 12
store i8* %52, i8** %6
br label %53
53: ; preds = %45, %33
%54 = load i8*, i8** %6
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 90
br i1 %57, label %68, label %58
58: ; preds = %53
%59 = load i8*, i8** %6
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 45
br i1 %62, label %68, label %63
63: ; preds = %58
%64 = load i8*, i8** %6
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 43
br i1 %67, label %68, label %73
68: ; preds = %63, %58, %53
%69 = load i8*, i8** %11
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %11
store i8 48, i8* %69
%71 = load i8*, i8** %11
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %11
store i8 48, i8* %71
br label %108
73: ; preds = %63
%74 = load i8*, i8** %6
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %6
%76 = load i8, i8* %74
%77 = load i8*, i8** %11
%78 = getelementptr inbounds i8, i8* %77, i32 1
store i8* %78, i8** %11
store i8 %76, i8* %77
%79 = load i8*, i8** %6
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %6
%81 = load i8, i8* %79
%82 = load i8*, i8** %11
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %11
store i8 %81, i8* %82
%84 = load i8*, i8** %6
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 46
br i1 %87, label %88, label %107
88: ; preds = %73
%89 = load i8*, i8** %6
%90 = getelementptr inbounds i8, i8* %89, i32 1
store i8* %90, i8** %6
br label %91
91: ; preds = %103, %88
%92 = load i8*, i8** %6
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp sge i32 %94, 48
br i1 %95, label %96, label %101
96: ; preds = %91
%97 = load i8*, i8** %6
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp sle i32 %99, 57
br label %101
101: ; preds = %96, %91
%102 = phi i1 [ false, %91 ], [ %100, %96 ]
br i1 %102, label %103, label %106
103: ; preds = %101
%104 = load i8*, i8** %6
%105 = getelementptr inbounds i8, i8* %104, i32 1
store i8* %105, i8** %6
br label %91
106: ; preds = %101
br label %107
107: ; preds = %106, %73
br label %108
108: ; preds = %107, %68
%109 = load i8*, i8** %11
%110 = getelementptr inbounds i8, i8* %109, i32 1
store i8* %110, i8** %11
store i8 90, i8* %109
%111 = load i8*, i8** %11
%112 = getelementptr inbounds i8, i8* %111, i32 1
store i8* %112, i8** %11
store i8 0, i8* %111
%113 = load i8*, i8** %6
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 90
br i1 %116, label %117, label %118
117: ; preds = %108
store i64 0, i64* %8
br label %167
118: ; preds = %108
%119 = load i8*, i8** %6
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp ne i32 %121, 43
br i1 %122, label %123, label %129
123: ; preds = %118
%124 = load i8*, i8** %6
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = icmp ne i32 %126, 45
br i1 %127, label %128, label %129
128: ; preds = %123
store i32 0, i32* %3
br label %240
129: ; preds = %123, %118
%130 = load i8*, i8** %6
%131 = getelementptr inbounds i8, i8* %130, i64 1
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = sub nsw i32 %133, 48
%135 = mul nsw i32 %134, 10
%136 = load i8*, i8** %6
%137 = getelementptr inbounds i8, i8* %136, i64 2
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = sub nsw i32 %139, 48
%141 = add nsw i32 %135, %140
%142 = mul nsw i32 %141, 60
%143 = sext i32 %142 to i64
store i64 %143, i64* %8
%144 = load i8*, i8** %6
%145 = getelementptr inbounds i8, i8* %144, i64 3
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = sub nsw i32 %147, 48
%149 = mul nsw i32 %148, 10
%150 = load i8*, i8** %6
%151 = getelementptr inbounds i8, i8* %150, i64 4
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = sub nsw i32 %153, 48
%155 = add nsw i32 %149, %154
%156 = sext i32 %155 to i64
%157 = load i64, i64* %8
%158 = add nsw i64 %157, %156
store i64 %158, i64* %8
%159 = load i8*, i8** %6
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 45
br i1 %162, label %163, label %166
163: ; preds = %129
%164 = load i64, i64* %8
%165 = sub nsw i64 0, %164
store i64 %165, i64* %8
br label %166
166: ; preds = %163, %129
br label %167
167: ; preds = %166, %117
%168 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%169 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %168, i32 0, i32 2
%170 = load i64, i64* %169
%171 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 2
store i64 %170, i64* %171
%172 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 3
store i64 0, i64* %172
%173 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
store i32 24, i32* %173
%174 = getelementptr inbounds [24 x i8], [24 x i8]* %10, i64 0, i64 0
%175 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 1
store i8* %174, i8** %175
%176 = load i64, i64* %8
%177 = mul nsw i64 %176, 60
%178 = load i32*, i32** %5
%179 = call i32* @X509_time_adj(%struct.TYPE_4__* %7, i64 %177, i32* %178)
%180 = icmp eq i32* %179, null
br i1 %180, label %181, label %182
181: ; preds = %167
store i32 0, i32* %3
br label %240
182: ; preds = %167
%183 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%184 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %183, i32 0, i32 2
%185 = load i64, i64* %184
%186 = load i64, i64* @V_ASN1_UTCTIME
%187 = icmp eq i64 %185, %186
br i1 %187, label %188, label %231
188: ; preds = %182
%189 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
%190 = load i8, i8* %189
%191 = sext i8 %190 to i32
%192 = sub nsw i32 %191, 48
%193 = mul nsw i32 %192, 10
%194 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 1
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = sub nsw i32 %196, 48
%198 = add nsw i32 %193, %197
store i32 %198, i32* %12
%199 = load i32, i32* %12
%200 = icmp slt i32 %199, 50
br i1 %200, label %201, label %204
201: ; preds = %188
%202 = load i32, i32* %12
%203 = add nsw i32 %202, 100
store i32 %203, i32* %12
br label %204
204: ; preds = %201, %188
%205 = getelementptr inbounds [24 x i8], [24 x i8]* %10, i64 0, i64 0
%206 = load i8, i8* %205
%207 = sext i8 %206 to i32
%208 = sub nsw i32 %207, 48
%209 = mul nsw i32 %208, 10
%210 = getelementptr inbounds [24 x i8], [24 x i8]* %10, i64 0, i64 1
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = sub nsw i32 %212, 48
%214 = add nsw i32 %209, %213
store i32 %214, i32* %13
%215 = load i32, i32* %13
%216 = icmp slt i32 %215, 50
br i1 %216, label %217, label %220
217: ; preds = %204
%218 = load i32, i32* %13
%219 = add nsw i32 %218, 100
store i32 %219, i32* %13
br label %220
220: ; preds = %217, %204
%221 = load i32, i32* %12
%222 = load i32, i32* %13
%223 = icmp slt i32 %221, %222
br i1 %223, label %224, label %225
224: ; preds = %220
store i32 -1, i32* %3
br label %240
225: ; preds = %220
%226 = load i32, i32* %12
%227 = load i32, i32* %13
%228 = icmp sgt i32 %226, %227
br i1 %228, label %229, label %230
229: ; preds = %225
store i32 1, i32* %3
br label %240
230: ; preds = %225
br label %231
231: ; preds = %230, %182
%232 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
%233 = getelementptr inbounds [24 x i8], [24 x i8]* %10, i64 0, i64 0
%234 = call i32 @strcmp(i8* %232, i8* %233)
store i32 %234, i32* %12
%235 = load i32, i32* %12
%236 = icmp eq i32 %235, 0
br i1 %236, label %237, label %238
237: ; preds = %231
store i32 -1, i32* %3
br label %240
238: ; preds = %231
%239 = load i32, i32* %12
store i32 %239, i32* %3
br label %240
240: ; preds = %238, %237, %229, %224, %181, %128, %44, %32
%241 = load i32, i32* %3
ret i32 %241
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i8*, i64, i64 }
@V_ASN1_UTCTIME = global i64 0
define i32 @X509_cmp_time(%struct.TYPE_4__* nocapture %0, i32* %1) {
%3 = alloca %struct.TYPE_4__
%4 = alloca [24 x i8]
%5 = alloca [24 x i8]
%6 = bitcast %struct.TYPE_4__* %3 to i8*
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 2
%14 = load i64, i64* %13
%15 = load i64, i64* @V_ASN1_UTCTIME
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = add i32 %10, -18
%19 = icmp ult i32 %18, -7
br i1 %19, label %116, label %22
20: ; preds = %2
%21 = icmp slt i32 %10, 13
br i1 %21, label %116, label %22
22: ; preds = %20, %17
%23 = phi i32 [ 10, %17 ], [ 12, %20 ]
%24 = phi i64 [ 10, %17 ], [ 12, %20 ]
%25 = call i32 @memcpy(i8* %7, i8* %12, i32 %23)
%26 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 %24
%27 = getelementptr inbounds i8, i8* %12, i64 %24
%28 = load i8, i8* %27
switch i8 %28, label %31 [
i8 90, label %29
i8 45, label %29
i8 43, label %29
]
29: ; preds = %22, %22, %22
%30 = getelementptr inbounds i8, i8* %26, i64 1
store i8 48, i8* %26
store i8 48, i8* %30
br label %46
31: ; preds = %22
%32 = getelementptr inbounds i8, i8* %27, i64 1
%33 = getelementptr inbounds i8, i8* %26, i64 1
store i8 %28, i8* %26
%34 = getelementptr inbounds i8, i8* %27, i64 2
%35 = load i8, i8* %32
store i8 %35, i8* %33
%36 = load i8, i8* %34
%37 = icmp eq i8 %36, 46
br i1 %37, label %38, label %46
38: ; preds = %31
%39 = getelementptr inbounds i8, i8* %27, i64 3
br label %40
40: ; preds = %40, %38
%41 = phi i8* [ %39, %38 ], [ %45, %40 ]
%42 = load i8, i8* %41
%43 = add i8 %42, -48
%44 = icmp ult i8 %43, 10
%45 = getelementptr inbounds i8, i8* %41, i64 1
br i1 %44, label %40, label %46
46: ; preds = %40, %31, %29
%47 = phi i8* [ %27, %29 ], [ %34, %31 ], [ %41, %40 ]
%48 = getelementptr inbounds i8, i8* %26, i64 2
%49 = getelementptr inbounds i8, i8* %26, i64 3
store i8 90, i8* %48
store i8 0, i8* %49
%50 = load i8, i8* %47
switch i8 %50, label %116 [
i8 90, label %75
i8 43, label %51
i8 45, label %51
]
51: ; preds = %46, %46
%52 = getelementptr inbounds i8, i8* %47, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i64
%55 = mul nsw i64 %54, 10
%56 = getelementptr inbounds i8, i8* %47, i64 2
%57 = load i8, i8* %56
%58 = sext i8 %57 to i64
%59 = add nsw i64 %55, %58
%60 = mul nsw i64 %59, 60
%61 = getelementptr inbounds i8, i8* %47, i64 3
%62 = load i8, i8* %61
%63 = sext i8 %62 to i64
%64 = mul nsw i64 %63, 10
%65 = getelementptr inbounds i8, i8* %47, i64 4
%66 = load i8, i8* %65
%67 = sext i8 %66 to i64
%68 = add nsw i64 %64, %67
%69 = add nsw i64 %68, %60
%70 = add nsw i64 %69, -32208
%71 = icmp eq i8 %50, 45
%72 = sub nsw i64 32208, %69
%73 = select i1 %71, i64 %72, i64 %70
%74 = mul nsw i64 %73, 60
br label %75
75: ; preds = %51, %46
%76 = phi i64 [ 0, %46 ], [ %74, %51 ]
%77 = load i64, i64* %13
%78 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 2
store i64 %77, i64* %78
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 3
store i64 0, i64* %79
%80 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
store i32 24, i32* %80
%81 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
store i8* %8, i8** %81
%82 = call i32* @X509_time_adj(%struct.TYPE_4__* %3, i64 %76, i32* %1)
%83 = icmp eq i32* %82, null
br i1 %83, label %116, label %84
84: ; preds = %75
%85 = load i64, i64* %13
%86 = load i64, i64* @V_ASN1_UTCTIME
%87 = icmp eq i64 %85, %86
br i1 %87, label %88, label %112
88: ; preds = %84
%89 = load i8, i8* %7
%90 = sext i8 %89 to i32
%91 = mul nsw i32 %90, 10
%92 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 1
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = add nsw i32 %91, %94
%96 = icmp slt i32 %95, 578
%97 = select i1 %96, i32 -428, i32 -528
%98 = add nsw i32 %97, %95
%99 = load i8, i8* %8
%100 = sext i8 %99 to i32
%101 = mul nsw i32 %100, 10
%102 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 1
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = add nsw i32 %101, %104
%106 = icmp slt i32 %105, 578
%107 = select i1 %106, i32 -428, i32 -528
%108 = add nsw i32 %107, %105
%109 = icmp slt i32 %98, %108
br i1 %109, label %116, label %110
110: ; preds = %88
%111 = icmp sgt i32 %98, %108
br i1 %111, label %116, label %112
112: ; preds = %110, %84
%113 = call i32 @strcmp(i8* %7, i8* %8)
%114 = icmp eq i32 %113, 0
%115 = select i1 %114, i32 -1, i32 %113
br label %116
116: ; preds = %112, %110, %88, %75, %46, %20, %17
%117 = phi i32 [ 0, %17 ], [ 0, %20 ], [ 0, %46 ], [ 0, %75 ], [ -1, %88 ], [ 1, %110 ], [ %115, %112 ]
ret i32 %117
}