#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_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  scalar_t__ type;
};
typedef int /*<<< orphan*/ BIO;
typedef TYPE_1__ ASN1_TIME;

/* Variables and functions */
int ASN1_GENERALIZEDTIME_print(int /*<<< orphan*/ *, TYPE_1__ const *);
int ASN1_UTCTIME_print(int /*<<< orphan*/ *, TYPE_1__ const *);
int /*<<< orphan*/ BIO_write(int /*<<< orphan*/ *, char *, int);
scalar_t__ V_ASN1_GENERALIZEDTIME;
scalar_t__ V_ASN1_UTCTIME;
int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) {
  if (tm->type == V_ASN1_UTCTIME)
    return ASN1_UTCTIME_print(bp, tm);
  if (tm->type == V_ASN1_GENERALIZEDTIME)
    return ASN1_GENERALIZEDTIME_print(bp, tm);
  BIO_write(bp, "Bad time value", 14);
  return (0);
}


x86 assembly (clang, -O0):
<ASN1_TIME_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
jne    116c <ASN1_TIME_print+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ASN1_UTCTIME_print@plt>
mov    %eax,-0x4(%rbp)
jmp    11b4 <ASN1_TIME_print+0x84>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%rax
jne    1198 <ASN1_TIME_print+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ASN1_GENERALIZEDTIME_print@plt>
mov    %eax,-0x4(%rbp)
jmp    11b4 <ASN1_TIME_print+0x84>
mov    -0x10(%rbp),%rdi
lea    0xe5d(%rip),%rsi
mov    $0xe,%edx
call   1050 <BIO_write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_TIME_print>:
push   %rax
mov    (%rsi),%rax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
jne    1146 <ASN1_TIME_print+0x16>
pop    %rax
jmp    1030 <ASN1_UTCTIME_print@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
jne    1158 <ASN1_TIME_print+0x28>
pop    %rax
jmp    1040 <ASN1_GENERALIZEDTIME_print@plt>
lea    0xea1(%rip),%rsi
mov    $0xe,%edx
call   1050 <BIO_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64 }
@V_ASN1_UTCTIME = global i64 0
@V_ASN1_GENERALIZEDTIME = global i64 0
@.str = [15 x i8] c"Bad time value\00"
define i32 @ASN1_TIME_print(i32* %0, %struct.TYPE_5__* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.TYPE_5__*
store i32* %0, i32** %4
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %5
%6 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* @V_ASN1_UTCTIME
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%14 = call i32 @ASN1_UTCTIME_print(i32* %12, %struct.TYPE_5__* %13)
store i32 %14, i32* %3
br label %28
15: ; preds = %2
%16 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = load i64, i64* @V_ASN1_GENERALIZEDTIME
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32*, i32** %4
%23 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%24 = call i32 @ASN1_GENERALIZEDTIME_print(i32* %22, %struct.TYPE_5__* %23)
store i32 %24, i32* %3
br label %28
25: ; preds = %15
%26 = load i32*, i32** %4
%27 = call i32 @BIO_write(i32* %26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
store i32 0, i32* %3
br label %28
28: ; preds = %25, %21, %11
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64 }
@V_ASN1_UTCTIME = global i64 0
@V_ASN1_GENERALIZEDTIME = global i64 0
@.str = [15 x i8] c"Bad time value\00"
define i32 @ASN1_TIME_print(i32* %0, %struct.TYPE_5__* %1) {
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @V_ASN1_UTCTIME
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @ASN1_UTCTIME_print(i32* %0, %struct.TYPE_5__* %1)
br label %16
9: ; preds = %2
%10 = load i64, i64* @V_ASN1_GENERALIZEDTIME
%11 = icmp eq i64 %4, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @ASN1_GENERALIZEDTIME_print(i32* %0, %struct.TYPE_5__* %1)
br label %16
14: ; preds = %9
%15 = tail call i32 @BIO_write(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
br label %16
16: ; preds = %14, %12, %7
%17 = phi i32 [ %8, %7 ], [ %13, %12 ], [ 0, %14 ]
ret i32 %17
}