#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 */
__attribute__((unused)) char *SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  register const unsigned char *u = (unsigned char *)ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}


x86 assembly (clang, -O0):
<SWIG_PackData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     119b <SWIG_PackData+0x9b>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
movzbl -0x29(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xeaf(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movzbl -0x29(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xe8a(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1124 <SWIG_PackData+0x24>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWIG_PackData>:
mov    %rdi,%rax
test   %rdx,%rdx
je     11a9 <SWIG_PackData+0xa9>
test   $0x1,%dl
jne    111f <SWIG_PackData+0x1f>
mov    %rsi,%r9
cmp    $0x1,%rdx
jne    1150 <SWIG_PackData+0x50>
jmp    11a9 <SWIG_PackData+0xa9>
movzbl (%rsi),%r9d
mov    %r9,%rdi
shr    $0x4,%rdi
lea    0xecf(%rip),%r8
mov    (%rdi,%r8,1),%cl
mov    %cl,(%rax)
and    $0xf,%r9d
mov    (%r9,%r8,1),%cl
mov    %cl,0x1(%rax)
add    $0x2,%rax
lea    0x1(%rsi),%r9
cmp    $0x1,%rdx
je     11a9 <SWIG_PackData+0xa9>
add    %rdx,%rsi
lea    0xea6(%rip),%r8
nopw   0x0(%rax,%rax,1)
movzbl (%r9),%edx
mov    %rdx,%rdi
shr    $0x4,%rdi
movzbl (%rdi,%r8,1),%ecx
mov    %cl,(%rax)
and    $0xf,%edx
movzbl (%rdx,%r8,1),%ecx
mov    %cl,0x1(%rax)
movzbl 0x1(%r9),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
movzbl (%rdx,%r8,1),%edx
mov    %dl,0x2(%rax)
and    $0xf,%ecx
movzbl (%rcx,%r8,1),%ecx
mov    %cl,0x3(%rax)
add    $0x4,%rax
add    $0x2,%r9
cmp    %rsi,%r9
jne    1160 <SWIG_PackData+0x60>
ret

LLVM IR (-O0):
@SWIG_PackData.hex = internal constant [17 x i8] c"0123456789abcdef\00"
define i8* @SWIG_PackData(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %5
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %8
br label %14
14: ; preds = %38, %3
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = icmp ne i8* %15, %16
br i1 %17, label %18, label %41
18: ; preds = %14
%19 = load i8*, i8** %7
%20 = load i8, i8* %19
store i8 %20, i8* %9
%21 = load i8, i8* %9
%22 = zext i8 %21 to i32
%23 = and i32 %22, 240
%24 = ashr i32 %23, 4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
store i8 %27, i8* %28
%30 = load i8, i8* %9
%31 = zext i8 %30 to i32
%32 = and i32 %31, 15
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %4
store i8 %35, i8* %36
br label %38
38: ; preds = %18
%39 = load i8*, i8** %7
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %7
br label %14
41: ; preds = %14
%42 = load i8*, i8** %4
ret i8* %42
}

LLVM IR (-O2):
@SWIG_PackData.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define i8* @SWIG_PackData(i8* writeonly %0, i8* %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = icmp eq i64 %2, 0
br i1 %5, label %58, label %6
6: ; preds = %3
%7 = and i64 %2, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %23, label %9
9: ; preds = %6
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = lshr i32 %11, 4
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %15, i8* %0
%17 = and i32 %11, 15
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %20, i8* %16
%22 = getelementptr inbounds i8, i8* %1, i64 1
br label %23
23: ; preds = %9, %6
%24 = phi i8* [ undef, %6 ], [ %21, %9 ]
%25 = phi i8* [ %0, %6 ], [ %21, %9 ]
%26 = phi i8* [ %1, %6 ], [ %22, %9 ]
%27 = icmp eq i64 %2, 1
br i1 %27, label %58, label %28
28: ; preds = %23, %28
%29 = phi i8* [ %55, %28 ], [ %25, %23 ]
%30 = phi i8* [ %56, %28 ], [ %26, %23 ]
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = lshr i32 %32, 4
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = getelementptr inbounds i8, i8* %29, i64 1
store i8 %36, i8* %29
%38 = and i32 %32, 15
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = getelementptr inbounds i8, i8* %29, i64 2
store i8 %41, i8* %37
%43 = getelementptr inbounds i8, i8* %30, i64 1
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = lshr i32 %45, 4
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %49, i8* %42
%51 = and i32 %45, 15
%52 = zext i32 %51 to i64
%53 = getelementptr inbounds [17 x i8], [17 x i8]* @SWIG_PackData.hex, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = getelementptr inbounds i8, i8* %29, i64 4
store i8 %54, i8* %50
%56 = getelementptr inbounds i8, i8* %30, i64 2
%57 = icmp eq i8* %56, %4
br i1 %57, label %58, label %28
58: ; preds = %23, %28, %3
%59 = phi i8* [ %0, %3 ], [ %24, %23 ], [ %55, %28 ]
ret i8* %59
}