#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ (*seed)(void const *, int);
};
typedef TYPE_1__ RAND_METHOD;

/* Variables and functions */
TYPE_1__ *RAND_get_rand_method();
int /*<<< orphan*/ stub1(void const *, int);
void RAND_seed(const void *buf, int num) {
  const RAND_METHOD *meth = RAND_get_rand_method();
  if (meth && meth->seed)
    meth->seed(buf, num);
}


x86 assembly (clang, -O0):
<RAND_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <RAND_get_rand_method@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <RAND_seed+0x43>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1153 <RAND_seed+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_seed>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <RAND_get_rand_method@plt>
test   %rax,%rax
je     1139 <RAND_seed+0x29>
mov    (%rax),%rax
test   %rax,%rax
je     1139 <RAND_seed+0x29>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    *%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 (i8*, i32)* }
define void @RAND_seed(i8* %0, i32 %1) {
%3 = tail call %struct.TYPE_3__* (...) @RAND_get_rand_method()
%4 = icmp eq %struct.TYPE_3__* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%7 = load i32 (i8*, i32)*, i32 (i8*, i32)** %6
%8 = icmp eq i32 (i8*, i32)* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 %7(i8* %0, i32 %1)
br label %11
11: ; preds = %9, %5, %2
ret void
}