#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 */
typedef int /*<<< orphan*/ usecstr;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  char *tm_hour;
  int /*<<< orphan*/ tm_sec;
  int /*<<< orphan*/ tm_min;
};
typedef int /*<<< orphan*/ genTime_str;
typedef int /*<<< orphan*/ ASN1_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ASN1_GENERALIZEDTIME_new();
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_set_string(int /*<<< orphan*/ *,
                                                   char *);
int TS_MAX_CLOCK_PRECISION_DIGITS;
int /*<<< orphan*/ TS_R_COULD_NOT_SET_TIME;
int /*<<< orphan*/ TSerror(int /*<<< orphan*/);
struct tm *gmtime(int /*<<< orphan*/ *);
int snprintf(char *, int, char *, int, ...);
int strlen(char *);
ASN1_GENERALIZEDTIME *
TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, time_t sec,
                                   long usec, unsigned precision) {
  struct tm *tm = NULL;
  char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS];
  char usecstr[TS_MAX_CLOCK_PRECISION_DIGITS + 2];
  char *p;
  int rv;
  if (precision > TS_MAX_CLOCK_PRECISION_DIGITS)
    goto err;
  if (!(tm = gmtime(&sec)))
    goto err;
  if (precision > 0) {
    (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
    usecstr[precision + 1] = '\0';
    p = usecstr + strlen(usecstr) - 1;
    while (p > usecstr && *p == '0')
      *p-- = '\0';
    if (p == usecstr)
      *p = '\0';
  } else {
    usecstr[0] = '\0';
  }
  rv = snprintf(genTime_str, sizeof(genTime_str), "%04d%02d%02d%02d%02d%02d%sZ",
                tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
                tm->tm_min, tm->tm_sec, usecstr);
  if (rv == -1 || rv >= sizeof(genTime_str))
    goto err;
  if (!asn1_time && !(asn1_time = ASN1_GENERALIZEDTIME_new()))
    goto err;
  if (!ASN1_GENERALIZEDTIME_set_string(asn1_time, genTime_str)) {
    ASN1_GENERALIZEDTIME_free(asn1_time);
    goto err;
  }
  return asn1_time;
err:
  TSerror(TS_R_COULD_NOT_SET_TIME);
  return NULL;
}


