#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*/ SXNET;
typedef int /*<<< orphan*/ ASN1_INTEGER;

/* Variables and functions */
int SXNET_add_id_INTEGER(int /*<<< orphan*/ **, int /*<<< orphan*/ *,
                         char const *, int);
int /*<<< orphan*/ X509V3_R_ERROR_CONVERTING_ZONE;
int /*<<< orphan*/ X509V3error(int /*<<< orphan*/);
int /*<<< orphan*/ *s2i_ASN1_INTEGER(int /*<<< orphan*/ *, char const *);
int SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user,
                     int userlen) {
  ASN1_INTEGER *izone = NULL;
  if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
    X509V3error(X509V3_R_ERROR_CONVERTING_ZONE);
    return 0;
  }
  return SXNET_add_id_INTEGER(psx, izone, user, userlen);
}


x86 assembly (clang, -O0):
<SXNET_add_id_asc>:
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    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <s2i_ASN1_INTEGER@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1184 <SXNET_add_id_asc+0x54>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <X509V3error@plt>
movl   $0x0,-0x4(%rbp)
jmp    119b <SXNET_add_id_asc+0x6b>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <SXNET_add_id_INTEGER@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SXNET_add_id_asc>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
call   1030 <s2i_ASN1_INTEGER@plt>
test   %rax,%rax
je     115e <SXNET_add_id_asc+0x2e>
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <SXNET_add_id_INTEGER@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <X509V3error@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@X509V3_R_ERROR_CONVERTING_ZONE = global i32 0
define i32 @SXNET_add_id_asc(i32** %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i32** %0, i32*** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* null, i32** %10
%11 = load i8*, i8** %7
%12 = call i32* @s2i_ASN1_INTEGER(i32* null, i8* %11)
store i32* %12, i32** %10
%13 = icmp ne i32* %12, null
br i1 %13, label %17, label %14
14: ; preds = %4
%15 = load i32, i32* @X509V3_R_ERROR_CONVERTING_ZONE
%16 = call i32 @X509V3error(i32 %15)
store i32 0, i32* %5
br label %23
17: ; preds = %4
%18 = load i32**, i32*** %6
%19 = load i32*, i32** %10
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = call i32 @SXNET_add_id_INTEGER(i32** %18, i32* %19, i8* %20, i32 %21)
store i32 %22, i32* %5
br label %23
23: ; preds = %17, %14
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
@X509V3_R_ERROR_CONVERTING_ZONE = global i32 0
define i32 @SXNET_add_id_asc(i32** %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32* @s2i_ASN1_INTEGER(i32* null, i8* %1)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* @X509V3_R_ERROR_CONVERTING_ZONE
%9 = tail call i32 @X509V3error(i32 %8)
br label %12
10: ; preds = %4
%11 = tail call i32 @SXNET_add_id_INTEGER(i32** %0, i32* %5, i8* %2, i32 %3)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %11, %10 ], [ 0, %7 ]
ret i32 %13
}