#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 */
int /*<<< orphan*/ AF_INET6;
int INET6_ADDRSTRLEN;
char *inet_ntop(int /*<<< orphan*/, unsigned char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
void htable_ipv6_printer(unsigned char *key, unsigned int key_size) {
  char s[INET6_ADDRSTRLEN];
  if (key_size != 16)
    printf("Invalid key_size(%d) in htable_ipv6_printer", key_size);
  printf("%s", inet_ntop(AF_INET6, key, s, INET6_ADDRSTRLEN));
}


x86 assembly (clang, -O0):
<htable_ipv6_printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
cmpl   $0x10,-0xc(%rbp)
je     1176 <htable_ipv6_printer+0x56>
mov    -0xc(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdx
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2e5a(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
mov    %rax,%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htable_ipv6_printer>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eb4(%rip),%r15
mov    (%r15),%ecx
mov    %rsp,%rbx
mov    %rcx,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmp    $0x10,%esi
je     1161 <htable_ipv6_printer+0x41>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%ecx
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INET6_ADDRSTRLEN = global i32 0
@.str = [44 x i8] c"Invalid key_size(%d) in htable_ipv6_printer\00"
@.str.1 = [3 x i8] c"%s\00"
@AF_INET6 = global i32 0
define void @htable_ipv6_printer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* @INET6_ADDRSTRLEN
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 16
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* @AF_INET6
%18 = load i8*, i8** %3
%19 = load i32, i32* @INET6_ADDRSTRLEN
%20 = call i8* @inet_ntop(i32 %17, i8* %18, i8* %10, i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@INET6_ADDRSTRLEN = global i32 0
@.str = [44 x i8] c"Invalid key_size(%d) in htable_ipv6_printer\00"
@.str.1 = [3 x i8] c"%s\00"
@AF_INET6 = global i32 0
define void @htable_ipv6_printer(i8* %0, i32 %1) {
%3 = load i32, i32* @INET6_ADDRSTRLEN
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = icmp eq i32 %1, 16
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%9 = load i32, i32* @INET6_ADDRSTRLEN
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %9, %7 ], [ %3, %2 ]
%12 = load i32, i32* @AF_INET6
%13 = call i8* @inet_ntop(i32 %12, i8* %0, i8* %5, i32 %11)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}