#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 int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ addCallback_packet;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
int murmur_connect(char const *);
int sock_read(int, unsigned char *, int);
int sock_write(int, unsigned char const *, int);
int /*<<< orphan*/ stderr;
bool add_murmur_callbacks(const char *port) {
  uint16_t listener_port = htons(65535);
  unsigned char *listener_port_bytes = (unsigned char *)&listener_port;
  unsigned char read_buffer[512];
  int murm_callbackfd, status = false;
  const unsigned char addCallback_packet[] = {0x49,
                                              0x63,
                                              0x65,
                                              0x50,
                                              0x01,
                                              0x00,
                                              0x01,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x70,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x02,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x01,
                                              0x31,
                                              0x01,
                                              0x73,
                                              0x00,
                                              0x0b,
                                              0x61,
                                              0x64,
                                              0x64,
                                              0x43,
                                              0x61,
                                              0x6c,
                                              0x6c,
                                              0x62,
                                              0x61,
                                              0x63,
                                              0x6b,
                                              0x00,
                                              0x00,
                                              0x4b,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x01,
                                              0x00,
                                              0x24,
                                              0x34,
                                              0x45,
                                              0x35,
                                              0x42,
                                              0x38,
                                              0x42,
                                              0x31,
                                              0x37,
                                              0x2d,
                                              0x44,
                                              0x43,
                                              0x33,
                                              0x38,
                                              0x2d,
                                              0x34,
                                              0x31,
                                              0x42,
                                              0x38,
                                              0x2d,
                                              0x39,
                                              0x45,
                                              0x30,
                                              0x45,
                                              0x2d,
                                              0x35,
                                              0x44,
                                              0x34,
                                              0x41,
                                              0x43,
                                              0x43,
                                              0x30,
                                              0x42,
                                              0x30,
                                              0x37,
                                              0x46,
                                              0x46,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x01,
                                              0x01,
                                              0x00,
                                              0x19,
                                              0x00,
                                              0x00,
                                              0x00,
                                              0x01,
                                              0x00,
                                              0x09,
                                              0x31,
                                              0x32,
                                              0x37,
                                              0x2e,
                                              0x30,
                                              0x2e,
                                              0x30,
                                              0x2e,
                                              0x31,
                                              listener_port_bytes[1],
                                              listener_port_bytes[0],
                                              0x00,
                                              0x00,
                                              0xff,
                                              0xff,
                                              0xff,
                                              0xff,
                                              0x00};
  murm_callbackfd = murmur_connect(port);
  if (murm_callbackfd < 0)
    return false;
  if (sock_write(murm_callbackfd, addCallback_packet,
                 sizeof(addCallback_packet)) != sizeof(addCallback_packet)) {
    fprintf(stderr, "Error: Failed to send addCallback_packet\n");
    goto cleanup;
  }
  if (sock_read(murm_callbackfd, read_buffer, 512) != 25) {
    fprintf(stderr,
            "Error: Failed to receive addCallback_packet success reply\n");
    goto cleanup;
  }
  status = true;
cleanup:
  close(murm_callbackfd);
  return status;
}


