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

/* Variables and functions */
int ns_name_ntop(int /*<<< orphan*/ *, char *, size_t);
int ns_name_unpack(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ *, int);
int ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
                       char *dst, size_t dstsiz) {
  u_char tmp[255];
  int n;
  if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1) {
    return -1;
  }
  if (ns_name_ntop(tmp, dst, dstsiz) == -1) {
    return -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<ns_name_uncompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x430(%rbp),%rcx
mov    $0x3fc,%r8d
call   1030 <ns_name_unpack@plt>
mov    %eax,-0x434(%rbp)
cmp    $0xffffffff,%eax
jne    1178 <ns_name_uncompress+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    11aa <ns_name_uncompress+0x8a>
lea    -0x430(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <ns_name_ntop@plt>
cmp    $0xffffffff,%eax
jne    11a1 <ns_name_uncompress+0x81>
movl   $0xffffffff,-0x4(%rbp)
jmp    11aa <ns_name_uncompress+0x8a>
mov    -0x434(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_name_uncompress>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rsp,%rcx
mov    $0x3fc,%r8d
call   1030 <ns_name_unpack@plt>
cmp    $0xffffffff,%eax
je     115c <ns_name_uncompress+0x3c>
mov    %eax,%ebp
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <ns_name_ntop@plt>
cmp    $0xffffffff,%eax
cmove  %eax,%ebp
jmp    1161 <ns_name_uncompress+0x41>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ns_name_uncompress(i32* %0, i32* %1, i32* %2, i8* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca [255 x i32]
%13 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i8* %3, i8** %10
store i64 %4, i64* %11
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = getelementptr inbounds [255 x i32], [255 x i32]* %12, i64 0, i64 0
%18 = call i32 @ns_name_unpack(i32* %14, i32* %15, i32* %16, i32* %17, i32 1020)
store i32 %18, i32* %13
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %5
store i32 -1, i32* %6
br label %30
21: ; preds = %5
%22 = getelementptr inbounds [255 x i32], [255 x i32]* %12, i64 0, i64 0
%23 = load i8*, i8** %10
%24 = load i64, i64* %11
%25 = call i32 @ns_name_ntop(i32* %22, i8* %23, i64 %24)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 -1, i32* %6
br label %30
28: ; preds = %21
%29 = load i32, i32* %13
store i32 %29, i32* %6
br label %30
30: ; preds = %28, %27, %20
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
define i32 @ns_name_uncompress(i32* %0, i32* %1, i32* %2, i8* %3, i64 %4) {
%6 = alloca [255 x i32]
%7 = bitcast [255 x i32]* %6 to i8*
%8 = getelementptr inbounds [255 x i32], [255 x i32]* %6, i64 0, i64 0
%9 = call i32 @ns_name_unpack(i32* %0, i32* %1, i32* %2, i32* %8, i32 1020)
%10 = icmp eq i32 %9, -1
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = call i32 @ns_name_ntop(i32* %8, i8* %3, i64 %4)
%13 = icmp eq i32 %12, -1
%14 = select i1 %13, i32 -1, i32 %9
br label %15
15: ; preds = %11, %5
%16 = phi i32 [ -1, %5 ], [ %14, %11 ]
ret i32 %16
}