#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 const *SWIG_UnpackData(char const *, void *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
scalar_t__ strcmp(char const *, char *);
__attribute__((unused)) const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c, "NULL") == 0) {
      memset(ptr, 0, sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c, ptr, sz);
}


x86 assembly (clang, -O0):
<SWIG_UnpackDataName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     119b <SWIG_UnpackDataName+0x6b>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118e <SWIG_UnpackDataName+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b8 <SWIG_UnpackDataName+0x88>
movq   $0x0,-0x8(%rbp)
jmp    11b8 <SWIG_UnpackDataName+0x88>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <SWIG_UnpackData@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWIG_UnpackDataName>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
cmpb   $0x5f,(%rdi)
jne    1154 <SWIG_UnpackDataName+0x24>
add    $0x1,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <SWIG_UnpackData@plt>
mov    %rcx,%r14
lea    0xea2(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     116d <SWIG_UnpackDataName+0x3d>
xor    %r14d,%r14d
jmp    117a <SWIG_UnpackDataName+0x4a>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"NULL\00"
define i8* @SWIG_UnpackDataName(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 95
br i1 %13, label %14, label %24
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8*, i8** %7
%20 = load i64, i64* %8
%21 = call i32 @memset(i8* %19, i32 0, i64 %20)
%22 = load i8*, i8** %9
store i8* %22, i8** %5
br label %30
23: ; preds = %14
store i8* null, i8** %5
br label %30
24: ; preds = %4
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %6
%27 = load i8*, i8** %7
%28 = load i64, i64* %8
%29 = call i8* @SWIG_UnpackData(i8* %26, i8* %27, i64 %28)
store i8* %29, i8** %5
br label %30
30: ; preds = %24, %23, %18
%31 = load i8*, i8** %5
ret i8* %31
}

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
define i8* @SWIG_UnpackDataName(i8* %0, i8* %1, i64 %2, i8* readnone %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 95
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = tail call i32 @memset(i8* %1, i32 0, i64 %2)
br label %15
12: ; preds = %4
%13 = getelementptr inbounds i8, i8* %0, i64 1
%14 = tail call i8* @SWIG_UnpackData(i8* %13, i8* %1, i64 %2)
br label %15
15: ; preds = %7, %12, %10
%16 = phi i8* [ %3, %10 ], [ %14, %12 ], [ null, %7 ]
ret i8* %16
}