#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int uint8_t;
struct TYPE_2__ {
  int *s6_addr;
};
struct sockaddr_in6 {
  int sin6_scope_id;
  TYPE_1__ sin6_addr;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_flags;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};
typedef int /*<<< orphan*/ hints;

/* Variables and functions */
int /*<<< orphan*/ AI_NUMERICHOST;
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char const *, int /*<<< orphan*/ *, struct addrinfo *,
                struct addrinfo **);
int if_nametoindex(char const *);
int /*<<< orphan*/ memcpy(struct sockaddr_in6 *, int /*<<< orphan*/, int);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int get_ipv6_byname(const char *name, const char *ifname, int numeric,
                    struct sockaddr_in6 *addr) {
  struct addrinfo hints, *res;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = PF_INET6;
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_flags = numeric ? AI_NUMERICHOST : 0;
  int val = getaddrinfo(name, NULL, &hints, &res);
  if (val) {
    fprintf(stderr, "%s: %s\n", name, gai_strerror(val));
    return -1;
  }
  memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in6));
  freeaddrinfo(res);
  uint8_t *ip = addr->sin6_addr.s6_addr;
  printf("node: %s\n", name);
  printf("ipv6: %x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x\n", ip[0], ip[1], ip[2],
         ip[3], ip[4], ip[5], ip[6], ip[7], ip[8], ip[9], ip[10], ip[11],
         ip[12], ip[13], ip[14], ip[15]);
  val = if_nametoindex(ifname);
  if (val == 0) {
    perror(ifname);
    return -1;
  }
  addr->sin6_scope_id = val;
  return 0;
}


