#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 */
struct sockaddr_storage {
  scalar_t__ ss_family;
};
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in6 {
  TYPE_1__ sin6_addr;
  int /*<<< orphan*/ sin6_port;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_zero;
  scalar_t__ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ serverStorage;
typedef int /*<<< orphan*/ serverAddress;

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ getpeername(int, struct sockaddr *, int *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ inet_ntop(scalar_t__, TYPE_1__ *, char *, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/, char, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char toupper(char);
int main(int argc, char **argv) {
  int udpSocket = 0, numberOfBytes = 0, port = 9999;
  char buffer[1024];
  char ipstr[INET6_ADDRSTRLEN];
  struct sockaddr_in serverAddress;
  struct sockaddr_storage serverStorage;
  socklen_t address_size;
  udpSocket = socket(PF_INET, SOCK_DGRAM, 0);
  serverAddress.sin_family = AF_INET;
  serverAddress.sin_port = htons(port);
  serverAddress.sin_addr.s_addr = inet_addr("127.0.0.1");
  memset(serverAddress.sin_zero, '\0', sizeof serverAddress.sin_zero);
  bind(udpSocket, (struct sockaddr *)&serverAddress, sizeof(serverAddress));
  address_size = sizeof(serverStorage);
  int i;
  int clientPort = 0;
  while (1) {
    numberOfBytes = recvfrom(udpSocket, buffer, 1024, 0,
                             (struct sockaddr *)&serverStorage, &address_size);
    getpeername(udpSocket, (struct sockaddr *)&serverStorage, &address_size);
    if (serverStorage.ss_family == AF_INET) {
      struct sockaddr_in *socket = (struct sockaddr_in *)&serverStorage;
      clientPort = ntohs(socket->sin_port);
      inet_ntop(AF_INET, &socket->sin_addr, ipstr, sizeof ipstr);
    } else {
      struct sockaddr_in6 *socket = (struct sockaddr_in6 *)&serverStorage;
      clientPort = ntohs(socket->sin6_port);
      inet_ntop(AF_INET6, &socket->sin6_addr, ipstr, sizeof ipstr);
    }
    printf("Peer IP address: %s\n", ipstr);
    printf("Peer port      : %d\n", clientPort);
    printf("%s:%d sent : %s\n", ipstr, clientPort, buffer);
    for (i = 0; i < numberOfBytes - 1; i++) {
      buffer[i] = toupper(buffer[i]);
    }
    sendto(udpSocket, buffer, numberOfBytes, 0,
           (struct sockaddr *)&serverStorage, address_size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x270f,-0x1c(%rbp)
mov    0x2df3(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x480(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x428(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x478(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x430(%rbp)
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
mov    0x2d9e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d93(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x438(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x444(%rbp)
lea    0xd94(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,-0x448(%rbp)
mov    -0x440(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
mov    -0x14(%rbp),%edi
lea    -0x448(%rbp),%rsi
mov    $0x18,%edx
call   10d0 <bind@plt>
movl   $0x8,-0x454(%rbp)
movl   $0x0,-0x45c(%rbp)
jmp    12b6 <main+0xf6>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
lea    -0x450(%rbp),%r8
mov    $0x400,%edx
xor    %ecx,%ecx
lea    -0x454(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x450(%rbp),%rsi
lea    -0x454(%rbp),%rdx
call   1050 <getpeername@plt>
mov    -0x450(%rbp),%rax
mov    0x2cdf(%rip),%rcx
cmp    (%rcx),%rax
jne    135a <main+0x19a>
lea    -0x450(%rbp),%rax
mov    %rax,-0x468(%rbp)
mov    -0x468(%rbp),%rax
mov    0x4(%rax),%edi
call   10c0 <ntohs@plt>
mov    -0x478(%rbp),%rdx
mov    %eax,%ecx
mov    -0x480(%rbp),%rax
mov    %ecx,-0x45c(%rbp)
mov    0x2c9c(%rip),%rcx
mov    (%rcx),%rdi
mov    -0x468(%rbp),%rsi
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
jmp    13a5 <main+0x1e5>
lea    -0x450(%rbp),%rax
mov    %rax,-0x470(%rbp)
mov    -0x470(%rbp),%rax
mov    0x4(%rax),%edi
call   10c0 <ntohs@plt>
mov    -0x478(%rbp),%rdx
mov    %eax,%ecx
mov    -0x480(%rbp),%rax
mov    %ecx,-0x45c(%rbp)
mov    0x2c3c(%rip),%rcx
mov    (%rcx),%rdi
mov    -0x470(%rbp),%rsi
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
mov    -0x478(%rbp),%rsi
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x45c(%rbp),%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x478(%rbp),%rsi
mov    -0x45c(%rbp),%edx
lea    -0x420(%rbp),%rcx
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x458(%rbp)
mov    -0x458(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1446 <main+0x286>
movslq -0x458(%rbp),%rax
movsbl -0x420(%rbp,%rax,1),%edi
ff
call   1040 <toupper@plt>
mov    %al,%cl
movslq -0x458(%rbp),%rax
mov    %cl,-0x420(%rbp,%rax,1)
mov    -0x458(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x458(%rbp)
jmp    13fa <main+0x23a>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    -0x450(%rbp),%r8
mov    -0x454(%rbp),%r9d
xor    %ecx,%ecx
call   1090 <sendto@plt>
jmp    12b1 <main+0xf1>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rax,-0x40(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,%r13d
mov    0x2dc7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    $0x270f,%edi
call   1060 <htons@plt>
mov    %eax,-0x5c(%rbp)
lea    0xdcc(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,-0x60(%rbp)
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
lea    -0x60(%rbp),%rsi
mov    %r13d,%edi
mov    $0x18,%edx
call   10d0 <bind@plt>
movl   $0x8,-0x2c(%rbp)
lea    -0x460(%rbp),%r12
lea    -0x48(%rbp),%rbx
mov    %r13d,-0x30(%rbp)
jmp    12a0 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x2c(%rbp),%r9d
mov    -0x30(%rbp),%edi
mov    %r15,%r12
mov    %r15,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
mov    %r13,%rbx
mov    %edi,%r13d
mov    %rbx,%r8
call   1090 <sendto@plt>
mov    %r13d,%edi
mov    %r12,%r15
mov    %r12,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
lea    -0x2c(%rbp),%r12
mov    %r12,%r9
call   10b0 <recvfrom@plt>
mov    %eax,%r14d
mov    %r13d,%edi
mov    %rbx,%r13
mov    %rbx,%rsi
mov    %r12,%rdx
call   1050 <getpeername@plt>
mov    -0x48(%rbp),%rdi
mov    0x2d02(%rip),%rax
mov    %rax,%rbx
cmp    (%rax),%rdi
je     12ed <main+0x12d>
mov    0x2ce3(%rip),%rbx
shr    $0x20,%rdi
call   10c0 <ntohs@plt>
mov    %eax,%r12d
mov    (%rbx),%rdi
mov    %r13,%rsi
mov    -0x38(%rbp),%rbx
mov    %rbx,%rdx
mov    -0x40(%rbp),%rcx
call   1030 <inet_ntop@plt>
lea    0xcf4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcf8(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcfc(%rip),%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0x2,%r14d
jl     1280 <main+0xc0>
lea    -0x1(%r14),%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl -0x460(%rbp,%rbx,1),%edi
ff
call   1040 <toupper@plt>
mov    %al,-0x460(%rbp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1360 <main+0x1a0>
jmp    1280 <main+0xc0>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32, i64 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr_storage = type { i64 }
%struct.sockaddr_in6 = type { %struct.TYPE_2__, i32 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@AF_INET = global i64 0
@.str = [10 x i8] c"127.0.0.1\00"
@AF_INET6 = global i64 0
@.str.1 = [21 x i8] c"Peer IP address: %s\0A\00"
@.str.2 = [21 x i8] c"Peer port : %d\0A\00"
@.str.3 = [17 x i8] c"%s:%d sent : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1024 x i8]
%10 = alloca i8*
%11 = alloca i64
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.sockaddr_storage
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca %struct.sockaddr_in*
%18 = alloca %struct.sockaddr_in6*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 9999, i32* %8
%19 = load i32, i32* @INET6_ADDRSTRLEN
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %10
%22 = alloca i8, i64 %20
store i64 %20, i64* %11
%23 = load i32, i32* @PF_INET
%24 = load i32, i32* @SOCK_DGRAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
store i32 %25, i32* %6
%26 = load i64, i64* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 3
store i64 %26, i64* %27
%28 = load i32, i32* %8
%29 = call i32 @htons(i32 %28)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
store i32 %29, i32* %30
%31 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
%33 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %32, i32 0, i32 0
store i32 %31, i32* %33
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
%35 = load i32, i32* %34
%36 = call i32 @memset(i32 %35, i8 signext 0, i32 4)
%37 = load i32, i32* %6
%38 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%39 = call i32 @bind(i32 %37, %struct.sockaddr* %38, i32 24)
store i32 8, i32* %14
store i32 0, i32* %16
br label %40
40: ; preds = %99, %2
br label %41
41: ; preds = %40
%42 = load i32, i32* %6
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%44 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%45 = call i32 @recvfrom(i32 %42, i8* %43, i32 1024, i32 0, %struct.sockaddr* %44, i32* %14)
store i32 %45, i32* %7
%46 = load i32, i32* %6
%47 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%48 = call i32 @getpeername(i32 %46, %struct.sockaddr* %47, i32* %14)
%49 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %13, i32 0, i32 0
%50 = load i64, i64* %49
%51 = load i64, i64* @AF_INET
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %64
53: ; preds = %41
%54 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr_in*
store %struct.sockaddr_in* %54, %struct.sockaddr_in** %17
%55 = load %struct.sockaddr_in*, %struct.sockaddr_in** %17
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %55, i32 0, i32 1
%57 = load i32, i32* %56
%58 = call i32 @ntohs(i32 %57)
store i32 %58, i32* %16
%59 = load i64, i64* @AF_INET
%60 = load %struct.sockaddr_in*, %struct.sockaddr_in** %17
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %60, i32 0, i32 0
%62 = trunc i64 %20 to i32
%63 = call i32 @inet_ntop(i64 %59, %struct.TYPE_2__* %61, i8* %22, i32 %62)
br label %75
64: ; preds = %41
%65 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr_in6*
store %struct.sockaddr_in6* %65, %struct.sockaddr_in6** %18
%66 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %18
%67 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %66, i32 0, i32 1
%68 = load i32, i32* %67
%69 = call i32 @ntohs(i32 %68)
store i32 %69, i32* %16
%70 = load i64, i64* @AF_INET6
%71 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %18
%72 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %71, i32 0, i32 0
%73 = trunc i64 %20 to i32
%74 = call i32 @inet_ntop(i64 %70, %struct.TYPE_2__* %72, i8* %22, i32 %73)
br label %75
75: ; preds = %64, %53
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%77 = load i32, i32* %16
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %16
%80 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %22, i32 %79, i8* %80)
store i32 0, i32* %15
br label %82
82: ; preds = %96, %75
%83 = load i32, i32* %15
%84 = load i32, i32* %7
%85 = sub nsw i32 %84, 1
%86 = icmp slt i32 %83, %85
br i1 %86, label %87, label %99
87: ; preds = %82
%88 = load i32, i32* %15
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = call signext i8 @toupper(i8 signext %91)
%93 = load i32, i32* %15
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %94
store i8 %92, i8* %95
br label %96
96: ; preds = %87
%97 = load i32, i32* %15
%98 = add nsw i32 %97, 1
store i32 %98, i32* %15
br label %82
99: ; preds = %82
%100 = load i32, i32* %6
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%102 = load i32, i32* %7
%103 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%104 = load i32, i32* %14
%105 = call i32 @sendto(i32 %100, i8* %101, i32 %102, i32 0, %struct.sockaddr* %103, i32 %104)
br label %40
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32, i64 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr_storage = type { i64 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@AF_INET = global i64 0
@.str = [10 x i8] c"127.0.0.1\00"
@AF_INET6 = global i64 0
@.str.1 = [21 x i8] c"Peer IP address: %s\0A\00"
@.str.2 = [21 x i8] c"Peer port : %d\0A\00"
@.str.3 = [17 x i8] c"%s:%d sent : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_storage
%6 = alloca i32
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @INET6_ADDRSTRLEN
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = bitcast %struct.sockaddr_in* %4 to i8*
%12 = bitcast %struct.sockaddr_storage* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = load i32, i32* @PF_INET
%15 = load i32, i32* @SOCK_DGRAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = load i64, i64* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 3
store i64 %17, i64* %18
%19 = tail call i32 @htons(i32 9999)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i32 %19, i32* %20
%21 = tail call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
store i32 %21, i32* %22
%23 = tail call i32 @memset(i32 undef, i8 signext 0, i32 4)
%24 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%25 = call i32 @bind(i32 %16, %struct.sockaddr* %24, i32 24)
store i32 8, i32* %6
%26 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
%27 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %5, i64 0, i32 0
%28 = bitcast %struct.sockaddr_storage* %5 to %struct.TYPE_2__*
br label %29
29: ; preds = %56, %2
%30 = call i32 @recvfrom(i32 %16, i8* %7, i32 1024, i32 0, %struct.sockaddr* %26, i32* %6)
%31 = call i32 @getpeername(i32 %16, %struct.sockaddr* %26, i32* %6)
%32 = load i64, i64* %27
%33 = load i64, i64* @AF_INET
%34 = icmp eq i64 %32, %33
%35 = lshr i64 %32, 32
%36 = trunc i64 %35 to i32
%37 = call i32 @ntohs(i32 %36)
%38 = load i64, i64* @AF_INET
%39 = load i64, i64* @AF_INET6
%40 = select i1 %34, i64 %38, i64 %39
%41 = call i32 @inet_ntop(i64 %40, %struct.TYPE_2__* %28, i8* %10, i32 %8)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 %37, i8* %7)
%45 = icmp sgt i32 %30, 1
br i1 %45, label %46, label %56
46: ; preds = %29
%47 = add nsw i32 %30, -1
%48 = zext i32 %47 to i64
br label %49
49: ; preds = %46, %49
%50 = phi i64 [ 0, %46 ], [ %54, %49 ]
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = call signext i8 @toupper(i8 signext %52)
store i8 %53, i8* %51
%54 = add nuw nsw i64 %50, 1
%55 = icmp eq i64 %54, %48
br i1 %55, label %56, label %49
56: ; preds = %49, %29
%57 = load i32, i32* %6
%58 = call i32 @sendto(i32 %16, i8* %7, i32 %30, i32 0, %struct.sockaddr* %26, i32 %57)
br label %29
}