x86 assembly (clang, -O0):
<TS_RESP_set_genTime_with_precision>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x88,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
mov    0x2e47(%rip),%rax
mov    (%rax),%ecx
add    $0x11,%ecx
mov    %rcx,-0x80(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x78(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x48(%rbp)
mov    (%rax),%eax
add    $0x2,%eax
mov    %rax,-0x70(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2dec(%rip),%rcx
cmp    (%rcx),%eax
jbe    1201 <TS_RESP_set_genTime_with_precision+0x91>
jmp    13d1 <TS_RESP_set_genTime_with_precision+0x261>
lea    -0x1c(%rbp),%rdi
call   1070 <gmtime@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    121d <TS_RESP_set_genTime_with_precision+0xad>
jmp    13d1 <TS_RESP_set_genTime_with_precision+0x261>
cmpl   $0x0,-0x2c(%rbp)
jbe    12db <TS_RESP_set_genTime_with_precision+0x16b>
mov    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rax
mov    %eax,%esi
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
lea    0xdc2(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    -0x68(%rbp),%rdi
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x58(%rbp)
mov    -0x68(%rbp),%rcx
xor    %eax,%eax
cmp    %rcx,-0x58(%rbp)
mov    %al,-0x81(%rbp)
jbe    1297 <TS_RESP_set_genTime_with_precision+0x127>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
sete   %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    12aa <TS_RESP_set_genTime_with_precision+0x13a>
jmp    12c1 <TS_RESP_set_genTime_with_precision+0x151>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
movb   $0x0,(%rax)
jmp    126e <TS_RESP_set_genTime_with_precision+0xfe>
mov    -0x68(%rbp),%rax
cmp    %rax,-0x58(%rbp)
jne    12d6 <TS_RESP_set_genTime_with_precision+0x166>
mov    -0x58(%rbp),%rax
movb   $0x0,(%rax)
jmp    12e2 <TS_RESP_set_genTime_with_precision+0x172>
mov    -0x68(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x68(%rbp),%rax
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rcx
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x76c,%ecx
mov    -0x38(%rbp),%rdx
mov    0x4(%rdx),%r8d
add    $0x1,%r8d
mov    -0x38(%rbp),%rdx
mov    0x8(%rdx),%r9d
mov    -0x38(%rbp),%rdx
mov    0x10(%rdx),%rbx
mov    -0x38(%rbp),%rdx
mov    0x1c(%rdx),%r11d
mov    -0x38(%rbp),%rdx
mov    0x18(%rdx),%r10d
lea    0xcd8(%rip),%rdx
sub    $0x20,%rsp
mov    %rbx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1040 <snprintf@plt>
add    $0x20,%rsp
mov    %eax,-0x5c(%rbp)
cmpl   $0xffffffff,-0x5c(%rbp)
je     136f <TS_RESP_set_genTime_with_precision+0x1ff>
mov    -0x80(%rbp),%rcx
movslq -0x5c(%rbp),%rax
cmp    %rcx,%rax
jb     1374 <TS_RESP_set_genTime_with_precision+0x204>
jmp    13d1 <TS_RESP_set_genTime_with_precision+0x261>
cmpq   $0x0,-0x18(%rbp)
jne    1399 <TS_RESP_set_genTime_with_precision+0x229>
mov    $0x0,%al
call   1080 <ASN1_GENERALIZEDTIME_new@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1399 <TS_RESP_set_genTime_with_precision+0x229>
jmp    13d1 <TS_RESP_set_genTime_with_precision+0x261>
mov    -0x78(%rbp),%rsi
mov    -0x18(%rbp),%rdi
call   1060 <ASN1_GENERALIZEDTIME_set_string@plt>
cmp    $0x0,%eax
jne    13bd <TS_RESP_set_genTime_with_precision+0x24d>
mov    -0x18(%rbp),%rdi
call   1050 <ASN1_GENERALIZEDTIME_free@plt>
jmp    13d1 <TS_RESP_set_genTime_with_precision+0x261>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    13ee <TS_RESP_set_genTime_with_precision+0x27e>
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
call   1090 <TSerror@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x60(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x10(%rbp),%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<TS_RESP_set_genTime_with_precision>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r15d
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
lea    0x11(%rax),%ecx
mov    %rsp,%r12
mov    %rcx,-0x40(%rbp)
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
lea    0x2(%rax),%r14d
mov    %rsp,%rbx
lea    0xf(%r14),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
cmp    %r15d,%eax
jb     12b9 <TS_RESP_set_genTime_with_precision+0x149>
lea    -0x34(%rbp),%rdi
mov    %rdx,%r13
call   1070 <gmtime@plt>
test   %rax,%rax
je     12b9 <TS_RESP_set_genTime_with_precision+0x149>
mov    %r13,%rcx
mov    %rax,%r13
test   %r15d,%r15d
je     1238 <TS_RESP_set_genTime_with_precision+0xc8>
lea    0xe0f(%rip),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <snprintf@plt>
add    $0x1,%r15d
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jbe    1233 <TS_RESP_set_genTime_with_precision+0xc3>
nopl   (%rax)
cmpb   $0x30,(%rax)
jne    1233 <TS_RESP_set_genTime_with_precision+0xc3>
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
ja     1220 <TS_RESP_set_genTime_with_precision+0xb0>
jmp    1238 <TS_RESP_set_genTime_with_precision+0xc8>
cmp    %rbx,%rax
jne    123b <TS_RESP_set_genTime_with_precision+0xcb>
movb   $0x0,(%rbx)
mov    $0x76c,%ecx
add    0x0(%r13),%ecx
mov    0x4(%r13),%r8d
mov    0x8(%r13),%r9d
add    $0x1,%r8d
mov    0x1c(%r13),%r10d
mov    0x18(%r13),%r11d
lea    0xda8(%rip),%rdx
mov    %r12,%rdi
mov    -0x40(%rbp),%rsi
xor    %eax,%eax
push   %rbx
push   %r11
push   %r10
push   0x10(%r13)
call   1040 <snprintf@plt>
add    $0x20,%rsp
cmp    $0xffffffff,%eax
je     12b9 <TS_RESP_set_genTime_with_precision+0x149>
cltq
cmp    -0x40(%rbp),%rax
jae    12b9 <TS_RESP_set_genTime_with_precision+0x149>
cmpq   $0x0,-0x30(%rbp)
jne    129e <TS_RESP_set_genTime_with_precision+0x12e>
xor    %eax,%eax
call   1080 <ASN1_GENERALIZEDTIME_new@plt>
mov    %rax,-0x30(%rbp)
test   %rax,%rax
je     12b9 <TS_RESP_set_genTime_with_precision+0x149>
mov    -0x30(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <ASN1_GENERALIZEDTIME_set_string@plt>
test   %eax,%eax
jne    12c9 <TS_RESP_set_genTime_with_precision+0x159>
mov    %rbx,%rdi
call   1050 <ASN1_GENERALIZEDTIME_free@plt>
mov    0x2d18(%rip),%rax
mov    (%rax),%edi
call   1090 <TSerror@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i8*, i32, i32 }
@TS_MAX_CLOCK_PRECISION_DIGITS = global i32 0
@.str = [7 x i8] c".%06ld\00"
@.str.1 = [28 x i8] c"%04d%02d%02d%02d%02d%02d%sZ\00"
@TS_R_COULD_NOT_SET_TIME = global i32 0
define i32* @TS_RESP_set_genTime_with_precision(i32* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
%10 = alloca %struct.tm*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store %struct.tm* null, %struct.tm** %10
%17 = load i32, i32* @TS_MAX_CLOCK_PRECISION_DIGITS
%18 = add nsw i32 17, %17
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %11
%21 = alloca i8, i64 %19
store i64 %19, i64* %12
%22 = load i32, i32* @TS_MAX_CLOCK_PRECISION_DIGITS
%23 = add nsw i32 %22, 2
%24 = zext i32 %23 to i64
%25 = alloca i8, i64 %24
store i64 %24, i64* %13
%26 = load i32, i32* %9
%27 = load i32, i32* @TS_MAX_CLOCK_PRECISION_DIGITS
%28 = icmp ugt i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %4
br label %117
30: ; preds = %4
%31 = call %struct.tm* @gmtime(i32* %7)
store %struct.tm* %31, %struct.tm** %10
%32 = icmp ne %struct.tm* %31, null
br i1 %32, label %34, label %33
33: ; preds = %30
br label %117
34: ; preds = %30
%35 = load i32, i32* %9
%36 = icmp ugt i32 %35, 0
br i1 %36, label %37, label %69
37: ; preds = %34
%38 = trunc i64 %24 to i32
%39 = load i64, i64* %8
%40 = trunc i64 %39 to i32
%41 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %25, i32 %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %9
%43 = add i32 %42, 1
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %25, i64 %44
store i8 0, i8* %45
%46 = call i32 @strlen(i8* %25)
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %25, i64 %47
%49 = getelementptr inbounds i8, i8* %48, i64 -1
store i8* %49, i8** %14
br label %50
50: ; preds = %60, %37
%51 = load i8*, i8** %14
%52 = icmp ugt i8* %51, %25
br i1 %52, label %53, label %58
53: ; preds = %50
%54 = load i8*, i8** %14
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 48
br label %58
58: ; preds = %53, %50
%59 = phi i1 [ false, %50 ], [ %57, %53 ]
br i1 %59, label %60, label %63
60: ; preds = %58
%61 = load i8*, i8** %14
%62 = getelementptr inbounds i8, i8* %61, i32 -1
store i8* %62, i8** %14
store i8 0, i8* %61
br label %50
63: ; preds = %58
%64 = load i8*, i8** %14
%65 = icmp eq i8* %64, %25
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = load i8*, i8** %14
store i8 0, i8* %67
br label %68
68: ; preds = %66, %63
br label %71
69: ; preds = %34
%70 = getelementptr inbounds i8, i8* %25, i64 0
store i8 0, i8* %70
br label %71
71: ; preds = %69, %68
%72 = trunc i64 %19 to i32
%73 = load %struct.tm*, %struct.tm** %10
%74 = getelementptr inbounds %struct.tm, %struct.tm* %73, i32 0, i32 0
%75 = load i32, i32* %74
%76 = add nsw i32 %75, 1900
%77 = load %struct.tm*, %struct.tm** %10
%78 = getelementptr inbounds %struct.tm, %struct.tm* %77, i32 0, i32 1
%79 = load i32, i32* %78
%80 = add nsw i32 %79, 1
%81 = load %struct.tm*, %struct.tm** %10
%82 = getelementptr inbounds %struct.tm, %struct.tm* %81, i32 0, i32 2
%83 = load i32, i32* %82
%84 = load %struct.tm*, %struct.tm** %10
%85 = getelementptr inbounds %struct.tm, %struct.tm* %84, i32 0, i32 3
%86 = load i8*, i8** %85
%87 = load %struct.tm*, %struct.tm** %10
%88 = getelementptr inbounds %struct.tm, %struct.tm* %87, i32 0, i32 5
%89 = load i32, i32* %88
%90 = load %struct.tm*, %struct.tm** %10
%91 = getelementptr inbounds %struct.tm, %struct.tm* %90, i32 0, i32 4
%92 = load i32, i32* %91
%93 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %21, i32 %72, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %76, i32 %80, i32 %83, i8* %86, i32 %89, i32 %92, i8* %25)
store i32 %93, i32* %15
%94 = load i32, i32* %15
%95 = icmp eq i32 %94, -1
br i1 %95, label %100, label %96
96: ; preds = %71
%97 = load i32, i32* %15
%98 = sext i32 %97 to i64
%99 = icmp uge i64 %98, %19
br i1 %99, label %100, label %101
100: ; preds = %96, %71
br label %117
101: ; preds = %96
%102 = load i32*, i32** %6
%103 = icmp ne i32* %102, null
br i1 %103, label %108, label %104
104: ; preds = %101
%105 = call i32* (...) @ASN1_GENERALIZEDTIME_new()
store i32* %105, i32** %6
%106 = icmp ne i32* %105, null
br i1 %106, label %108, label %107
107: ; preds = %104
br label %117
108: ; preds = %104, %101
%109 = load i32*, i32** %6
%110 = call i32 @ASN1_GENERALIZEDTIME_set_string(i32* %109, i8* %21)
%111 = icmp ne i32 %110, 0
br i1 %111, label %115, label %112
112: ; preds = %108
%113 = load i32*, i32** %6
%114 = call i32 @ASN1_GENERALIZEDTIME_free(i32* %113)
br label %117
115: ; preds = %108
%116 = load i32*, i32** %6
store i32* %116, i32** %5
store i32 1, i32* %16
br label %120
117: ; preds = %112, %107, %100, %33, %29
%118 = load i32, i32* @TS_R_COULD_NOT_SET_TIME
%119 = call i32 @TSerror(i32 %118)
store i32* null, i32** %5
store i32 1, i32* %16
br label %120
120: ; preds = %117, %115
%121 = load i8*, i8** %11
%122 = load i32*, i32** %5
ret i32* %122
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i8*, i32, i32 }
@TS_MAX_CLOCK_PRECISION_DIGITS = global i32 0
@.str = [7 x i8] c".%06ld\00"
@.str.1 = [28 x i8] c"%04d%02d%02d%02d%02d%02d%sZ\00"
@TS_R_COULD_NOT_SET_TIME = global i32 0
define i32* @TS_RESP_set_genTime_with_precision(i32* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = load i32, i32* @TS_MAX_CLOCK_PRECISION_DIGITS
%7 = add nsw i32 %6, 17
%8 = zext i32 %7 to i64
%9 = alloca i8, i64 %8
%10 = add nsw i32 %6, 2
%11 = zext i32 %10 to i64
%12 = alloca i8, i64 %11
%13 = icmp ult i32 %6, %3
br i1 %13, label %73, label %14
14: ; preds = %4
%15 = call %struct.tm* @gmtime(i32* %5)
%16 = icmp eq %struct.tm* %15, null
br i1 %16, label %73, label %17
17: ; preds = %14
%18 = icmp eq i32 %3, 0
br i1 %18, label %41, label %19
19: ; preds = %17
%20 = trunc i64 %2 to i32
%21 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %12, i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = add i32 %3, 1
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %12, i64 %23
store i8 0, i8* %24
%25 = call i32 @strlen(i8* %12)
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %12, i64 %26
%28 = getelementptr inbounds i8, i8* %27, i64 -1
%29 = icmp ugt i8* %28, %12
br i1 %29, label %30, label %37
30: ; preds = %19, %34
%31 = phi i8* [ %35, %34 ], [ %28, %19 ]
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 48
br i1 %33, label %34, label %37
34: ; preds = %30
store i8 0, i8* %31
%35 = getelementptr inbounds i8, i8* %31, i64 -1
%36 = icmp ugt i8* %35, %12
br i1 %36, label %30, label %40
37: ; preds = %30, %19
%38 = phi i8* [ %28, %19 ], [ %31, %30 ]
%39 = icmp eq i8* %38, %12
br i1 %39, label %40, label %42
40: ; preds = %34, %37
store i8 0, i8* %12
br label %42
41: ; preds = %17
store i8 0, i8* %12
br label %42
42: ; preds = %37, %40, %41
%43 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 0
%44 = load i32, i32* %43
%45 = add nsw i32 %44, 1900
%46 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 1
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
%49 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 2
%50 = load i32, i32* %49
%51 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 3
%52 = load i8*, i8** %51
%53 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 5
%54 = load i32, i32* %53
%55 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 4
%56 = load i32, i32* %55
%57 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %9, i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %48, i32 %50, i8* %52, i32 %54, i32 %56, i8* %12)
%58 = icmp eq i32 %57, -1
%59 = sext i32 %57 to i64
%60 = icmp uge i64 %59, %8
%61 = select i1 %58, i1 true, i1 %60
br i1 %61, label %73, label %62
62: ; preds = %42
%63 = icmp eq i32* %0, null
br i1 %63, label %64, label %67
64: ; preds = %62
%65 = call i32* (...) @ASN1_GENERALIZEDTIME_new()
%66 = icmp eq i32* %65, null
br i1 %66, label %73, label %67
67: ; preds = %64, %62
%68 = phi i32* [ %0, %62 ], [ %65, %64 ]
%69 = call i32 @ASN1_GENERALIZEDTIME_set_string(i32* %68, i8* %9)
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %67
%72 = call i32 @ASN1_GENERALIZEDTIME_free(i32* %68)
br label %73
73: ; preds = %64, %42, %14, %4, %71
%74 = load i32, i32* @TS_R_COULD_NOT_SET_TIME
%75 = call i32 @TSerror(i32 %74)
br label %76
76: ; preds = %67, %73
%77 = phi i32* [ null, %73 ], [ %68, %67 ]
ret i32* %77
}