#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 */

/* Variables and functions */
int /*<<< orphan*/ sock_sendto(int, char *, size_t, char *, int);
size_t strlen(char *);
int udpsock_create();
int main(int argc, char *argv[]) {
  int sfd;
  size_t buf_len;
  sfd = udpsock_create();
  char buf[100] = "hello multicast!";
  buf_len = strlen(buf);
  sock_sendto(sfd, buf, buf_len, "224.25.25.25", 3333);
  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    $0x0,%al
call   1050 <udpsock_create@plt>
mov    %eax,-0x14(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xec4(%rip),%rcx
mov    $0xd05,%r8d
call   1060 <sock_sendto@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
xor    %eax,%eax
call   1040 <udpsock_create@plt>
mov    %eax,%ebp
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xec4(%rip),%rcx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    $0xd05,%r8d
call   1050 <sock_sendto@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.buf = [100 x i8] c"hello multicast!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [13 x i8] c"224.25.25.25\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @udpsock_create()
store i32 %9, i32* %6
%10 = bitcast [100 x i8]* %8 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%12 = call i64 @strlen(i8* %11)
store i64 %12, i64* %7
%13 = load i32, i32* %6
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%15 = load i64, i64* %7
%16 = call i32 @sock_sendto(i32 %13, i8* %14, i64 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3333)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [100 x i8] c"hello multicast!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [13 x i8] c"224.25.25.25\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = tail call i32 (...) @udpsock_create()
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i64 @strlen(i8* %5)
%7 = call i32 @sock_sendto(i32 %4, i8* %5, i64 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3333)
ret i32 0
}