#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*/ OCSP_REQ_CTX;
typedef int /*<<< orphan*/ OCSP_REQUEST;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ OCSP_REQ_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_REQ_CTX_http(int /*<<< orphan*/ *, char *,
                                     char const *);
int /*<<< orphan*/ *OCSP_REQ_CTX_new(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ OCSP_REQ_CTX_set1_req(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *);
OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
                               int maxline) {
  OCSP_REQ_CTX *rctx = NULL;
  rctx = OCSP_REQ_CTX_new(io, maxline);
  if (!rctx)
    return NULL;
  if (!OCSP_REQ_CTX_http(rctx, "POST", path))
    goto err;
  if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
    goto err;
  return rctx;
err:
  OCSP_REQ_CTX_free(rctx);
  return NULL;
}


x86 assembly (clang, -O0):
<OCSP_sendreq_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <OCSP_REQ_CTX_new@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1187 <OCSP_sendreq_new+0x47>
movq   $0x0,-0x8(%rbp)
jmp    11ed <OCSP_sendreq_new+0xad>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe6a(%rip),%rsi
call   1060 <OCSP_REQ_CTX_http@plt>
cmp    $0x0,%eax
jne    11a9 <OCSP_sendreq_new+0x69>
jmp    11dc <OCSP_sendreq_new+0x9c>
cmpq   $0x0,-0x20(%rbp)
je     11cf <OCSP_sendreq_new+0x8f>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <OCSP_REQ_CTX_set1_req@plt>
cmp    $0x0,%eax
jne    11cf <OCSP_sendreq_new+0x8f>
jmp    11dc <OCSP_sendreq_new+0x9c>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <OCSP_sendreq_new+0xad>
mov    -0x30(%rbp),%rdi
call   1030 <OCSP_REQ_CTX_free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_sendreq_new>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %ecx,%esi
call   1040 <OCSP_REQ_CTX_new@plt>
test   %rax,%rax
je     118c <OCSP_sendreq_new+0x4c>
mov    %rax,%rbx
lea    0xe9f(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
call   1060 <OCSP_REQ_CTX_http@plt>
test   %eax,%eax
je     1184 <OCSP_sendreq_new+0x44>
test   %r14,%r14
je     118e <OCSP_sendreq_new+0x4e>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <OCSP_REQ_CTX_set1_req@plt>
test   %eax,%eax
jne    118e <OCSP_sendreq_new+0x4e>
mov    %rbx,%rdi
call   1030 <OCSP_REQ_CTX_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"POST\00"
define i32* @OCSP_sendreq_new(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32* null, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %9
%13 = call i32* @OCSP_REQ_CTX_new(i32* %11, i32 %12)
store i32* %13, i32** %10
%14 = load i32*, i32** %10
%15 = icmp ne i32* %14, null
br i1 %15, label %17, label %16
16: ; preds = %4
store i32* null, i32** %5
br label %37
17: ; preds = %4
%18 = load i32*, i32** %10
%19 = load i8*, i8** %7
%20 = call i32 @OCSP_REQ_CTX_http(i32* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %17
br label %34
23: ; preds = %17
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32*, i32** %10
%28 = load i32*, i32** %8
%29 = call i32 @OCSP_REQ_CTX_set1_req(i32* %27, i32* %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %26
br label %34
32: ; preds = %26, %23
%33 = load i32*, i32** %10
store i32* %33, i32** %5
br label %37
34: ; preds = %31, %22
%35 = load i32*, i32** %10
%36 = call i32 @OCSP_REQ_CTX_free(i32* %35)
store i32* null, i32** %5
br label %37
37: ; preds = %34, %32, %16
%38 = load i32*, i32** %5
ret i32* %38
}

LLVM IR (-O2):
@.str = [5 x i8] c"POST\00"
define i32* @OCSP_sendreq_new(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32* @OCSP_REQ_CTX_new(i32* %0, i32 %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %17, label %7
7: ; preds = %4
%8 = tail call i32 @OCSP_REQ_CTX_http(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %7
%11 = icmp eq i32* %2, null
br i1 %11, label %17, label %12
12: ; preds = %10
%13 = tail call i32 @OCSP_REQ_CTX_set1_req(i32* %5, i32* %2)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12, %7
%16 = tail call i32 @OCSP_REQ_CTX_free(i32* %5)
br label %17
17: ; preds = %10, %12, %4, %15
%18 = phi i32* [ null, %15 ], [ null, %4 ], [ %5, %12 ], [ %5, %10 ]
ret i32* %18
}