x86 assembly (clang, -O0):
<add_murmur_callbacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xffff,%edi
call   1040 <htons@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x228(%rbp)
movb   $0x49,-0x2a0(%rbp)
movb   $0x63,-0x29f(%rbp)
movb   $0x65,-0x29e(%rbp)
movb   $0x50,-0x29d(%rbp)
movb   $0x1,-0x29c(%rbp)
movb   $0x0,-0x29b(%rbp)
movb   $0x1,-0x29a(%rbp)
movb   $0x0,-0x299(%rbp)
movb   $0x0,-0x298(%rbp)
movb   $0x0,-0x297(%rbp)
movb   $0x70,-0x296(%rbp)
movb   $0x0,-0x295(%rbp)
movb   $0x0,-0x294(%rbp)
movb   $0x0,-0x293(%rbp)
movb   $0x2,-0x292(%rbp)
movb   $0x0,-0x291(%rbp)
movb   $0x0,-0x290(%rbp)
movb   $0x0,-0x28f(%rbp)
movb   $0x1,-0x28e(%rbp)
movb   $0x31,-0x28d(%rbp)
movb   $0x1,-0x28c(%rbp)
movb   $0x73,-0x28b(%rbp)
movb   $0x0,-0x28a(%rbp)
movb   $0xb,-0x289(%rbp)
movb   $0x61,-0x288(%rbp)
movb   $0x64,-0x287(%rbp)
movb   $0x64,-0x286(%rbp)
movb   $0x43,-0x285(%rbp)
movb   $0x61,-0x284(%rbp)
movb   $0x6c,-0x283(%rbp)
movb   $0x6c,-0x282(%rbp)
movb   $0x62,-0x281(%rbp)
movb   $0x61,-0x280(%rbp)
movb   $0x63,-0x27f(%rbp)
movb   $0x6b,-0x27e(%rbp)
movb   $0x0,-0x27d(%rbp)
movb   $0x0,-0x27c(%rbp)
movb   $0x4b,-0x27b(%rbp)
movb   $0x0,-0x27a(%rbp)
movb   $0x0,-0x279(%rbp)
movb   $0x0,-0x278(%rbp)
movb   $0x1,-0x277(%rbp)
movb   $0x0,-0x276(%rbp)
movb   $0x24,-0x275(%rbp)
movb   $0x34,-0x274(%rbp)
movb   $0x45,-0x273(%rbp)
movb   $0x35,-0x272(%rbp)
movb   $0x42,-0x271(%rbp)
movb   $0x38,-0x270(%rbp)
movb   $0x42,-0x26f(%rbp)
movb   $0x31,-0x26e(%rbp)
movb   $0x37,-0x26d(%rbp)
movb   $0x2d,-0x26c(%rbp)
movb   $0x44,-0x26b(%rbp)
movb   $0x43,-0x26a(%rbp)
movb   $0x33,-0x269(%rbp)
movb   $0x38,-0x268(%rbp)
movb   $0x2d,-0x267(%rbp)
movb   $0x34,-0x266(%rbp)
movb   $0x31,-0x265(%rbp)
movb   $0x42,-0x264(%rbp)
movb   $0x38,-0x263(%rbp)
movb   $0x2d,-0x262(%rbp)
movb   $0x39,-0x261(%rbp)
movb   $0x45,-0x260(%rbp)
movb   $0x30,-0x25f(%rbp)
movb   $0x45,-0x25e(%rbp)
movb   $0x2d,-0x25d(%rbp)
movb   $0x35,-0x25c(%rbp)
movb   $0x44,-0x25b(%rbp)
movb   $0x34,-0x25a(%rbp)
movb   $0x41,-0x259(%rbp)
movb   $0x43,-0x258(%rbp)
movb   $0x43,-0x257(%rbp)
movb   $0x30,-0x256(%rbp)
movb   $0x42,-0x255(%rbp)
movb   $0x30,-0x254(%rbp)
movb   $0x37,-0x253(%rbp)
movb   $0x46,-0x252(%rbp)
movb   $0x46,-0x251(%rbp)
movb   $0x0,-0x250(%rbp)
movb   $0x0,-0x24f(%rbp)
movb   $0x0,-0x24e(%rbp)
movb   $0x0,-0x24d(%rbp)
movb   $0x1,-0x24c(%rbp)
movb   $0x1,-0x24b(%rbp)
movb   $0x0,-0x24a(%rbp)
movb   $0x19,-0x249(%rbp)
movb   $0x0,-0x248(%rbp)
movb   $0x0,-0x247(%rbp)
movb   $0x0,-0x246(%rbp)
movb   $0x1,-0x245(%rbp)
movb   $0x0,-0x244(%rbp)
movb   $0x9,-0x243(%rbp)
movb   $0x31,-0x242(%rbp)
movb   $0x32,-0x241(%rbp)
movb   $0x37,-0x240(%rbp)
movb   $0x2e,-0x23f(%rbp)
movb   $0x30,-0x23e(%rbp)
movb   $0x2e,-0x23d(%rbp)
movb   $0x30,-0x23c(%rbp)
movb   $0x2e,-0x23b(%rbp)
movb   $0x31,-0x23a(%rbp)
mov    -0x20(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x239(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x238(%rbp)
movb   $0x0,-0x237(%rbp)
movb   $0x0,-0x236(%rbp)
movb   $0xff,-0x235(%rbp)
movb   $0xff,-0x234(%rbp)
movb   $0xff,-0x233(%rbp)
movb   $0xff,-0x232(%rbp)
movb   $0x0,-0x231(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <murmur_connect@plt>
mov    %eax,-0x224(%rbp)
cmpl   $0x0,-0x224(%rbp)
jge    14d1 <add_murmur_callbacks+0x371>
movl   $0x0,-0x4(%rbp)
jmp    1566 <add_murmur_callbacks+0x406>
mov    -0x224(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
mov    $0x70,%edx
call   1070 <sock_write@plt>
cltq
cmp    $0x70,%rax
je     150e <add_murmur_callbacks+0x3ae>
mov    0x2ae5(%rip),%rax
mov    (%rax),%edi
lea    0xafc(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1552 <add_murmur_callbacks+0x3f2>
mov    -0x224(%rbp),%edi
lea    -0x220(%rbp),%rsi
mov    $0x200,%edx
call   1080 <sock_read@plt>
cmp    $0x19,%eax
je     1548 <add_murmur_callbacks+0x3e8>
mov    0x2aab(%rip),%rax
mov    (%rax),%edi
lea    0xaec(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1552 <add_murmur_callbacks+0x3f2>
movl   $0x1,-0x228(%rbp)
mov    -0x224(%rbp),%edi
call   1050 <close@plt>
mov    -0x228(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_murmur_callbacks>:
push   %rbp
push   %rbx
sub    $0x278,%rsp
mov    %rdi,%rbx
mov    $0xffff,%edi
call   1040 <htons@plt>
movaps 0xe83(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movl   $0x0,0x50(%rsp)
movaps 0xe90(%rip),%xmm0
movups %xmm0,0x54(%rsp)
movw   $0x2e30,0x64(%rsp)
movb   $0x31,0x66(%rsp)
mov    %ah,0x67(%rsp)
mov    %al,0x68(%rsp)
movw   $0x0,0x69(%rsp)
movl   $0xffffffff,0x6b(%rsp)
ff
movb   $0x0,0x6f(%rsp)
mov    %rbx,%rdi
call   1030 <murmur_connect@plt>
test   %eax,%eax
js     1233 <add_murmur_callbacks+0xd3>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x70,%edx
call   1070 <sock_write@plt>
cmp    $0x70,%eax
jne    1237 <add_murmur_callbacks+0xd7>
lea    0x70(%rsp),%rsi
mov    %ebx,%edi
mov    $0x200,%edx
call   1080 <sock_read@plt>
mov    $0x1,%ebp
cmp    $0x19,%eax
je     124e <add_murmur_callbacks+0xee>
lea    0xe59(%rip),%rsi
jmp    123e <add_murmur_callbacks+0xde>
xor    %ebp,%ebp
jmp    1255 <add_murmur_callbacks+0xf5>
lea    0xe22(%rip),%rsi
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
call   1060 <fprintf@plt>
xor    %ebp,%ebp
mov    %ebx,%edi
call   1050 <close@plt>
mov    %ebp,%eax
add    $0x278,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error: Failed to send addCallback_packet\0A\00"
@.str.1 = [59 x i8] c"Error: Failed to receive addCallback_packet success reply\0A\00"
define i32 @add_murmur_callbacks(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [512 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca [112 x i8]
store i8* %0, i8** %3
%10 = call i32 @htons(i32 65535)
store i32 %10, i32* %4
%11 = bitcast i32* %4 to i8*
store i8* %11, i8** %5
store i32 0, i32* %8
%12 = getelementptr inbounds [112 x i8], [112 x i8]* %9, i64 0, i64 0
store i8 73, i8* %12
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 99, i8* %13
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 101, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 80, i8* %15
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 1, i8* %16
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 0, i8* %17
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 1, i8* %18
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 0, i8* %19
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 0, i8* %20
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 0, i8* %21
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 112, i8* %22
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 0, i8* %23
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 0, i8* %24
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 0, i8* %25
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8 2, i8* %26
%27 = getelementptr inbounds i8, i8* %26, i64 1
store i8 0, i8* %27
%28 = getelementptr inbounds i8, i8* %27, i64 1
store i8 0, i8* %28
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 0, i8* %29
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8 1, i8* %30
%31 = getelementptr inbounds i8, i8* %30, i64 1
store i8 49, i8* %31
%32 = getelementptr inbounds i8, i8* %31, i64 1
store i8 1, i8* %32
%33 = getelementptr inbounds i8, i8* %32, i64 1
store i8 115, i8* %33
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8 0, i8* %34
%35 = getelementptr inbounds i8, i8* %34, i64 1
store i8 11, i8* %35
%36 = getelementptr inbounds i8, i8* %35, i64 1
store i8 97, i8* %36
%37 = getelementptr inbounds i8, i8* %36, i64 1
store i8 100, i8* %37
%38 = getelementptr inbounds i8, i8* %37, i64 1
store i8 100, i8* %38
%39 = getelementptr inbounds i8, i8* %38, i64 1
store i8 67, i8* %39
%40 = getelementptr inbounds i8, i8* %39, i64 1
store i8 97, i8* %40
%41 = getelementptr inbounds i8, i8* %40, i64 1
store i8 108, i8* %41
%42 = getelementptr inbounds i8, i8* %41, i64 1
store i8 108, i8* %42
%43 = getelementptr inbounds i8, i8* %42, i64 1
store i8 98, i8* %43
%44 = getelementptr inbounds i8, i8* %43, i64 1
store i8 97, i8* %44
%45 = getelementptr inbounds i8, i8* %44, i64 1
store i8 99, i8* %45
%46 = getelementptr inbounds i8, i8* %45, i64 1
store i8 107, i8* %46
%47 = getelementptr inbounds i8, i8* %46, i64 1
store i8 0, i8* %47
%48 = getelementptr inbounds i8, i8* %47, i64 1
store i8 0, i8* %48
%49 = getelementptr inbounds i8, i8* %48, i64 1
store i8 75, i8* %49
%50 = getelementptr inbounds i8, i8* %49, i64 1
store i8 0, i8* %50
%51 = getelementptr inbounds i8, i8* %50, i64 1
store i8 0, i8* %51
%52 = getelementptr inbounds i8, i8* %51, i64 1
store i8 0, i8* %52
%53 = getelementptr inbounds i8, i8* %52, i64 1
store i8 1, i8* %53
%54 = getelementptr inbounds i8, i8* %53, i64 1
store i8 0, i8* %54
%55 = getelementptr inbounds i8, i8* %54, i64 1
store i8 36, i8* %55
%56 = getelementptr inbounds i8, i8* %55, i64 1
store i8 52, i8* %56
%57 = getelementptr inbounds i8, i8* %56, i64 1
store i8 69, i8* %57
%58 = getelementptr inbounds i8, i8* %57, i64 1
store i8 53, i8* %58
%59 = getelementptr inbounds i8, i8* %58, i64 1
store i8 66, i8* %59
%60 = getelementptr inbounds i8, i8* %59, i64 1
store i8 56, i8* %60
%61 = getelementptr inbounds i8, i8* %60, i64 1
store i8 66, i8* %61
%62 = getelementptr inbounds i8, i8* %61, i64 1
store i8 49, i8* %62
%63 = getelementptr inbounds i8, i8* %62, i64 1
store i8 55, i8* %63
%64 = getelementptr inbounds i8, i8* %63, i64 1
store i8 45, i8* %64
%65 = getelementptr inbounds i8, i8* %64, i64 1
store i8 68, i8* %65
%66 = getelementptr inbounds i8, i8* %65, i64 1
store i8 67, i8* %66
%67 = getelementptr inbounds i8, i8* %66, i64 1
store i8 51, i8* %67
%68 = getelementptr inbounds i8, i8* %67, i64 1
store i8 56, i8* %68
%69 = getelementptr inbounds i8, i8* %68, i64 1
store i8 45, i8* %69
%70 = getelementptr inbounds i8, i8* %69, i64 1
store i8 52, i8* %70
%71 = getelementptr inbounds i8, i8* %70, i64 1
store i8 49, i8* %71
%72 = getelementptr inbounds i8, i8* %71, i64 1
store i8 66, i8* %72
%73 = getelementptr inbounds i8, i8* %72, i64 1
store i8 56, i8* %73
%74 = getelementptr inbounds i8, i8* %73, i64 1
store i8 45, i8* %74
%75 = getelementptr inbounds i8, i8* %74, i64 1
store i8 57, i8* %75
%76 = getelementptr inbounds i8, i8* %75, i64 1
store i8 69, i8* %76
%77 = getelementptr inbounds i8, i8* %76, i64 1
store i8 48, i8* %77
%78 = getelementptr inbounds i8, i8* %77, i64 1
store i8 69, i8* %78
%79 = getelementptr inbounds i8, i8* %78, i64 1
store i8 45, i8* %79
%80 = getelementptr inbounds i8, i8* %79, i64 1
store i8 53, i8* %80
%81 = getelementptr inbounds i8, i8* %80, i64 1
store i8 68, i8* %81
%82 = getelementptr inbounds i8, i8* %81, i64 1
store i8 52, i8* %82
%83 = getelementptr inbounds i8, i8* %82, i64 1
store i8 65, i8* %83
%84 = getelementptr inbounds i8, i8* %83, i64 1
store i8 67, i8* %84
%85 = getelementptr inbounds i8, i8* %84, i64 1
store i8 67, i8* %85
%86 = getelementptr inbounds i8, i8* %85, i64 1
store i8 48, i8* %86
%87 = getelementptr inbounds i8, i8* %86, i64 1
store i8 66, i8* %87
%88 = getelementptr inbounds i8, i8* %87, i64 1
store i8 48, i8* %88
%89 = getelementptr inbounds i8, i8* %88, i64 1
store i8 55, i8* %89
%90 = getelementptr inbounds i8, i8* %89, i64 1
store i8 70, i8* %90
%91 = getelementptr inbounds i8, i8* %90, i64 1
store i8 70, i8* %91
%92 = getelementptr inbounds i8, i8* %91, i64 1
store i8 0, i8* %92
%93 = getelementptr inbounds i8, i8* %92, i64 1
store i8 0, i8* %93
%94 = getelementptr inbounds i8, i8* %93, i64 1
store i8 0, i8* %94
%95 = getelementptr inbounds i8, i8* %94, i64 1
store i8 0, i8* %95
%96 = getelementptr inbounds i8, i8* %95, i64 1
store i8 1, i8* %96
%97 = getelementptr inbounds i8, i8* %96, i64 1
store i8 1, i8* %97
%98 = getelementptr inbounds i8, i8* %97, i64 1
store i8 0, i8* %98
%99 = getelementptr inbounds i8, i8* %98, i64 1
store i8 25, i8* %99
%100 = getelementptr inbounds i8, i8* %99, i64 1
store i8 0, i8* %100
%101 = getelementptr inbounds i8, i8* %100, i64 1
store i8 0, i8* %101
%102 = getelementptr inbounds i8, i8* %101, i64 1
store i8 0, i8* %102
%103 = getelementptr inbounds i8, i8* %102, i64 1
store i8 1, i8* %103
%104 = getelementptr inbounds i8, i8* %103, i64 1
store i8 0, i8* %104
%105 = getelementptr inbounds i8, i8* %104, i64 1
store i8 9, i8* %105
%106 = getelementptr inbounds i8, i8* %105, i64 1
store i8 49, i8* %106
%107 = getelementptr inbounds i8, i8* %106, i64 1
store i8 50, i8* %107
%108 = getelementptr inbounds i8, i8* %107, i64 1
store i8 55, i8* %108
%109 = getelementptr inbounds i8, i8* %108, i64 1
store i8 46, i8* %109
%110 = getelementptr inbounds i8, i8* %109, i64 1
store i8 48, i8* %110
%111 = getelementptr inbounds i8, i8* %110, i64 1
store i8 46, i8* %111
%112 = getelementptr inbounds i8, i8* %111, i64 1
store i8 48, i8* %112
%113 = getelementptr inbounds i8, i8* %112, i64 1
store i8 46, i8* %113
%114 = getelementptr inbounds i8, i8* %113, i64 1
store i8 49, i8* %114
%115 = getelementptr inbounds i8, i8* %114, i64 1
%116 = load i8*, i8** %5
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = load i8, i8* %117
store i8 %118, i8* %115
%119 = getelementptr inbounds i8, i8* %115, i64 1
%120 = load i8*, i8** %5
%121 = getelementptr inbounds i8, i8* %120, i64 0
%122 = load i8, i8* %121
store i8 %122, i8* %119
%123 = getelementptr inbounds i8, i8* %119, i64 1
store i8 0, i8* %123
%124 = getelementptr inbounds i8, i8* %123, i64 1
store i8 0, i8* %124
%125 = getelementptr inbounds i8, i8* %124, i64 1
store i8 -1, i8* %125
%126 = getelementptr inbounds i8, i8* %125, i64 1
store i8 -1, i8* %126
%127 = getelementptr inbounds i8, i8* %126, i64 1
store i8 -1, i8* %127
%128 = getelementptr inbounds i8, i8* %127, i64 1
store i8 -1, i8* %128
%129 = getelementptr inbounds i8, i8* %128, i64 1
store i8 0, i8* %129
%130 = load i8*, i8** %3
%131 = call i32 @murmur_connect(i8* %130)
store i32 %131, i32* %7
%132 = load i32, i32* %7
%133 = icmp slt i32 %132, 0
br i1 %133, label %134, label %135
134: ; preds = %1
store i32 0, i32* %2
br label %157
135: ; preds = %1
%136 = load i32, i32* %7
%137 = getelementptr inbounds [112 x i8], [112 x i8]* %9, i64 0, i64 0
%138 = call i32 @sock_write(i32 %136, i8* %137, i32 112)
%139 = sext i32 %138 to i64
%140 = icmp ne i64 %139, 112
br i1 %140, label %141, label %144
141: ; preds = %135
%142 = load i32, i32* @stderr
%143 = call i32 @fprintf(i32 %142, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %153
144: ; preds = %135
%145 = load i32, i32* %7
%146 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%147 = call i32 @sock_read(i32 %145, i8* %146, i32 512)
%148 = icmp ne i32 %147, 25
br i1 %148, label %149, label %152
149: ; preds = %144
%150 = load i32, i32* @stderr
%151 = call i32 @fprintf(i32 %150, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
br label %153
152: ; preds = %144
store i32 1, i32* %8
br label %153
153: ; preds = %152, %149, %141
%154 = load i32, i32* %7
%155 = call i32 @close(i32 %154)
%156 = load i32, i32* %8
store i32 %156, i32* %2
br label %157
157: ; preds = %153, %134
%158 = load i32, i32* %2
ret i32 %158
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error: Failed to send addCallback_packet\0A\00"
@.str.1 = [59 x i8] c"Error: Failed to receive addCallback_packet success reply\0A\00"
define i32 @add_murmur_callbacks(i8* %0) {
%2 = alloca [512 x i8]
%3 = alloca [112 x i8]
%4 = tail call i32 @htons(i32 65535)
%5 = trunc i32 %4 to i8
%6 = lshr i32 %4, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 0
%10 = bitcast [112 x i8]* %3 to <16 x i8>*
store <16 x i8> <i8 73, i8 99, i8 101, i8 80, i8 1, i8 0, i8 1, i8 0, i8 0, i8 0, i8 112, i8 0, i8 0, i8 0, i8 2, i8 0>, <16 x i8>* %10
%11 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 16
%12 = bitcast i8* %11 to <16 x i8>*
store <16 x i8> <i8 0, i8 0, i8 1, i8 49, i8 1, i8 115, i8 0, i8 11, i8 97, i8 100, i8 100, i8 67, i8 97, i8 108, i8 108, i8 98>, <16 x i8>* %12
%13 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 32
%14 = bitcast i8* %13 to <16 x i8>*
store <16 x i8> <i8 97, i8 99, i8 107, i8 0, i8 0, i8 75, i8 0, i8 0, i8 0, i8 1, i8 0, i8 36, i8 52, i8 69, i8 53, i8 66>, <16 x i8>* %14
%15 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 48
%16 = bitcast i8* %15 to <16 x i8>*
store <16 x i8> <i8 56, i8 66, i8 49, i8 55, i8 45, i8 68, i8 67, i8 51, i8 56, i8 45, i8 52, i8 49, i8 66, i8 56, i8 45, i8 57>, <16 x i8>* %16
%17 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 64
%18 = bitcast i8* %17 to <16 x i8>*
store <16 x i8> <i8 69, i8 48, i8 69, i8 45, i8 53, i8 68, i8 52, i8 65, i8 67, i8 67, i8 48, i8 66, i8 48, i8 55, i8 70, i8 70>, <16 x i8>* %18
%19 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 80
%20 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 84
%21 = bitcast i8* %19 to i32*
store i32 0, i32* %21
%22 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 1, i8 1, i8 0, i8 25, i8 0, i8 0, i8 0, i8 1, i8 0, i8 9, i8 49, i8 50, i8 55, i8 46, i8 48, i8 46>, <16 x i8>* %22
%23 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 100
store i8 48, i8* %23
%24 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 101
store i8 46, i8* %24
%25 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 102
store i8 49, i8* %25
%26 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 103
store i8 %7, i8* %26
%27 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 104
store i8 %5, i8* %27
%28 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 105
store i8 0, i8* %28
%29 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 106
store i8 0, i8* %29
%30 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 107
%31 = getelementptr inbounds [112 x i8], [112 x i8]* %3, i64 0, i64 111
%32 = bitcast i8* %30 to i32*
store i32 -1, i32* %32
store i8 0, i8* %31
%33 = tail call i32 @murmur_connect(i8* %0)
%34 = icmp slt i32 %33, 0
br i1 %34, label %48, label %35
35: ; preds = %1
%36 = call i32 @sock_write(i32 %33, i8* %9, i32 112)
%37 = icmp eq i32 %36, 112
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = call i32 @sock_read(i32 %33, i8* %8, i32 512)
%40 = icmp eq i32 %39, 25
br i1 %40, label %45, label %41
41: ; preds = %38, %35
%42 = phi i8* [ getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), %35 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), %38 ]
%43 = load i32, i32* @stderr
%44 = call i32 @fprintf(i32 %43, i8* %42)
br label %45
45: ; preds = %41, %38
%46 = phi i32 [ 1, %38 ], [ 0, %41 ]
%47 = call i32 @close(i32 %33)
br label %48
48: ; preds = %1, %45
%49 = phi i32 [ %46, %45 ], [ 0, %1 ]
ret i32 %49
}