x86 assembly (clang, -O0):
<get_ipv6_byname>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %edx,-0x44(%rbp)
mov    %rcx,-0x50(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2e02(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     11f6 <get_ipv6_byname+0x66>
mov    0x2df4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
jmp    1200 <get_ipv6_byname+0x70>
xor    %eax,%eax
mov    %eax,-0x7c(%rbp)
jmp    1200 <get_ipv6_byname+0x70>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x60(%rbp),%rdx
lea    -0x68(%rbp),%rcx
call   10a0 <getaddrinfo@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
je     1272 <get_ipv6_byname+0xe2>
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x6c(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    %rax,%rcx
lea    0xd9f(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    13c2 <get_ipv6_byname+0x232>
mov    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%rax
mov    (%rax),%esi
mov    $0x10,%edx
call   1080 <memcpy@plt>
mov    -0x68(%rbp),%rdi
call   10b0 <freeaddrinfo@plt>
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%rax
mov    (%rax),%esi
mov    -0x78(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x78(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x78(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x78(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x78(%rbp),%rax
mov    0x14(%rax),%eax
mov    -0x78(%rbp),%rdi
mov    0x18(%rdi),%edi
mov    %edi,-0x98(%rbp)
mov    -0x78(%rbp),%rdi
mov    0x1c(%rdi),%edi
mov    %edi,-0x94(%rbp)
mov    -0x78(%rbp),%rdi
mov    0x20(%rdi),%r13d
mov    -0x78(%rbp),%rdi
mov    0x24(%rdi),%r12d
mov    -0x78(%rbp),%rdi
mov    0x28(%rdi),%r15d
mov    -0x78(%rbp),%rdi
mov    0x2c(%rdi),%r14d
mov    -0x78(%rbp),%rdi
mov    0x30(%rdi),%ebx
mov    -0x78(%rbp),%rdi
mov    0x34(%rdi),%r11d
mov    -0x78(%rbp),%rdi
mov    0x38(%rdi),%r10d
mov    -0x78(%rbp),%rdi
mov    0x3c(%rdi),%edi
mov    %edi,-0x90(%rbp)
lea    0xcd5(%rip),%rdi
mov    %eax,(%rsp)
mov    -0x98(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x94(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x90(%rbp),%eax
mov    %r13d,0x18(%rsp)
mov    %r12d,0x20(%rsp)
mov    %r15d,0x28(%rsp)
mov    %r14d,0x30(%rsp)
mov    %ebx,0x38(%rsp)
mov    %r11d,0x40(%rsp)
mov    %r10d,0x48(%rsp)
mov    %eax,0x50(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1070 <if_nametoindex@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jne    13b2 <get_ipv6_byname+0x222>
mov    -0x40(%rbp),%rdi
call   1090 <perror@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    13c2 <get_ipv6_byname+0x232>
mov    -0x6c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ipv6_byname>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0x48(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x54(%rsp)
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x50(%rsp)
test   %ebp,%ebp
je     11e4 <get_ipv6_byname+0x54>
mov    0x2dfe(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,0x4c(%rsp)
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   10a0 <getaddrinfo@plt>
test   %eax,%eax
je     122d <get_ipv6_byname+0x9d>
mov    0x2dc3(%rip),%rcx
mov    (%rcx),%ebp
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xdeb(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1060 <fprintf@plt>
mov    $0xffffffff,%r15d
jmp    1327 <get_ipv6_byname+0x197>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
mov    $0x10,%edx
call   1080 <memcpy@plt>
mov    0x8(%rsp),%rdi
call   10b0 <freeaddrinfo@plt>
mov    0x8(%r14),%r12
lea    0xdb2(%rip),%rdi
xor    %r15d,%r15d
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r12),%esi
mov    0x4(%r12),%edx
mov    0x8(%r12),%ecx
mov    0xc(%r12),%r8d
mov    0x10(%r12),%r9d
mov    0x14(%r12),%eax
mov    %rax,0x40(%rsp)
mov    0x18(%r12),%eax
mov    %rax,0x38(%rsp)
mov    0x1c(%r12),%eax
mov    %rax,0x30(%rsp)
mov    0x20(%r12),%eax
mov    %rax,0x28(%rsp)
mov    0x24(%r12),%eax
mov    %rax,0x20(%rsp)
mov    %r14,0x10(%rsp)
mov    0x28(%r12),%eax
mov    %rax,0x18(%rsp)
mov    0x2c(%r12),%r11d
mov    0x30(%r12),%r10d
mov    %r13,%r14
mov    0x34(%r12),%r13d
mov    0x38(%r12),%ebx
mov    0x3c(%r12),%ebp
sub    $0x8,%rsp
lea    0xd2f(%rip),%rdi
xor    %eax,%eax
push   %rbp
push   %rbx
push   %r13
push   %r10
push   %r11
push   0x48(%rsp)
push   0x58(%rsp)
push   0x68(%rsp)
push   0x78(%rsp)
push   0x88(%rsp)
push   0x98(%rsp)
call   1030 <printf@plt>
add    $0x60,%rsp
mov    %r14,%rdi
call   1070 <if_nametoindex@plt>
test   %eax,%eax
je     1339 <get_ipv6_byname+0x1a9>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
mov    %r15d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%r15d
jmp    1327 <get_ipv6_byname+0x197>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32* }
%struct.addrinfo = type { i32, i32, i32, i32 }
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@AI_NUMERICHOST = global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [10 x i8] c"node: %s\0A\00"
@.str.2 = [47 x i8] c"ipv6: %x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x\0A\00"
define i32 @get_ipv6_byname(i8* %0, i8* %1, i32 %2, %struct.sockaddr_in6* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.sockaddr_in6*
%10 = alloca %struct.addrinfo
%11 = alloca %struct.addrinfo*
%12 = alloca i32
%13 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store %struct.sockaddr_in6* %3, %struct.sockaddr_in6** %9
%14 = call i32 @memset(%struct.addrinfo* %10, i32 0, i32 16)
%15 = load i32, i32* @PF_INET6
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i32 0, i32 3
store i32 %15, i32* %16
%17 = load i32, i32* @SOCK_DGRAM
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i32 0, i32 2
store i32 %17, i32* %18
%19 = load i32, i32* %8
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %4
%22 = load i32, i32* @AI_NUMERICHOST
br label %24
23: ; preds = %4
br label %24
24: ; preds = %23, %21
%25 = phi i32 [ %22, %21 ], [ 0, %23 ]
%26 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i32 0, i32 1
store i32 %25, i32* %26
%27 = load i8*, i8** %6
%28 = call i32 @getaddrinfo(i8* %27, i32* null, %struct.addrinfo* %10, %struct.addrinfo** %11)
store i32 %28, i32* %12
%29 = load i32, i32* %12
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = load i8*, i8** %6
%34 = load i32, i32* %12
%35 = call i8* @gai_strerror(i32 %34)
%36 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %33, i8* %35)
store i32 -1, i32* %5
br label %111
37: ; preds = %24
%38 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %9
%39 = load %struct.addrinfo*, %struct.addrinfo** %11
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %39, i32 0, i32 0
%41 = load i32, i32* %40
%42 = call i32 @memcpy(%struct.sockaddr_in6* %38, i32 %41, i32 16)
%43 = load %struct.addrinfo*, %struct.addrinfo** %11
%44 = call i32 @freeaddrinfo(%struct.addrinfo* %43)
%45 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %9
%46 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %45, i32 0, i32 1
%47 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %46, i32 0, i32 0
%48 = load i32*, i32** %47
store i32* %48, i32** %13
%49 = load i8*, i8** %6
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %49)
%51 = load i32*, i32** %13
%52 = getelementptr inbounds i32, i32* %51, i64 0
%53 = load i32, i32* %52
%54 = load i32*, i32** %13
%55 = getelementptr inbounds i32, i32* %54, i64 1
%56 = load i32, i32* %55
%57 = load i32*, i32** %13
%58 = getelementptr inbounds i32, i32* %57, i64 2
%59 = load i32, i32* %58
%60 = load i32*, i32** %13
%61 = getelementptr inbounds i32, i32* %60, i64 3
%62 = load i32, i32* %61
%63 = load i32*, i32** %13
%64 = getelementptr inbounds i32, i32* %63, i64 4
%65 = load i32, i32* %64
%66 = load i32*, i32** %13
%67 = getelementptr inbounds i32, i32* %66, i64 5
%68 = load i32, i32* %67
%69 = load i32*, i32** %13
%70 = getelementptr inbounds i32, i32* %69, i64 6
%71 = load i32, i32* %70
%72 = load i32*, i32** %13
%73 = getelementptr inbounds i32, i32* %72, i64 7
%74 = load i32, i32* %73
%75 = load i32*, i32** %13
%76 = getelementptr inbounds i32, i32* %75, i64 8
%77 = load i32, i32* %76
%78 = load i32*, i32** %13
%79 = getelementptr inbounds i32, i32* %78, i64 9
%80 = load i32, i32* %79
%81 = load i32*, i32** %13
%82 = getelementptr inbounds i32, i32* %81, i64 10
%83 = load i32, i32* %82
%84 = load i32*, i32** %13
%85 = getelementptr inbounds i32, i32* %84, i64 11
%86 = load i32, i32* %85
%87 = load i32*, i32** %13
%88 = getelementptr inbounds i32, i32* %87, i64 12
%89 = load i32, i32* %88
%90 = load i32*, i32** %13
%91 = getelementptr inbounds i32, i32* %90, i64 13
%92 = load i32, i32* %91
%93 = load i32*, i32** %13
%94 = getelementptr inbounds i32, i32* %93, i64 14
%95 = load i32, i32* %94
%96 = load i32*, i32** %13
%97 = getelementptr inbounds i32, i32* %96, i64 15
%98 = load i32, i32* %97
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %53, i32 %56, i32 %59, i32 %62, i32 %65, i32 %68, i32 %71, i32 %74, i32 %77, i32 %80, i32 %83, i32 %86, i32 %89, i32 %92, i32 %95, i32 %98)
%100 = load i8*, i8** %7
%101 = call i32 @if_nametoindex(i8* %100)
store i32 %101, i32* %12
%102 = load i32, i32* %12
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %37
%105 = load i8*, i8** %7
%106 = call i32 @perror(i8* %105)
store i32 -1, i32* %5
br label %111
107: ; preds = %37
%108 = load i32, i32* %12
%109 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %9
%110 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %109, i32 0, i32 0
store i32 %108, i32* %110
store i32 0, i32* %5
br label %111
111: ; preds = %107, %104, %31
%112 = load i32, i32* %5
ret i32 %112
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32* }
%struct.addrinfo = type { i32, i32, i32, i32 }
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@AI_NUMERICHOST = global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [10 x i8] c"node: %s\0A\00"
@.str.2 = [47 x i8] c"ipv6: %x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x\0A\00"
define i32 @get_ipv6_byname(i8* %0, i8* %1, i32 %2, %struct.sockaddr_in6* %3) {
%5 = alloca %struct.addrinfo
%6 = alloca %struct.addrinfo*
%7 = bitcast %struct.addrinfo* %5 to i8*
%8 = bitcast %struct.addrinfo** %6 to i8*
%9 = call i32 @memset(%struct.addrinfo* %5, i32 0, i32 16)
%10 = load i32, i32* @PF_INET6
%11 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 3
store i32 %10, i32* %11
%12 = load i32, i32* @SOCK_DGRAM
%13 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 2
store i32 %12, i32* %13
%14 = icmp eq i32 %2, 0
%15 = load i32, i32* @AI_NUMERICHOST
%16 = select i1 %14, i32 0, i32 %15
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 1
store i32 %16, i32* %17
%18 = call i32 @getaddrinfo(i8* %0, i32* null, %struct.addrinfo* %5, %struct.addrinfo** %6)
%19 = icmp eq i32 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %4
%21 = load i32, i32* @stderr
%22 = call i8* @gai_strerror(i32 %18)
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %22)
br label %72
24: ; preds = %4
%25 = load %struct.addrinfo*, %struct.addrinfo** %6
%26 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 0
%27 = load i32, i32* %26
%28 = call i32 @memcpy(%struct.sockaddr_in6* %3, i32 %27, i32 16)
%29 = load %struct.addrinfo*, %struct.addrinfo** %6
%30 = call i32 @freeaddrinfo(%struct.addrinfo* %29)
%31 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 1, i32 0
%32 = load i32*, i32** %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%34 = load i32, i32* %32
%35 = getelementptr inbounds i32, i32* %32, i64 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds i32, i32* %32, i64 2
%38 = load i32, i32* %37
%39 = getelementptr inbounds i32, i32* %32, i64 3
%40 = load i32, i32* %39
%41 = getelementptr inbounds i32, i32* %32, i64 4
%42 = load i32, i32* %41
%43 = getelementptr inbounds i32, i32* %32, i64 5
%44 = load i32, i32* %43
%45 = getelementptr inbounds i32, i32* %32, i64 6
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %32, i64 7
%48 = load i32, i32* %47
%49 = getelementptr inbounds i32, i32* %32, i64 8
%50 = load i32, i32* %49
%51 = getelementptr inbounds i32, i32* %32, i64 9
%52 = load i32, i32* %51
%53 = getelementptr inbounds i32, i32* %32, i64 10
%54 = load i32, i32* %53
%55 = getelementptr inbounds i32, i32* %32, i64 11
%56 = load i32, i32* %55
%57 = getelementptr inbounds i32, i32* %32, i64 12
%58 = load i32, i32* %57
%59 = getelementptr inbounds i32, i32* %32, i64 13
%60 = load i32, i32* %59
%61 = getelementptr inbounds i32, i32* %32, i64 14
%62 = load i32, i32* %61
%63 = getelementptr inbounds i32, i32* %32, i64 15
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %36, i32 %38, i32 %40, i32 %42, i32 %44, i32 %46, i32 %48, i32 %50, i32 %52, i32 %54, i32 %56, i32 %58, i32 %60, i32 %62, i32 %64)
%66 = call i32 @if_nametoindex(i8* %1)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %24
%69 = call i32 @perror(i8* %1)
br label %72
70: ; preds = %24
%71 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 0
store i32 %66, i32* %71
br label %72
72: ; preds = %68, %70, %20
%73 = phi i32 [ -1, %20 ], [ -1, %68 ], [ 0, %70 ]
ret i32 %73
}