#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 */
struct TYPE_4__ {
  int /*<<< orphan*/ value;
};
typedef TYPE_1__ CONF_VALUE;
typedef int /*<<< orphan*/ ASN1_INTEGER;

/* Variables and functions */
int /*<<< orphan*/ X509V3_conf_err(TYPE_1__ const *);
int /*<<< orphan*/ *s2i_ASN1_INTEGER(int /*<<< orphan*/ *, int /*<<< orphan*/);
int X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint) {
  ASN1_INTEGER *itmp;
  if (!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) {
    X509V3_conf_err(value);
    return 0;
  }
  *aint = itmp;
  return 1;
}


x86 assembly (clang, -O0):
<X509V3_get_value_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <s2i_ASN1_INTEGER@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1162 <X509V3_get_value_int+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <X509V3_conf_err@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <X509V3_get_value_int+0x54>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509V3_get_value_int>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%esi
xor    %r15d,%r15d
xor    %edi,%edi
call   1030 <s2i_ASN1_INTEGER@plt>
test   %rax,%rax
je     1147 <X509V3_get_value_int+0x27>
mov    %rax,(%r14)
mov    $0x1,%r15d
jmp    114f <X509V3_get_value_int+0x2f>
mov    %rbx,%rdi
call   1040 <X509V3_conf_err@plt>
mov    %r15d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @X509V3_get_value_int(%struct.TYPE_4__* %0, i32** %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32**
%6 = alloca i32*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32** %1, i32*** %5
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32* @s2i_ASN1_INTEGER(i32* null, i32 %9)
store i32* %10, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%14 = call i32 @X509V3_conf_err(%struct.TYPE_4__* %13)
store i32 0, i32* %3
br label %18
15: ; preds = %2
%16 = load i32*, i32** %6
%17 = load i32**, i32*** %5
store i32* %16, i32** %17
store i32 1, i32* %3
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @X509V3_get_value_int(%struct.TYPE_4__* %0, i32** nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32* @s2i_ASN1_INTEGER(i32* null, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @X509V3_conf_err(%struct.TYPE_4__* %0)
br label %10
9: ; preds = %2
store i32* %5, i32** %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ 1, %9 ], [ 0, %7 ]
ret i32 %11
}