#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;
  int /*<<< orphan*/ *type_id;
};
typedef TYPE_1__ OTHERNAME;
typedef int /*<<< orphan*/ GENERAL_NAME;
typedef int /*<<< orphan*/ ASN1_TYPE;
typedef int /*<<< orphan*/ ASN1_OBJECT;

/* Variables and functions */
int /*<<< orphan*/ GENERAL_NAME_set0_value(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/, TYPE_1__ *);
int /*<<< orphan*/ GEN_OTHERNAME;
TYPE_1__ *OTHERNAME_new();
int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, ASN1_OBJECT *oid,
                                ASN1_TYPE *value) {
  OTHERNAME *oth;
  oth = OTHERNAME_new();
  if (!oth)
    return 0;
  oth->type_id = oid;
  oth->value = value;
  GENERAL_NAME_set0_value(gen, GEN_OTHERNAME, oth);
  return 1;
}


x86 assembly (clang, -O0):
<GENERAL_NAME_set0_othername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <OTHERNAME_new@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1156 <GENERAL_NAME_set0_othername+0x36>
movl   $0x0,-0x4(%rbp)
jmp    118a <GENERAL_NAME_set0_othername+0x6a>
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
call   1040 <GENERAL_NAME_set0_value@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GENERAL_NAME_set0_othername>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <OTHERNAME_new@plt>
test   %rax,%rax
je     115e <GENERAL_NAME_set0_othername+0x3e>
mov    %rbx,0x8(%rax)
mov    %r15,(%rax)
mov    0x2e94(%rip),%rcx
mov    (%rcx),%esi
mov    %r14,%rdi
mov    %rax,%rdx
call   1040 <GENERAL_NAME_set0_value@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32*, i32* }
@GEN_OTHERNAME = global i32 0
define i32 @GENERAL_NAME_set0_othername(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca %struct.TYPE_4__*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = call %struct.TYPE_4__* (...) @OTHERNAME_new()
store %struct.TYPE_4__* %9, %struct.TYPE_4__** %8
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%11 = icmp ne %struct.TYPE_4__* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 0, i32* %4
br label %24
13: ; preds = %3
%14 = load i32*, i32** %6
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 1
store i32* %14, i32** %16
%17 = load i32*, i32** %7
%18 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%19 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %18, i32 0, i32 0
store i32* %17, i32** %19
%20 = load i32*, i32** %5
%21 = load i32, i32* @GEN_OTHERNAME
%22 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%23 = call i32 @GENERAL_NAME_set0_value(i32* %20, i32 %21, %struct.TYPE_4__* %22)
store i32 1, i32* %4
br label %24
24: ; preds = %13, %12
%25 = load i32, i32* %4
ret i32 %25
}

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