#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*/ TS_VERIFY_CTX;
typedef int /*<<< orphan*/ TS_TST_INFO;
typedef int /*<<< orphan*/ PKCS7;

/* Variables and functions */
int /*<<< orphan*/ *PKCS7_to_TS_TST_INFO(int /*<<< orphan*/ *);
int /*<<< orphan*/ TS_TST_INFO_free(int /*<<< orphan*/ *);
int int_TS_RESP_verify_token(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token) {
  TS_TST_INFO *tst_info = PKCS7_to_TS_TST_INFO(token);
  int ret = 0;
  if (tst_info) {
    ret = int_TS_RESP_verify_token(ctx, token, tst_info);
    TS_TST_INFO_free(tst_info);
  }
  return ret;
}


x86 assembly (clang, -O0):
<TS_RESP_verify_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <PKCS7_to_TS_TST_INFO@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <TS_RESP_verify_token+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <int_TS_RESP_verify_token@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <TS_TST_INFO_free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TS_RESP_verify_token>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1050 <PKCS7_to_TS_TST_INFO@plt>
test   %rax,%rax
je     1169 <TS_RESP_verify_token+0x39>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <int_TS_RESP_verify_token@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <TS_TST_INFO_free@plt>
mov    %ebp,%eax
jmp    116b <TS_RESP_verify_token+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @TS_RESP_verify_token(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = call i32* @PKCS7_to_TS_TST_INFO(i32* %7)
store i32* %8, i32** %5
store i32 0, i32* %6
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = call i32 @int_TS_RESP_verify_token(i32* %12, i32* %13, i32* %14)
store i32 %15, i32* %6
%16 = load i32*, i32** %5
%17 = call i32 @TS_TST_INFO_free(i32* %16)
br label %18
18: ; preds = %11, %2
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @TS_RESP_verify_token(i32* %0, i32* %1) {
%3 = tail call i32* @PKCS7_to_TS_TST_INFO(i32* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @int_TS_RESP_verify_token(i32* %0, i32* %1, i32* %3)
%7 = tail call i32 @TS_TST_INFO_free(i32* %3)
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %9
}