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

/* Variables and functions */
char *SWIG_PackData(char *, void *, size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
__attribute__((unused)) char *SWIG_PackDataName(char *buff, void *ptr,
                                                size_t sz, const char *name,
                                                size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2 * sz + 2 + lname) > bsz)
    return 0;
  *(r++) = '_';
  r = SWIG_PackData(r, ptr, sz);
  if (lname) {
    strncpy(r, name, lname + 1);
  } else {
    *r = 0;
  }
  return buff;
}


x86 assembly (clang, -O0):
<SWIG_PackDataName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <SWIG_PackDataName+0x41>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x48(%rbp)
jmp    117c <SWIG_PackDataName+0x4c>
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
jmp    117c <SWIG_PackDataName+0x4c>
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
add    $0x2,%rax
add    -0x40(%rbp),%rax
cmp    -0x30(%rbp),%rax
jbe    11ab <SWIG_PackDataName+0x7b>
movq   $0x0,-0x8(%rbp)
jmp    1206 <SWIG_PackDataName+0xd6>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x5f,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <SWIG_PackData@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     11f7 <SWIG_PackDataName+0xc7>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rdx
add    $0x1,%rdx
call   1040 <strncpy@plt>
jmp    11fe <SWIG_PackDataName+0xce>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWIG_PackDataName>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbp
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%r15
test   %rcx,%rcx
je     115c <SWIG_PackDataName+0x2c>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
jmp    115e <SWIG_PackDataName+0x2e>
xor    %ebx,%ebx
lea    (%rbx,%r12,2),%rax
add    $0x2,%rax
cmp    %rbp,%rax
jbe    1170 <SWIG_PackDataName+0x40>
xor    %r15d,%r15d
jmp    119f <SWIG_PackDataName+0x6f>
lea    0x1(%r15),%rdi
movb   $0x5f,(%r15)
mov    %r13,%rsi
mov    %r12,%rdx
call   1030 <SWIG_PackData@plt>
test   %rbx,%rbx
je     119c <SWIG_PackDataName+0x6c>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <strncpy@plt>
jmp    119f <SWIG_PackDataName+0x6f>
movb   $0x0,(%rax)
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @SWIG_PackDataName(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i64 %4, i64* %11
%14 = load i8*, i8** %7
store i8* %14, i8** %12
%15 = load i8*, i8** %10
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %5
%18 = load i8*, i8** %10
%19 = call i64 @strlen(i8* %18)
br label %21
20: ; preds = %5
br label %21
21: ; preds = %20, %17
%22 = phi i64 [ %19, %17 ], [ 0, %20 ]
store i64 %22, i64* %13
%23 = load i64, i64* %9
%24 = mul i64 2, %23
%25 = add i64 %24, 2
%26 = load i64, i64* %13
%27 = add i64 %25, %26
%28 = load i64, i64* %11
%29 = icmp ugt i64 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %21
store i8* null, i8** %6
br label %50
31: ; preds = %21
%32 = load i8*, i8** %12
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %12
store i8 95, i8* %32
%34 = load i8*, i8** %12
%35 = load i8*, i8** %8
%36 = load i64, i64* %9
%37 = call i8* @SWIG_PackData(i8* %34, i8* %35, i64 %36)
store i8* %37, i8** %12
%38 = load i64, i64* %13
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %31
%41 = load i8*, i8** %12
%42 = load i8*, i8** %10
%43 = load i64, i64* %13
%44 = add i64 %43, 1
%45 = call i32 @strncpy(i8* %41, i8* %42, i64 %44)
br label %48
46: ; preds = %31
%47 = load i8*, i8** %12
store i8 0, i8* %47
br label %48
48: ; preds = %46, %40
%49 = load i8*, i8** %7
store i8* %49, i8** %6
br label %50
50: ; preds = %48, %30
%51 = load i8*, i8** %6
ret i8* %51
}

LLVM IR (-O2):
define i8* @SWIG_PackDataName(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = icmp eq i8* %3, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i64 @strlen(i8* %3)
br label %9
9: ; preds = %5, %7
%10 = phi i64 [ %8, %7 ], [ 0, %5 ]
%11 = shl i64 %2, 1
%12 = add i64 %11, 2
%13 = add i64 %12, %10
%14 = icmp ugt i64 %13, %4
br i1 %14, label %23, label %15
15: ; preds = %9
%16 = getelementptr inbounds i8, i8* %0, i64 1
store i8 95, i8* %0
%17 = tail call i8* @SWIG_PackData(i8* %16, i8* %1, i64 %2)
%18 = icmp eq i64 %10, 0
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = add i64 %10, 1
%21 = tail call i32 @strncpy(i8* %17, i8* %3, i64 %20)
br label %23
22: ; preds = %15
store i8 0, i8* %17
br label %23
23: ; preds = %19, %22, %9
%24 = phi i8* [ null, %9 ], [ %0, %22 ], [ %0, %19 ]
ret i8* %24
}