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

/* Variables and functions */
int ns_name_pack(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t,
                 int /*<<< orphan*/ const **, int /*<<< orphan*/ const **);
int ns_name_pton(char const *, int /*<<< orphan*/ *, int);
int ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
                     const u_char **dnptrs, const u_char **lastdnptr) {
  u_char tmp[255];
  if (ns_name_pton(src, tmp, sizeof(tmp)) == -1) {
    return -1;
  }
  return ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr);
}


x86 assembly (clang, -O0):
<ns_name_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%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
lea    -0x430(%rbp),%rsi
mov    $0x3fc,%edx
call   1040 <ns_name_pton@plt>
cmp    $0xffffffff,%eax
jne    1169 <ns_name_compress+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <ns_name_compress+0x68>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <ns_name_pack@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_name_compress>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0x3fc,%edx
call   1040 <ns_name_pton@plt>
cmp    $0xffffffff,%eax
je     1162 <ns_name_compress+0x42>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <ns_name_pack@plt>
jmp    1167 <ns_name_compress+0x47>
mov    $0xffffffff,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @ns_name_compress(i8* %0, i32* %1, i64 %2, i32** %3, i32** %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_pton(i8* %0, i32* %8, i32 1020)
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = call i32 @ns_name_pack(i32* %8, i32* %1, i64 %2, i32** %3, i32** %4)
br label %13
13: ; preds = %5, %11
%14 = phi i32 [ %12, %11 ], [ -1, %5 ]
ret i32 %14
}