#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 */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct ifreq {
  char *ifr_name;
  int /*<<< orphan*/ ifr_dstaddr;
  int /*<<< orphan*/ ifr_netmask;
  int /*<<< orphan*/ ifr_addr;
};
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int INET_ADDRSTRLEN;
int /*<<< orphan*/ SIOCGIFADDR;
int /*<<< orphan*/ SIOCGIFDSTADDR;
int /*<<< orphan*/ SIOCGIFNETMASK;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ inet_ntoa(int /*<<< orphan*/);
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strncpy(char *, char *, int);
scalar_t__ strstr(char *, char *);
int main(int argc, char **argv) {
  char netaddr[INET_ADDRSTRLEN];
  char maskaddr[INET_ADDRSTRLEN];
  char ptpaddr[INET_ADDRSTRLEN];
  int sd;
  struct ifreq ifr;
  struct sockaddr_in *sin;
  char devname[16] = {0};
  if (argc != 2) {
    printf("Usage: %s eth0/eth1/ppp10 \n", argv[0]);
    return 0;
  }
  strncpy(devname, argv[1], 16);
  sd = socket(AF_INET, SOCK_DGRAM, 0);
  strcpy(ifr.ifr_name, devname);
  memset(netaddr, 0, INET_ADDRSTRLEN);
  memset(maskaddr, 0, INET_ADDRSTRLEN);
  memset(ptpaddr, 0, INET_ADDRSTRLEN);
  if ((ioctl(sd, SIOCGIFADDR, (caddr_t)&ifr, sizeof(struct ifreq))) < 0) {
    perror("Error");
    return 0;
  }
  sin = (struct sockaddr_in *)&ifr.ifr_addr;
  strcpy(netaddr, (const char *)inet_ntoa(sin->sin_addr));
  printf("inet addr: %s\n", netaddr);
  if ((ioctl(sd, SIOCGIFNETMASK, (caddr_t)&ifr, sizeof(struct ifreq))) < 0) {
    perror("Error");
    return 0;
  }
  sin = (struct sockaddr_in *)&ifr.ifr_netmask;
  strcpy(maskaddr, (const char *)inet_ntoa(sin->sin_addr));
  printf("Mask: %s\n", maskaddr);
  if (strstr(devname, "ppp")) {
    if ((ioctl(sd, SIOCGIFDSTADDR, (caddr_t)&ifr, sizeof(struct ifreq))) < 0) {
      perror("Error");
      return 0;
    }
    sin = (struct sockaddr_in *)&ifr.ifr_dstaddr;
    strcpy(ptpaddr, (const char *)inet_ntoa(sin->sin_addr));
    printf("P-t-P: %s\n", ptpaddr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e08(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x90(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x20(%rbp)
mov    (%rax),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x88(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
je     1257 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdc1(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1474 <main+0x2e4>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
mov    0x2d4b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,-0x34(%rbp)
mov    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x90(%rbp),%rdi
mov    0x2d14(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x88(%rbp),%rdi
mov    0x2cfd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x80(%rbp),%rdi
mov    0x2ce9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x34(%rbp),%edi
mov    0x2cfe(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rax
mov    %eax,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    131d <main+0x18d>
lea    0xd17(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1474 <main+0x2e4>
lea    -0x50(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    -0x90(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    -0x90(%rbp),%rsi
lea    0xcd1(%rip),%rdi
call   1060 <printf@plt>
mov    -0x34(%rbp),%edi
mov    0x2c70(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rax
mov    %eax,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    139b <main+0x20b>
lea    0xc99(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1474 <main+0x2e4>
lea    -0x50(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    -0x88(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    -0x88(%rbp),%rsi
lea    0xc62(%rip),%rdi
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    0xc5c(%rip),%rsi
call   10a0 <strstr@plt>
cmp    $0x0,%rax
je     1466 <main+0x2d6>
mov    -0x34(%rbp),%edi
mov    0x2bf8(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rax
mov    %eax,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1433 <main+0x2a3>
lea    0xc01(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1474 <main+0x2e4>
lea    -0x50(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    -0x80(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    -0x80(%rbp),%rsi
lea    0xbde(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0x2e10(%rip),%r13
mov    0x0(%r13),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,-0x40(%rbp)
cmp    $0x2,%edi
jne    131e <main+0x18e>
mov    0x8(%rsi),%rsi
lea    -0x40(%rbp),%rdi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
mov    0x2dc7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10b0 <socket@plt>
mov    %eax,%r15d
lea    -0x40(%rbp),%rsi
call   1040 <strcpy@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x0(%r13),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x0(%r13),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
lea    -0x58(%rbp),%r13
mov    %r15d,%edi
mov    %r13d,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
test   %rax,%rax
js     133e <main+0x1ae>
mov    -0x48(%rbp),%edi
call   1050 <inet_ntoa@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0xda2(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
mov    0x2d41(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
mov    %r13d,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
test   %rax,%rax
js     133e <main+0x1ae>
mov    -0x4c(%rbp),%edi
call   1050 <inet_ntoa@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0xd6d(%rip),%rdi
mov    %r12,%rsi
call   1060 <printf@plt>
lea    0xd68(%rip),%rsi
lea    -0x40(%rbp),%rdi
call   10a0 <strstr@plt>
test   %rax,%rax
je     132d <main+0x19d>
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
mov    %r15d,%edi
mov    %r13d,%edx
mov    $0x18,%ecx
call   1080 <ioctl@plt>
test   %rax,%rax
js     133e <main+0x1ae>
mov    -0x50(%rbp),%edi
call   1050 <inet_ntoa@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0xd26(%rip),%rdi
mov    %r14,%rsi
jmp    1328 <main+0x198>
mov    (%rsi),%rsi
lea    0xcd8(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd7(%rip),%rdi
call   1090 <perror@plt>
jmp    132d <main+0x19d>

LLVM IR (-O0):
%struct.ifreq = type { i8*, i32, i32, i32 }
%struct.sockaddr_in = type { i32 }
@INET_ADDRSTRLEN = global i32 0
@.str = [28 x i8] c"Usage: %s eth0/eth1/ppp10 \0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SIOCGIFADDR = global i32 0
@.str.1 = [6 x i8] c"Error\00"
@.str.2 = [15 x i8] c"inet addr: %s\0A\00"
@SIOCGIFNETMASK = global i32 0
@.str.3 = [10 x i8] c"Mask: %s\0A\00"
@.str.4 = [4 x i8] c"ppp\00"
@SIOCGIFDSTADDR = global i32 0
@.str.5 = [11 x i8] c"P-t-P: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.ifreq
%12 = alloca %struct.sockaddr_in*
%13 = alloca [16 x i8]
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @INET_ADDRSTRLEN
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %6
%18 = alloca i8, i64 %16
store i64 %16, i64* %7
%19 = load i32, i32* @INET_ADDRSTRLEN
%20 = zext i32 %19 to i64
%21 = alloca i8, i64 %20
store i64 %20, i64* %8
%22 = load i32, i32* @INET_ADDRSTRLEN
%23 = zext i32 %22 to i64
%24 = alloca i8, i64 %23
store i64 %23, i64* %9
%25 = bitcast [16 x i8]* %13 to i8*
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 2
br i1 %27, label %28, label %33
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %31)
store i32 0, i32* %3
store i32 1, i32* %14
br label %108
33: ; preds = %2
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @strncpy(i8* %34, i8* %37, i32 16)
%39 = load i32, i32* @AF_INET
%40 = load i32, i32* @SOCK_DGRAM
%41 = call i32 @socket(i32 %39, i32 %40, i32 0)
store i32 %41, i32* %10
%42 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 0
%43 = load i8*, i8** %42
%44 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%45 = call i32 @strcpy(i8* %43, i8* %44)
%46 = load i32, i32* @INET_ADDRSTRLEN
%47 = call i32 @memset(i8* %18, i32 0, i32 %46)
%48 = load i32, i32* @INET_ADDRSTRLEN
%49 = call i32 @memset(i8* %21, i32 0, i32 %48)
%50 = load i32, i32* @INET_ADDRSTRLEN
%51 = call i32 @memset(i8* %24, i32 0, i32 %50)
%52 = load i32, i32* %10
%53 = load i32, i32* @SIOCGIFADDR
%54 = ptrtoint %struct.ifreq* %11 to i32
%55 = call i64 @ioctl(i32 %52, i32 %53, i32 %54, i32 24)
%56 = icmp slt i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %33
%58 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
store i32 1, i32* %14
br label %108
59: ; preds = %33
%60 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 3
%61 = bitcast i32* %60 to %struct.sockaddr_in*
store %struct.sockaddr_in* %61, %struct.sockaddr_in** %12
%62 = load %struct.sockaddr_in*, %struct.sockaddr_in** %12
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %62, i32 0, i32 0
%64 = load i32, i32* %63
%65 = call i64 @inet_ntoa(i32 %64)
%66 = inttoptr i64 %65 to i8*
%67 = call i32 @strcpy(i8* %18, i8* %66)
%68 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%69 = load i32, i32* %10
%70 = load i32, i32* @SIOCGIFNETMASK
%71 = ptrtoint %struct.ifreq* %11 to i32
%72 = call i64 @ioctl(i32 %69, i32 %70, i32 %71, i32 24)
%73 = icmp slt i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %59
%75 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
store i32 1, i32* %14
br label %108
76: ; preds = %59
%77 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 2
%78 = bitcast i32* %77 to %struct.sockaddr_in*
store %struct.sockaddr_in* %78, %struct.sockaddr_in** %12
%79 = load %struct.sockaddr_in*, %struct.sockaddr_in** %12
%80 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %79, i32 0, i32 0
%81 = load i32, i32* %80
%82 = call i64 @inet_ntoa(i32 %81)
%83 = inttoptr i64 %82 to i8*
%84 = call i32 @strcpy(i8* %21, i8* %83)
%85 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%86 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%87 = call i64 @strstr(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %107
89: ; preds = %76
%90 = load i32, i32* %10
%91 = load i32, i32* @SIOCGIFDSTADDR
%92 = ptrtoint %struct.ifreq* %11 to i32
%93 = call i64 @ioctl(i32 %90, i32 %91, i32 %92, i32 24)
%94 = icmp slt i64 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %89
%96 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
store i32 1, i32* %14
br label %108
97: ; preds = %89
%98 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 1
%99 = bitcast i32* %98 to %struct.sockaddr_in*
store %struct.sockaddr_in* %99, %struct.sockaddr_in** %12
%100 = load %struct.sockaddr_in*, %struct.sockaddr_in** %12
%101 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %100, i32 0, i32 0
%102 = load i32, i32* %101
%103 = call i64 @inet_ntoa(i32 %102)
%104 = inttoptr i64 %103 to i8*
%105 = call i32 @strcpy(i8* %24, i8* %104)
%106 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %24)
br label %107
107: ; preds = %97, %76
store i32 0, i32* %3
store i32 1, i32* %14
br label %108
108: ; preds = %107, %95, %74, %57, %28
%109 = load i8*, i8** %6
%110 = load i32, i32* %3
ret i32 %110
}

LLVM IR (-O2):
%struct.ifreq = type { i8*, i32, i32, i32 }
@INET_ADDRSTRLEN = global i32 0
@.str = [28 x i8] c"Usage: %s eth0/eth1/ppp10 \0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SIOCGIFADDR = global i32 0
@.str.1 = [6 x i8] c"Error\00"
@.str.2 = [15 x i8] c"inet addr: %s\0A\00"
@SIOCGIFNETMASK = global i32 0
@.str.3 = [10 x i8] c"Mask: %s\0A\00"
@.str.4 = [4 x i8] c"ppp\00"
@SIOCGIFDSTADDR = global i32 0
@.str.5 = [11 x i8] c"P-t-P: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.ifreq
%4 = alloca [16 x i8]
%5 = load i32, i32* @INET_ADDRSTRLEN
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = alloca i8, i64 %6
%9 = alloca i8, i64 %6
%10 = bitcast %struct.ifreq* %3 to i8*
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%12 = icmp eq i32 %0, 2
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %71
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strncpy(i8* %11, i8* %18, i32 16)
%20 = load i32, i32* @AF_INET
%21 = load i32, i32* @SOCK_DGRAM
%22 = call i32 @socket(i32 %20, i32 %21, i32 0)
%23 = call i32 @strcpy(i8* undef, i8* %11)
%24 = load i32, i32* @INET_ADDRSTRLEN
%25 = call i32 @memset(i8* %7, i32 0, i32 %24)
%26 = load i32, i32* @INET_ADDRSTRLEN
%27 = call i32 @memset(i8* %8, i32 0, i32 %26)
%28 = load i32, i32* @INET_ADDRSTRLEN
%29 = call i32 @memset(i8* %9, i32 0, i32 %28)
%30 = load i32, i32* @SIOCGIFADDR
%31 = ptrtoint %struct.ifreq* %3 to i64
%32 = trunc i64 %31 to i32
%33 = call i64 @ioctl(i32 %22, i32 %30, i32 %32, i32 24)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %16
%36 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %71
37: ; preds = %16
%38 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %3, i64 0, i32 3
%39 = load i32, i32* %38
%40 = call i64 @inet_ntoa(i32 %39)
%41 = inttoptr i64 %40 to i8*
%42 = call i32 @strcpy(i8* %7, i8* %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%44 = load i32, i32* @SIOCGIFNETMASK
%45 = call i64 @ioctl(i32 %22, i32 %44, i32 %32, i32 24)
%46 = icmp slt i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %37
%48 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %71
49: ; preds = %37
%50 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %3, i64 0, i32 2
%51 = load i32, i32* %50
%52 = call i64 @inet_ntoa(i32 %51)
%53 = inttoptr i64 %52 to i8*
%54 = call i32 @strcpy(i8* %8, i8* %53)
%55 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%56 = call i64 @strstr(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %71, label %58
58: ; preds = %49
%59 = load i32, i32* @SIOCGIFDSTADDR
%60 = call i64 @ioctl(i32 %22, i32 %59, i32 %32, i32 24)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %71
64: ; preds = %58
%65 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %3, i64 0, i32 1
%66 = load i32, i32* %65
%67 = call i64 @inet_ntoa(i32 %66)
%68 = inttoptr i64 %67 to i8*
%69 = call i32 @strcpy(i8* %9, i8* %68)
%70 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %9)
br label %71
71: ; preds = %49, %64, %62, %47, %35, %13
ret i32 0
}