#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 */
typedef char uint8_t;
typedef int uint32_t;
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
  int /*<<< orphan*/ sin6_port;
  int /*<<< orphan*/ sin6_family;
};
struct msghdr {
  int msg_controllen;
};
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ si_other;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ IPPROTO_IPV6;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ IPV6_HOPLIMIT;
int /*<<< orphan*/ IPV6_TCLASS;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
scalar_t__ create_dstopt(struct msghdr *, char *, int, int, void **);
int /*<<< orphan*/ diep(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
scalar_t__ inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ msghdr_create(struct msghdr *, struct iovec *, char *, int,
                                 char *, int, struct sockaddr_in6 *);
int /*<<< orphan*/ printf(char *, int);
int sendmsg(int, struct msghdr *, int /*<<< orphan*/);
scalar_t__ set_ancillary_attr(struct msghdr *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int main(void) {
  struct sockaddr_in6 si_other;
  uint32_t s, i, slen = sizeof(si_other);
  struct msghdr msg;
  struct iovec iov;
  uint8_t buf[512];
  uint8_t cmsgbuf[64];
  uint32_t on = 1;
  uint32_t acclen = 0;
  if ((s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) == -1)
    diep("Socket");
  memset(cmsgbuf, 0, 64);
  memset((char *)&si_other, 0, sizeof(si_other));
  si_other.sin6_family = AF_INET6;
  si_other.sin6_port = htons(9930);
  if (inet_pton(AF_INET6, "::1", &si_other.sin6_addr) == 0) {
    fprintf(stderr, "inet_aton() failed\n");
    diep("aton");
  }
  msghdr_create(&msg, &iov, buf, 512, cmsgbuf, 64, &si_other);
  uint32_t hoplimit = 5;
  acclen += set_ancillary_attr(&msg, IPPROTO_IPV6, IPV6_HOPLIMIT, &hoplimit,
                               sizeof(uint32_t));
  uint32_t tclass = 12;
  acclen += set_ancillary_attr(&msg, IPPROTO_IPV6, IPV6_TCLASS, &tclass,
                               sizeof(uint32_t));
  uint8_t ext_hdrs[32];
  void *optvals;
  memset(ext_hdrs, 0, 32);
  acclen += create_dstopt(&msg, ext_hdrs, 32, 8, &optvals);
  msg.msg_controllen = acclen;
  for (i = 0; i < 10; i++) {
    printf("Sending packet %d\n", i);
    sprintf(buf, "This is packet %d\n", i);
    if (sendmsg(s, &msg, 0) == -1)
      diep("sendto");
  }
  close(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x1c(%rbp)
movl   $0x1,-0x274(%rbp)
movl   $0x0,-0x278(%rbp)
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
mov    0x2d92(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1235 <main+0x65>
lea    0xdd0(%rip),%rdi
call   1080 <diep@plt>
lea    -0x270(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x26ca,%edi
call   1040 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rdx
lea    0xd82(%rip),%rsi
call   10b0 <inet_pton@plt>
cmp    $0x0,%rax
jne    12b5 <main+0xe5>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
lea    0xd67(%rip),%rsi
call   1090 <fprintf@plt>
lea    0xd6f(%rip),%rdi
call   1080 <diep@plt>
lea    -0x230(%rbp),%rdx
lea    -0x270(%rbp),%r8
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x200,%ecx
mov    $0x40,%r9d
lea    -0x10(%rbp),%rax
mov    %rax,(%rsp)
call   10c0 <msghdr_create@plt>
movl   $0x5,-0x27c(%rbp)
mov    0x2cc4(%rip),%rax
mov    (%rax),%esi
mov    0x2ce3(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rdi
lea    -0x27c(%rbp),%rcx
mov    $0x4,%r8d
call   10a0 <set_ancillary_attr@plt>
mov    %rax,%rcx
movslq -0x278(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x278(%rbp)
movl   $0xc,-0x280(%rbp)
mov    0x2c7f(%rip),%rax
mov    (%rax),%esi
mov    0x2c7e(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rdi
lea    -0x280(%rbp),%rcx
mov    $0x4,%r8d
call   10a0 <set_ancillary_attr@plt>
mov    %rax,%rcx
movslq -0x278(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x278(%rbp)
lea    -0x2a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x2a0(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x20,%edx
mov    $0x8,%ecx
lea    -0x2a8(%rbp),%r8
call   10e0 <create_dstopt@plt>
mov    %rax,%rcx
movslq -0x278(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x278(%rbp)
mov    -0x278(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1429 <main+0x259>
mov    -0x18(%rbp),%esi
lea    0xc4c(%rip),%rdi
call   1050 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xc49(%rip),%rsi
call   10d0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <sendmsg@plt>
cmp    $0xffffffff,%eax
jne    1416 <main+0x246>
lea    0xc39(%rip),%rdi
call   1080 <diep@plt>
jmp    141b <main+0x24b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13c4 <main+0x1f4>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
mov    0x2df0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df7(%rip),%rax
mov    (%rax),%esi
mov    0x2dae(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,%r12d
cmp    $0xffffffff,%eax
jne    1215 <main+0x45>
lea    0xdf0(%rip),%rdi
call   1080 <diep@plt>
lea    0x60(%rsp),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
lea    0x28(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x30(%rsp)
mov    $0x26ca,%edi
call   1040 <htons@plt>
mov    %eax,0x2c(%rsp)
mov    (%rbx),%edi
lea    0xdae(%rip),%rsi
mov    %r14,%rdx
call   10b0 <inet_pton@plt>
test   %rax,%rax
jne    1287 <main+0xb7>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
call   1090 <fprintf@plt>
lea    0xd9d(%rip),%rdi
call   1080 <diep@plt>
mov    %r14,(%rsp)
lea    0x10(%rsp),%r14
lea    0x20(%rsp),%rsi
lea    0xa0(%rsp),%r15
lea    0x60(%rsp),%r8
mov    %r14,%rdi
mov    %r15,%rdx
mov    $0x200,%ecx
mov    $0x40,%r9d
call   10c0 <msghdr_create@plt>
movl   $0x5,0x1c(%rsp)
mov    0x2cf1(%rip),%rbx
mov    (%rbx),%esi
mov    0x2d10(%rip),%rax
mov    (%rax),%edx
lea    0x1c(%rsp),%rcx
mov    %r14,%rdi
mov    $0x4,%r8d
call   10a0 <set_ancillary_attr@plt>
mov    %rax,%r13
movl   $0xc,0x18(%rsp)
mov    (%rbx),%esi
mov    0x2cc7(%rip),%rax
mov    (%rax),%edx
lea    0x18(%rsp),%rcx
mov    %r14,%rdi
mov    $0x4,%r8d
call   10a0 <set_ancillary_attr@plt>
mov    %rax,%rbx
add    %r13d,%ebx
lea    0x40(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    0x38(%rsp),%r8
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
mov    $0x8,%ecx
call   10e0 <create_dstopt@plt>
add    %ebx,%eax
mov    %eax,0x10(%rsp)
lea    0xcd5(%rip),%r13
lea    0xce1(%rip),%rbx
jmp    1368 <main+0x198>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0xa,%ebp
je     139f <main+0x1cf>
mov    %r13,%rdi
mov    %ebp,%esi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   10d0 <sprintf@plt>
mov    %r12d,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sendmsg@plt>
cmp    $0xffffffff,%eax
jne    1360 <main+0x190>
lea    0xcb2(%rip),%rdi
call   1080 <diep@plt>
jmp    1360 <main+0x190>
mov    %r12d,%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, i32, i32 }
%struct.msghdr = type { i32 }
%struct.iovec = type { i32 }
@AF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [7 x i8] c"Socket\00"
@.str.1 = [4 x i8] c"::1\00"
@stderr = global i32 0
@.str.2 = [20 x i8] c"inet_aton() failed\0A\00"
@.str.3 = [5 x i8] c"aton\00"
@IPPROTO_IPV6 = global i32 0
@IPV6_HOPLIMIT = global i32 0
@IPV6_TCLASS = global i32 0
@.str.4 = [19 x i8] c"Sending packet %d\0A\00"
@.str.5 = [19 x i8] c"This is packet %d\0A\00"
@.str.6 = [7 x i8] c"sendto\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in6
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.msghdr
%7 = alloca %struct.iovec
%8 = alloca [512 x i8]
%9 = alloca [64 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [32 x i8]
%15 = alloca i8*
store i32 0, i32* %1
store i32 12, i32* %5
store i32 1, i32* %10
store i32 0, i32* %11
%16 = load i32, i32* @AF_INET6
%17 = load i32, i32* @SOCK_DGRAM
%18 = load i32, i32* @IPPROTO_UDP
%19 = call i32 @socket(i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %3
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 @diep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %0
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%25 = call i32 @memset(i8* %24, i32 0, i32 64)
%26 = bitcast %struct.sockaddr_in6* %2 to i8*
%27 = call i32 @memset(i8* %26, i32 0, i32 12)
%28 = load i32, i32* @AF_INET6
%29 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %2, i32 0, i32 2
store i32 %28, i32* %29
%30 = call i32 @htons(i32 9930)
%31 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %2, i32 0, i32 1
store i32 %30, i32* %31
%32 = load i32, i32* @AF_INET6
%33 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %2, i32 0, i32 0
%34 = call i64 @inet_pton(i32 %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %23
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @diep(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %36, %23
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%43 = call i32 @msghdr_create(%struct.msghdr* %6, %struct.iovec* %7, i8* %41, i32 512, i8* %42, i32 64, %struct.sockaddr_in6* %2)
store i32 5, i32* %12
%44 = load i32, i32* @IPPROTO_IPV6
%45 = load i32, i32* @IPV6_HOPLIMIT
%46 = call i64 @set_ancillary_attr(%struct.msghdr* %6, i32 %44, i32 %45, i32* %12, i32 4)
%47 = load i32, i32* %11
%48 = sext i32 %47 to i64
%49 = add nsw i64 %48, %46
%50 = trunc i64 %49 to i32
store i32 %50, i32* %11
store i32 12, i32* %13
%51 = load i32, i32* @IPPROTO_IPV6
%52 = load i32, i32* @IPV6_TCLASS
%53 = call i64 @set_ancillary_attr(%struct.msghdr* %6, i32 %51, i32 %52, i32* %13, i32 4)
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = add nsw i64 %55, %53
%57 = trunc i64 %56 to i32
store i32 %57, i32* %11
%58 = getelementptr inbounds [32 x i8], [32 x i8]* %14, i64 0, i64 0
%59 = call i32 @memset(i8* %58, i32 0, i32 32)
%60 = getelementptr inbounds [32 x i8], [32 x i8]* %14, i64 0, i64 0
%61 = call i64 @create_dstopt(%struct.msghdr* %6, i8* %60, i32 32, i32 8, i8** %15)
%62 = load i32, i32* %11
%63 = sext i32 %62 to i64
%64 = add nsw i64 %63, %61
%65 = trunc i64 %64 to i32
store i32 %65, i32* %11
%66 = load i32, i32* %11
%67 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %6, i32 0, i32 0
store i32 %66, i32* %67
store i32 0, i32* %4
br label %68
68: ; preds = %83, %40
%69 = load i32, i32* %4
%70 = icmp slt i32 %69, 10
br i1 %70, label %71, label %86
71: ; preds = %68
%72 = load i32, i32* %4
%73 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%75 = load i32, i32* %4
%76 = call i32 @sprintf(i8* %74, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %75)
%77 = load i32, i32* %3
%78 = call i32 @sendmsg(i32 %77, %struct.msghdr* %6, i32 0)
%79 = icmp eq i32 %78, -1
br i1 %79, label %80, label %82
80: ; preds = %71
%81 = call i32 @diep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %82
82: ; preds = %80, %71
br label %83
83: ; preds = %82
%84 = load i32, i32* %4
%85 = add nsw i32 %84, 1
store i32 %85, i32* %4
br label %68
86: ; preds = %68
%87 = load i32, i32* %3
%88 = call i32 @close(i32 %87)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32, i32, i32 }
%struct.msghdr = type { i32 }
%struct.iovec = type { i32 }
@AF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [7 x i8] c"Socket\00"
@.str.1 = [4 x i8] c"::1\00"
@stderr = global i32 0
@.str.2 = [20 x i8] c"inet_aton() failed\0A\00"
@.str.3 = [5 x i8] c"aton\00"
@IPPROTO_IPV6 = global i32 0
@IPV6_HOPLIMIT = global i32 0
@IPV6_TCLASS = global i32 0
@.str.4 = [19 x i8] c"Sending packet %d\0A\00"
@.str.5 = [19 x i8] c"This is packet %d\0A\00"
@.str.6 = [7 x i8] c"sendto\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in6
%2 = alloca %struct.msghdr
%3 = alloca %struct.iovec
%4 = alloca [512 x i8]
%5 = alloca [64 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [32 x i8]
%9 = alloca i8*
%10 = bitcast %struct.sockaddr_in6* %1 to i8*
%11 = bitcast %struct.msghdr* %2 to i8*
%12 = bitcast %struct.iovec* %3 to i8*
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* @AF_INET6
%16 = load i32, i32* @SOCK_DGRAM
%17 = load i32, i32* @IPPROTO_UDP
%18 = tail call i32 @socket(i32 %15, i32 %16, i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = tail call i32 @diep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %0
%23 = call i32 @memset(i8* %14, i32 0, i32 64)
%24 = call i32 @memset(i8* %10, i32 0, i32 12)
%25 = load i32, i32* @AF_INET6
%26 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i64 0, i32 2
store i32 %25, i32* %26
%27 = call i32 @htons(i32 9930)
%28 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i64 0, i32 1
store i32 %27, i32* %28
%29 = load i32, i32* @AF_INET6
%30 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i64 0, i32 0
%31 = call i64 @inet_pton(i32 %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %30)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %22
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @diep(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %33, %22
%38 = call i32 @msghdr_create(%struct.msghdr* %2, %struct.iovec* %3, i8* %13, i32 512, i8* %14, i32 64, %struct.sockaddr_in6* %1)
%39 = bitcast i32* %6 to i8*
store i32 5, i32* %6
%40 = load i32, i32* @IPPROTO_IPV6
%41 = load i32, i32* @IPV6_HOPLIMIT
%42 = call i64 @set_ancillary_attr(%struct.msghdr* %2, i32 %40, i32 %41, i32* %6, i32 4)
%43 = bitcast i32* %7 to i8*
store i32 12, i32* %7
%44 = load i32, i32* @IPPROTO_IPV6
%45 = load i32, i32* @IPV6_TCLASS
%46 = call i64 @set_ancillary_attr(%struct.msghdr* %2, i32 %44, i32 %45, i32* %7, i32 4)
%47 = add i64 %46, %42
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%49 = bitcast i8** %9 to i8*
%50 = call i32 @memset(i8* %48, i32 0, i32 32)
%51 = call i64 @create_dstopt(%struct.msghdr* %2, i8* %48, i32 32, i32 8, i8** %9)
%52 = add i64 %47, %51
%53 = trunc i64 %52 to i32
%54 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %2, i64 0, i32 0
store i32 %53, i32* %54
br label %55
55: ; preds = %37, %63
%56 = phi i32 [ 0, %37 ], [ %64, %63 ]
%57 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %56)
%58 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %56)
%59 = call i32 @sendmsg(i32 %18, %struct.msghdr* %2, i32 0)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %63
61: ; preds = %55
%62 = call i32 @diep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %63
63: ; preds = %55, %61
%64 = add nuw nsw i32 %56, 1
%65 = icmp eq i32 %64, 10
br i1 %65, label %66, label %55
66: ; preds = %63
%67 = call i32 @close(i32 %18)
ret i32 0
}