#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_in6 {
  int /*<<< orphan*/ sin6_addr;
  void *sin6_port;
  void *sin6_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ dest;

/* Variables and functions */
void *AF_INET6;
int /*<<< orphan*/ SOCK_DGRAM;
unsigned char atoi(char *);
void *htons(int);
scalar_t__ inet_pton(void *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rtl_trace(int, char *, ...);
scalar_t__ sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int socket(void *, int /*<<< orphan*/, int /*<<< orphan*/);
char *strchr(char *, char);
int ZclUdpSendMessage(char *addr, char *zdata, int zlg) {
  static int fdsend = -1;
  static int failure = 0;
  struct sockaddr_in6 srce;
  char *srceaddr = "::1";
  int srceport = 47003;
  struct sockaddr_in6 dest;
  int sendport = 47002;
  char *simul;
  unsigned char numsimul;
  unsigned char sv;
  if (failure)
    return -1;
  dest.sin6_family = AF_INET6;
  dest.sin6_port = htons(sendport);
  if (fdsend < 0) {
    srce.sin6_family = AF_INET6;
    srce.sin6_port = htons(srceport);
    if (inet_pton(AF_INET6, srceaddr, &srce.sin6_addr) <= 0) {
      failure = 1;
      rtl_trace(0, "cannot convert srceaddr '%s'\n", srceaddr);
      return -2;
    }
    fdsend = socket(AF_INET6, SOCK_DGRAM, 0);
    if (fdsend < 0) {
      failure = 1;
      rtl_trace(0, "cannot open sock srceaddr '%s'\n", srceaddr);
      return -3;
    }
  }
  numsimul = 0;
  sv = zdata[0];
  simul = strchr(addr, '@');
  if (simul) {
    numsimul = atoi(addr);
    addr = simul + 1;
    zdata[0] = numsimul;
  }
  rtl_trace(1, "send message for sensor num=%d '%s' sz=%d\n", numsimul, addr,
            zlg);
  if (inet_pton(AF_INET6, addr, &dest.sin6_addr) <= 0) {
    zdata[0] = sv;
    rtl_trace(0, "cannot convert addr '%s'\n", addr);
    return -5;
  }
  if (sendto(fdsend, zdata, zlg, 0, (struct sockaddr *)&dest, sizeof(dest)) <
      0) {
    zdata[0] = sv;
    rtl_trace(0, "cannot write to addr '%s'\n", addr);
    return -6;
  }
  zdata[0] = sv;
  return zlg;
}


x86 assembly (clang, -O0):
<ZclUdpSendMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xe73(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0xb79b,-0x44(%rbp)
movl   $0xb79a,-0x64(%rbp)
cmpl   $0x0,0x2ec2(%rip)
je     11b8 <ZclUdpSendMessage+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b4 <ZclUdpSendMessage+0x244>
mov    0x2e21(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x64(%rbp),%edi
call   1030 <htons@plt>
mov    %rax,-0x58(%rbp)
cmpl   $0x0,0x2e7f(%rip)
jge    12a0 <ZclUdpSendMessage+0x130>
mov    0x2dfa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x44(%rbp),%edi
call   1030 <htons@plt>
mov    %rax,-0x30(%rbp)
mov    0x2de0(%rip),%rax
mov    (%rax),%rdi
mov    -0x40(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1060 <inet_pton@plt>
cmp    $0x0,%rax
jg     1244 <ZclUdpSendMessage+0xd4>
movl   $0x1,0x2e44(%rip)
mov    -0x40(%rbp),%rdx
xor    %edi,%edi
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1080 <rtl_trace@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    13b4 <ZclUdpSendMessage+0x244>
mov    0x2d95(%rip),%rax
mov    (%rax),%rdi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1090 <socket@plt>
mov    %eax,0x2df4(%rip)
cmpl   $0x0,0x2ded(%rip)
jge    129b <ZclUdpSendMessage+0x12b>
movl   $0x1,0x2ded(%rip)
mov    -0x40(%rbp),%rdx
xor    %edi,%edi
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1080 <rtl_trace@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    13b4 <ZclUdpSendMessage+0x244>
jmp    12a0 <ZclUdpSendMessage+0x130>
movb   $0x0,-0x71(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x72(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1040 <strchr@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
je     12eb <ZclUdpSendMessage+0x17b>
mov    -0x10(%rbp),%rdi
call   1070 <atoi@plt>
mov    %al,-0x71(%rbp)
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x71(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x71(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edi
lea    0xd3f(%rip),%rsi
mov    $0x0,%al
call   1080 <rtl_trace@plt>
mov    0x2ccf(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1060 <inet_pton@plt>
cmp    $0x0,%rax
jg     1354 <ZclUdpSendMessage+0x1e4>
mov    -0x72(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   1080 <rtl_trace@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    13b4 <ZclUdpSendMessage+0x244>
mov    0x2cfe(%rip),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x60(%rbp),%r8
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1050 <sendto@plt>
cmp    $0x0,%rax
jge    13a5 <ZclUdpSendMessage+0x235>
mov    -0x72(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
lea    0xcf5(%rip),%rsi
mov    $0x0,%al
call   1080 <rtl_trace@plt>
movl   $0xfffffffa,-0x4(%rbp)
jmp    13b4 <ZclUdpSendMessage+0x244>
mov    -0x72(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZclUdpSendMessage>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0xffffffff,%eax
cmpb   $0x0,0x2ede(%rip)
jne    132e <ZclUdpSendMessage+0x1be>
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    0x2e40(%rip),%r12
mov    (%r12),%rax
mov    %rax,0x18(%rsp)
mov    $0xb79a,%edi
call   1030 <htons@plt>
mov    %rax,0x10(%rsp)
cmpl   $0x0,0x2e99(%rip)
js     11f7 <ZclUdpSendMessage+0x87>
mov    (%r15),%r13b
mov    %rbp,%rdi
mov    $0x40,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1277 <ZclUdpSendMessage+0x107>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1070 <atoi@plt>
add    $0x1,%rbx
mov    %al,(%r15)
movzbl %al,%edx
mov    %rbx,%rbp
jmp    1279 <ZclUdpSendMessage+0x109>
mov    (%r12),%rax
mov    %rax,0x30(%rsp)
mov    $0xb79b,%edi
call   1030 <htons@plt>
mov    %rax,0x28(%rsp)
mov    (%r12),%rdi
lea    0xde6(%rip),%rsi
lea    0x20(%rsp),%rdx
call   1060 <inet_pton@plt>
test   %rax,%rax
jle    130b <ZclUdpSendMessage+0x19b>
mov    (%r12),%rdi
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1090 <socket@plt>
mov    %eax,0x2e11(%rip)
test   %eax,%eax
jns    11c1 <ZclUdpSendMessage+0x51>
movb   $0x1,0x2e12(%rip)
lea    0xdc5(%rip),%rsi
lea    0xd9c(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1080 <rtl_trace@plt>
mov    $0xfffffffd,%eax
jmp    132e <ZclUdpSendMessage+0x1be>
xor    %edx,%edx
lea    0xdc2(%rip),%rsi
mov    $0x1,%edi
mov    %rbp,%rcx
mov    %r14d,%r8d
xor    %eax,%eax
call   1080 <rtl_trace@plt>
mov    (%r12),%rdi
lea    0x8(%rsp),%rdx
mov    %rbp,%rsi
call   1060 <inet_pton@plt>
test   %rax,%rax
jle    12ee <ZclUdpSendMessage+0x17e>
mov    0x2daa(%rip),%edi
lea    0x8(%rsp),%r8
mov    %r15,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1050 <sendto@plt>
mov    %rax,%rcx
mov    %r13b,(%r15)
mov    %r14d,%eax
test   %rcx,%rcx
jns    132e <ZclUdpSendMessage+0x1be>
lea    0xdac(%rip),%rsi
xor    %edi,%edi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <rtl_trace@plt>
mov    $0xfffffffa,%eax
jmp    132e <ZclUdpSendMessage+0x1be>
mov    %r13b,(%r15)
lea    0xd75(%rip),%rsi
xor    %edi,%edi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <rtl_trace@plt>
mov    $0xfffffffb,%eax
jmp    132e <ZclUdpSendMessage+0x1be>
movb   $0x1,0x2d56(%rip)
lea    0xceb(%rip),%rsi
lea    0xce0(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1080 <rtl_trace@plt>
mov    $0xfffffffe,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, i8*, i8* }
%struct.sockaddr = type { i32 }
@ZclUdpSendMessage.fdsend = internal global i32 -1
@ZclUdpSendMessage.failure = internal global i32 0
@.str = [4 x i8] c"::1\00"
@AF_INET6 = global i8* null
@.str.1 = [30 x i8] c"cannot convert srceaddr '%s'\0A\00"
@SOCK_DGRAM = global i32 0
@.str.2 = [32 x i8] c"cannot open sock srceaddr '%s'\0A\00"
@.str.3 = [43 x i8] c"send message for sensor num=%d '%s' sz=%d\0A\00"
@.str.4 = [26 x i8] c"cannot convert addr '%s'\0A\00"
@.str.5 = [27 x i8] c"cannot write to addr '%s'\0A\00"
define i32 @ZclUdpSendMessage(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.sockaddr_in6
%9 = alloca i8*
%10 = alloca i32
%11 = alloca %struct.sockaddr_in6
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8
%15 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %9
store i32 47003, i32* %10
store i32 47002, i32* %12
%16 = load i32, i32* @ZclUdpSendMessage.failure
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 -1, i32* %4
br label %102
19: ; preds = %3
%20 = load i8*, i8** @AF_INET6
%21 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %11, i32 0, i32 2
store i8* %20, i8** %21
%22 = load i32, i32* %12
%23 = call i8* @htons(i32 %22)
%24 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %11, i32 0, i32 1
store i8* %23, i8** %24
%25 = load i32, i32* @ZclUdpSendMessage.fdsend
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %51
27: ; preds = %19
%28 = load i8*, i8** @AF_INET6
%29 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 2
store i8* %28, i8** %29
%30 = load i32, i32* %10
%31 = call i8* @htons(i32 %30)
%32 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 1
store i8* %31, i8** %32
%33 = load i8*, i8** @AF_INET6
%34 = load i8*, i8** %9
%35 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %8, i32 0, i32 0
%36 = call i64 @inet_pton(i8* %33, i8* %34, i32* %35)
%37 = icmp sle i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %27
store i32 1, i32* @ZclUdpSendMessage.failure
%39 = load i8*, i8** %9
%40 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %39)
store i32 -2, i32* %4
br label %102
41: ; preds = %27
%42 = load i8*, i8** @AF_INET6
%43 = load i32, i32* @SOCK_DGRAM
%44 = call i32 @socket(i8* %42, i32 %43, i32 0)
store i32 %44, i32* @ZclUdpSendMessage.fdsend
%45 = load i32, i32* @ZclUdpSendMessage.fdsend
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %41
store i32 1, i32* @ZclUdpSendMessage.failure
%48 = load i8*, i8** %9
%49 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %48)
store i32 -3, i32* %4
br label %102
50: ; preds = %41
br label %51
51: ; preds = %50, %19
store i8 0, i8* %14
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 0
%54 = load i8, i8* %53
store i8 %54, i8* %15
%55 = load i8*, i8** %5
%56 = call i8* @strchr(i8* %55, i8 signext 64)
store i8* %56, i8** %13
%57 = load i8*, i8** %13
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %67
59: ; preds = %51
%60 = load i8*, i8** %5
%61 = call zeroext i8 @atoi(i8* %60)
store i8 %61, i8* %14
%62 = load i8*, i8** %13
%63 = getelementptr inbounds i8, i8* %62, i64 1
store i8* %63, i8** %5
%64 = load i8, i8* %14
%65 = load i8*, i8** %6
%66 = getelementptr inbounds i8, i8* %65, i64 0
store i8 %64, i8* %66
br label %67
67: ; preds = %59, %51
%68 = load i8, i8* %14
%69 = zext i8 %68 to i32
%70 = load i8*, i8** %5
%71 = load i32, i32* %7
%72 = call i32 (i32, i8*, ...) @rtl_trace(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %69, i8* %70, i32 %71)
%73 = load i8*, i8** @AF_INET6
%74 = load i8*, i8** %5
%75 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %11, i32 0, i32 0
%76 = call i64 @inet_pton(i8* %73, i8* %74, i32* %75)
%77 = icmp sle i64 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %67
%79 = load i8, i8* %15
%80 = load i8*, i8** %6
%81 = getelementptr inbounds i8, i8* %80, i64 0
store i8 %79, i8* %81
%82 = load i8*, i8** %5
%83 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %82)
store i32 -5, i32* %4
br label %102
84: ; preds = %67
%85 = load i32, i32* @ZclUdpSendMessage.fdsend
%86 = load i8*, i8** %6
%87 = load i32, i32* %7
%88 = bitcast %struct.sockaddr_in6* %11 to %struct.sockaddr*
%89 = call i64 @sendto(i32 %85, i8* %86, i32 %87, i32 0, %struct.sockaddr* %88, i32 24)
%90 = icmp slt i64 %89, 0
br i1 %90, label %91, label %97
91: ; preds = %84
%92 = load i8, i8* %15
%93 = load i8*, i8** %6
%94 = getelementptr inbounds i8, i8* %93, i64 0
store i8 %92, i8* %94
%95 = load i8*, i8** %5
%96 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %95)
store i32 -6, i32* %4
br label %102
97: ; preds = %84
%98 = load i8, i8* %15
%99 = load i8*, i8** %6
%100 = getelementptr inbounds i8, i8* %99, i64 0
store i8 %98, i8* %100
%101 = load i32, i32* %7
store i32 %101, i32* %4
br label %102
102: ; preds = %97, %91, %78, %47, %38, %18
%103 = load i32, i32* %4
ret i32 %103
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32, i8*, i8* }
%struct.sockaddr = type { i32 }
@ZclUdpSendMessage.fdsend = internal unnamed_addr global i32 -1
@ZclUdpSendMessage.failure = internal unnamed_addr global i1 false
@.str = [4 x i8] c"::1\00"
@AF_INET6 = global i8* null
@.str.1 = [30 x i8] c"cannot convert srceaddr '%s'\0A\00"
@SOCK_DGRAM = global i32 0
@.str.2 = [32 x i8] c"cannot open sock srceaddr '%s'\0A\00"
@.str.3 = [43 x i8] c"send message for sensor num=%d '%s' sz=%d\0A\00"
@.str.4 = [26 x i8] c"cannot convert addr '%s'\0A\00"
@.str.5 = [27 x i8] c"cannot write to addr '%s'\0A\00"
define i32 @ZclUdpSendMessage(i8* %0, i8* %1, i32 %2) {
%4 = alloca %struct.sockaddr_in6
%5 = alloca %struct.sockaddr_in6
%6 = bitcast %struct.sockaddr_in6* %4 to i8*
%7 = bitcast %struct.sockaddr_in6* %5 to i8*
%8 = load i1, i1* @ZclUdpSendMessage.failure
br i1 %8, label %59, label %9
9: ; preds = %3
%10 = load i8*, i8** @AF_INET6
%11 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %5, i64 0, i32 2
store i8* %10, i8** %11
%12 = tail call i8* @htons(i32 47002)
%13 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %5, i64 0, i32 1
store i8* %12, i8** %13
%14 = load i32, i32* @ZclUdpSendMessage.fdsend
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %34
16: ; preds = %9
%17 = load i8*, i8** @AF_INET6
%18 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %4, i64 0, i32 2
store i8* %17, i8** %18
%19 = tail call i8* @htons(i32 47003)
%20 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %4, i64 0, i32 1
store i8* %19, i8** %20
%21 = load i8*, i8** @AF_INET6
%22 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %4, i64 0, i32 0
%23 = call i64 @inet_pton(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %22)
%24 = icmp slt i64 %23, 1
br i1 %24, label %25, label %27
25: ; preds = %16
store i1 true, i1* @ZclUdpSendMessage.failure
%26 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %59
27: ; preds = %16
%28 = load i8*, i8** @AF_INET6
%29 = load i32, i32* @SOCK_DGRAM
%30 = call i32 @socket(i8* %28, i32 %29, i32 0)
store i32 %30, i32* @ZclUdpSendMessage.fdsend
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %27
store i1 true, i1* @ZclUdpSendMessage.failure
%33 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %59
34: ; preds = %27, %9
%35 = load i8, i8* %1
%36 = call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%37 = icmp eq i8* %36, null
br i1 %37, label %42, label %38
38: ; preds = %34
%39 = call zeroext i8 @atoi(i8* %0)
%40 = getelementptr inbounds i8, i8* %36, i64 1
store i8 %39, i8* %1
%41 = zext i8 %39 to i32
br label %42
42: ; preds = %38, %34
%43 = phi i8* [ %40, %38 ], [ %0, %34 ]
%44 = phi i32 [ %41, %38 ], [ 0, %34 ]
%45 = call i32 (i32, i8*, ...) @rtl_trace(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %44, i8* %43, i32 %2)
%46 = load i8*, i8** @AF_INET6
%47 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %5, i64 0, i32 0
%48 = call i64 @inet_pton(i8* %46, i8* %43, i32* %47)
%49 = icmp slt i64 %48, 1
br i1 %49, label %50, label %52
50: ; preds = %42
store i8 %35, i8* %1
%51 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %43)
br label %59
52: ; preds = %42
%53 = load i32, i32* @ZclUdpSendMessage.fdsend
%54 = bitcast %struct.sockaddr_in6* %5 to %struct.sockaddr*
%55 = call i64 @sendto(i32 %53, i8* %1, i32 %2, i32 0, %struct.sockaddr* %54, i32 24)
%56 = icmp slt i64 %55, 0
store i8 %35, i8* %1
br i1 %56, label %57, label %59
57: ; preds = %52
%58 = call i32 (i32, i8*, ...) @rtl_trace(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %43)
br label %59
59: ; preds = %52, %3, %57, %50, %32, %25
%60 = phi i32 [ -2, %25 ], [ -3, %32 ], [ -5, %50 ], [ -6, %57 ], [ -1, %3 ], [ %2, %52 ]
ret i32 %60
}