#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*/ int16_t;

/* Variables and functions */
size_t _vbidata_init(int /*<<< orphan*/ *, unsigned int, unsigned int,
                     int /*<<< orphan*/, int, double);
int /*<<< orphan*/ *malloc(size_t);
int16_t *vbidata_init(unsigned int swidth, unsigned int dwidth, int16_t level,
                      int filter, double beta) {
  size_t l;
  int16_t *s;
  l = _vbidata_init(NULL, swidth, dwidth, level, filter, beta);
  s = malloc(l);
  if (!s) {
    return (NULL);
  }
  _vbidata_init(s, swidth, dwidth, level, filter, beta);
  return (s);
}


x86 assembly (clang, -O0):
<vbidata_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%edi
call   1030 <_vbidata_init@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    117d <vbidata_init+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    11a0 <vbidata_init+0x80>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
call   1030 <_vbidata_init@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbidata_init>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
xor    %edi,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
movsd  %xmm0,0x8(%rsp)
call   1030 <_vbidata_init@plt>
mov    %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1178 <vbidata_init+0x58>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
movsd  0x8(%rsp),%xmm0
call   1030 <_vbidata_init@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @vbidata_init(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca i64
%13 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load double, double* %11
%19 = call i64 @_vbidata_init(i32* null, i32 %14, i32 %15, i32 %16, i32 %17, double %18)
store i64 %19, i64* %12
%20 = load i64, i64* %12
%21 = call i32* @malloc(i64 %20)
store i32* %21, i32** %13
%22 = load i32*, i32** %13
%23 = icmp ne i32* %22, null
br i1 %23, label %25, label %24
24: ; preds = %5
store i32* null, i32** %6
br label %34
25: ; preds = %5
%26 = load i32*, i32** %13
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = load double, double* %11
%32 = call i64 @_vbidata_init(i32* %26, i32 %27, i32 %28, i32 %29, i32 %30, double %31)
%33 = load i32*, i32** %13
store i32* %33, i32** %6
br label %34
34: ; preds = %25, %24
%35 = load i32*, i32** %6
ret i32* %35
}

LLVM IR (-O2):
define i32* @vbidata_init(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = tail call i64 @_vbidata_init(i32* null, i32 %0, i32 %1, i32 %2, i32 %3, double %4)
%7 = tail call i32* @malloc(i64 %6)
%8 = icmp eq i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i64 @_vbidata_init(i32* %7, i32 %0, i32 %1, i32 %2, i32 %3, double %4)
br label %11
11: ; preds = %5, %9
ret i32* %7
}