#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_port;
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  int /*<<< orphan*/ h_addr;
};
typedef int /*<<< orphan*/ sin;
typedef int /*<<< orphan*/ local_interface;
typedef int /*<<< orphan*/ enabled;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ IP_MULTICAST_IF;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int s, port, r, volume, enabled;
  struct sockaddr_in sin;
  struct in_addr local_interface;
  struct hostent *hp;
  char buf[100000];
  if (argc != 4) {
    printf("Usage : %s adresse_service port_serveur volume\n", argv[0]);
    exit(1);
  }
  port = atoi(argv[2]);
  if (port == 0) {
    fprintf(stderr, "Mauvais numero de port\n");
    exit(1);
  }
  volume = atoi(argv[3]);
  if (volume == 0 || volume > 100000) {
    fprintf(stderr, "Donnez un volume inferieur a %d octets\n", 100000);
    exit(1);
  }
  for (r = 0; r < 100000; r++)
    buf[r] = 'a';
  memset(&sin, 0, sizeof(sin));
  sin.sin_family = AF_INET;
  hp = gethostbyname(argv[1]);
  if (hp == NULL) {
    fprintf(stderr, "Erreur gethostbyaddr\n");
    exit(2);
  } else {
    memcpy(&sin.sin_addr, hp->h_addr, hp->h_length);
  }
  sin.sin_port = htons(port);
  s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  if (s == -1) {
    perror("socket");
    exit(2);
  }
  local_interface.s_addr = inet_addr("10.29.230.196");
  if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, (char *)&local_interface,
                 sizeof(local_interface)) < 0) {
    perror("Setting local interface error");
    exit(1);
  }
  enabled = 1;
  setsockopt(s, SOL_SOCKET, SO_BROADCAST, &enabled, sizeof(enabled));
  r = sendto(s, buf, volume, 0, (struct sockaddr *)&sin,
             sizeof(struct sockaddr_in));
  if (r < 0) {
    perror("Probleme sendto");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1210 <main+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdff(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    124b <main+0x7b>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1272 <main+0xa2>
cmpl   $0x186a0,-0x20(%rbp)
jle    1298 <main+0xc8>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
lea    0xdc6(%rip),%rsi
mov    $0x186a0,%edx
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x186a0,-0x1c(%rbp)
jge    12c6 <main+0xf6>
movslq -0x1c(%rbp),%rax
movb   $0x61,-0x186e0(%rbp,%rax,1)
61
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    129f <main+0xcf>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2d03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <gethostbyname@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    131f <main+0x14f>
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
call   10b0 <memcpy@plt>
mov    -0x18(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x30(%rbp)
mov    0x2c95(%rip),%rax
mov    (%rax),%edi
mov    0x2c74(%rip),%rax
mov    (%rax),%esi
mov    0x2c43(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1387 <main+0x1b7>
lea    0xd0e(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
lea    0xcff(%rip),%rdi
call   1080 <inet_addr@plt>
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2c38(%rip),%rax
mov    (%rax),%esi
mov    0x2c27(%rip),%rax
mov    (%rax),%edx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    13dc <main+0x20c>
lea    0xcce(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2bfb(%rip),%rax
mov    (%rax),%esi
mov    0x2bca(%rip),%rax
mov    (%rax),%edx
lea    -0x24(%rbp),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1030 <setsockopt@plt>
mov    -0x14(%rbp),%edi
lea    -0x186e0(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    -0x30(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1070 <sendto@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1440 <main+0x270>
lea    0xc7e(%rip),%rdi
call   10c0 <perror@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x186c8,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    1213 <main+0x43>
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
test   %eax,%eax
jne    122c <main+0x5c>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
lea    0xe2e(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    (%rbx),%rsi
lea    0xde3(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   10d0 <atoi@plt>
test   %eax,%eax
je     12a7 <main+0xd7>
mov    %eax,%r14d
cmp    $0x186a0,%eax
jg     12a7 <main+0xd7>
lea    0x20(%rsp),%rdi
mov    $0x186a0,%edx
mov    $0x61,%esi
call   1060 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2d6f(%rip),%r15
mov    (%r15),%eax
mov    %eax,0x18(%rsp)
mov    0x8(%rbx),%rdi
call   1090 <gethostbyname@plt>
test   %rax,%rax
jne    12cd <main+0xfd>
mov    0x2d23(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x186a0,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0x14(%rsp),%rdi
mov    (%rax),%edx
mov    0x4(%rax),%esi
call   10b0 <memcpy@plt>
mov    %ebp,%edi
call   1040 <htons@plt>
mov    %eax,0x10(%rsp)
mov    (%r15),%edi
mov    0x2cd7(%rip),%rax
mov    (%rax),%esi
mov    0x2ca6(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
jne    131c <main+0x14c>
lea    0xd79(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    %eax,%ebp
lea    0xd68(%rip),%rdi
call   1080 <inet_addr@plt>
mov    %eax,0x8(%rsp)
mov    0x2ca3(%rip),%rax
mov    (%rax),%esi
mov    0x2c92(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    $0x4,%r8d
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <setsockopt@plt>
test   %rax,%rax
jns    136f <main+0x19f>
lea    0xd3b(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x1,0xc(%rsp)
mov    0x2c6a(%rip),%rax
mov    (%rax),%esi
mov    0x2c39(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    $0x4,%r8d
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <setsockopt@plt>
lea    0x20(%rsp),%rsi
lea    0x10(%rsp),%r8
mov    %ebp,%edi
mov    %r14d,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1070 <sendto@plt>
test   %eax,%eax
jns    13c9 <main+0x1f9>
lea    0xcf5(%rip),%rdi
call   10c0 <perror@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [48 x i8] c"Usage : %s adresse_service port_serveur volume\0A\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"Mauvais numero de port\0A\00"
@.str.2 = [40 x i8] c"Donnez un volume inferieur a %d octets\0A\00"
@AF_INET = global i32 0
@.str.3 = [22 x i8] c"Erreur gethostbyaddr\0A\00"
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.4 = [7 x i8] c"socket\00"
@.str.5 = [14 x i8] c"10.29.230.196\00"
@IPPROTO_IP = global i32 0
@IP_MULTICAST_IF = global i32 0
@.str.6 = [30 x i8] c"Setting local interface error\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.7 = [16 x i8] c"Probleme sendto\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 i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.in_addr
%13 = alloca %struct.hostent*
%14 = alloca [100000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 4
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %23
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %9
%39 = load i32, i32* %9
%40 = icmp eq i32 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %34
%42 = load i32, i32* %9
%43 = icmp sgt i32 %42, 100000
br i1 %43, label %44, label %48
44: ; preds = %41, %34
%45 = load i32, i32* @stderr
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 100000)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %41
store i32 0, i32* %8
br label %49
49: ; preds = %56, %48
%50 = load i32, i32* %8
%51 = icmp slt i32 %50, 100000
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100000 x i8], [100000 x i8]* %14, i64 0, i64 %54
store i8 97, i8* %55
br label %56
56: ; preds = %52
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %49
59: ; preds = %49
%60 = call i32 @memset(%struct.sockaddr_in* %11, i32 0, i32 12)
%61 = load i32, i32* @AF_INET
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %61, i32* %62
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 1
%65 = load i8*, i8** %64
%66 = call %struct.hostent* @gethostbyname(i8* %65)
store %struct.hostent* %66, %struct.hostent** %13
%67 = load %struct.hostent*, %struct.hostent** %13
%68 = icmp eq %struct.hostent* %67, null
br i1 %68, label %69, label %73
69: ; preds = %59
%70 = load i32, i32* @stderr
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%72 = call i32 @exit(i32 2)
unreachable
73: ; preds = %59
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%75 = load %struct.hostent*, %struct.hostent** %13
%76 = getelementptr inbounds %struct.hostent, %struct.hostent* %75, i32 0, i32 1
%77 = load i32, i32* %76
%78 = load %struct.hostent*, %struct.hostent** %13
%79 = getelementptr inbounds %struct.hostent, %struct.hostent* %78, i32 0, i32 0
%80 = load i32, i32* %79
%81 = call i32 @memcpy(i32* %74, i32 %77, i32 %80)
br label %82
82: ; preds = %73
%83 = load i32, i32* %7
%84 = call i32 @htons(i32 %83)
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i32 %84, i32* %85
%86 = load i32, i32* @AF_INET
%87 = load i32, i32* @SOCK_DGRAM
%88 = load i32, i32* @IPPROTO_UDP
%89 = call i32 @socket(i32 %86, i32 %87, i32 %88)
store i32 %89, i32* %6
%90 = load i32, i32* %6
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %95
92: ; preds = %82
%93 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%94 = call i32 @exit(i32 2)
unreachable
95: ; preds = %82
%96 = call i32 @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%97 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %12, i32 0, i32 0
store i32 %96, i32* %97
%98 = load i32, i32* %6
%99 = load i32, i32* @IPPROTO_IP
%100 = load i32, i32* @IP_MULTICAST_IF
%101 = bitcast %struct.in_addr* %12 to i8*
%102 = call i64 (i32, i32, i32, ...) @setsockopt(i32 %98, i32 %99, i32 %100, i8* %101, i64 4)
%103 = icmp slt i64 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %95
%105 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %95
store i32 1, i32* %10
%108 = load i32, i32* %6
%109 = load i32, i32* @SOL_SOCKET
%110 = load i32, i32* @SO_BROADCAST
%111 = call i64 (i32, i32, i32, ...) @setsockopt(i32 %108, i32 %109, i32 %110, i32* %10, i64 4)
%112 = load i32, i32* %6
%113 = getelementptr inbounds [100000 x i8], [100000 x i8]* %14, i64 0, i64 0
%114 = load i32, i32* %9
%115 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%116 = call i32 @sendto(i32 %112, i8* %113, i32 %114, i32 0, %struct.sockaddr* %115, i32 12)
store i32 %116, i32* %8
%117 = load i32, i32* %8
%118 = icmp slt i32 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %107
%120 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %121
121: ; preds = %119, %107
%122 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [48 x i8] c"Usage : %s adresse_service port_serveur volume\0A\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"Mauvais numero de port\0A\00"
@.str.2 = [40 x i8] c"Donnez un volume inferieur a %d octets\0A\00"
@AF_INET = global i32 0
@.str.3 = [22 x i8] c"Erreur gethostbyaddr\0A\00"
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.4 = [7 x i8] c"socket\00"
@.str.5 = [14 x i8] c"10.29.230.196\00"
@IPPROTO_IP = global i32 0
@IP_MULTICAST_IF = global i32 0
@.str.6 = [30 x i8] c"Setting local interface error\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.7 = [16 x i8] c"Probleme sendto\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.in_addr
%6 = alloca [100000 x i8]
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%8 = bitcast i32* %3 to i8*
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast %struct.in_addr* %5 to i8*
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%12 = icmp eq i32 %0, 4
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %17
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = icmp eq i32 %29, 0
%31 = icmp sgt i32 %29, 100000
%32 = or i1 %30, %31
br i1 %32, label %41, label %33
33: ; preds = %26
%34 = call i32 @memset(%struct.sockaddr_in* %4, i32 0, i32 12)
%35 = load i32, i32* @AF_INET
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %35, i32* %36
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = call %struct.hostent* @gethostbyname(i8* %38)
%40 = icmp eq %struct.hostent* %39, null
br i1 %40, label %45, label %49
41: ; preds = %26
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 100000)
%44 = tail call i32 @exit(i32 1)
unreachable
45: ; preds = %33
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%48 = call i32 @exit(i32 2)
unreachable
49: ; preds = %33
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
%51 = getelementptr inbounds %struct.hostent, %struct.hostent* %39, i64 0, i32 1
%52 = load i32, i32* %51
%53 = getelementptr inbounds %struct.hostent, %struct.hostent* %39, i64 0, i32 0
%54 = load i32, i32* %53
%55 = call i32 @memcpy(i32* %50, i32 %52, i32 %54)
%56 = call i32 @htons(i32 %20)
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %56, i32* %57
%58 = load i32, i32* @AF_INET
%59 = load i32, i32* @SOCK_DGRAM
%60 = load i32, i32* @IPPROTO_UDP
%61 = call i32 @socket(i32 %58, i32 %59, i32 %60)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %66
63: ; preds = %49
%64 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%65 = call i32 @exit(i32 2)
unreachable
66: ; preds = %49
%67 = call i32 @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%68 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i64 0, i32 0
store i32 %67, i32* %68
%69 = load i32, i32* @IPPROTO_IP
%70 = load i32, i32* @IP_MULTICAST_IF
%71 = call i64 (i32, i32, i32, ...) @setsockopt(i32 %61, i32 %69, i32 %70, %struct.in_addr* %5, i64 4)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %66
%74 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %66
store i32 1, i32* %3
%77 = load i32, i32* @SOL_SOCKET
%78 = load i32, i32* @SO_BROADCAST
%79 = call i64 (i32, i32, i32, ...) @setsockopt(i32 %61, i32 %77, i32 %78, i32* %3, i64 4)
%80 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%81 = call i32 @sendto(i32 %61, i8* %11, i32 %29, i32 0, %struct.sockaddr* %80, i32 12)
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %76
%84 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %85
85: ; preds = %83, %76
%86 = call i32 @exit(i32 0)
unreachable
}