#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*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ generateUdpPacket(char *, char *, char *, int, int,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ *generateVoipInvitePacket(char *, char *, char *, char *,
                                             char *);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strtok(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *args[]) {
  if (argc != 2) {
    printf("usage: ./voipInvitePacketGenerator destIPAddress \n");
    return -1;
  }
  FILE *fp;
  int readn, split_buf_num = 0, index = 0;
  char buf[256], src_ip[16], if_name[20] = {'\0'};
  char *split_buf[30];
  system("ip addr | grep \"eth0\" | grep \"inet\" | grep \"brd\" >> "
         "/tmp/temp.txt");
  fp = fopen("/tmp/temp.txt", "r");
  if (fp == NULL) {
    printf("File open failed \n");
    return -1;
  }
  memset(buf, 0x00, 256);
  readn = fread(buf, 256 - 1, 1, fp);
  fclose(fp);
  system("rm /tmp/temp.txt");
  split_buf[split_buf_num] = strtok(buf, " ");
  while (split_buf[split_buf_num] != NULL) {
    split_buf_num++;
    split_buf[split_buf_num] = strtok(NULL, " ");
  }
  char *endPoint = strchr(split_buf[1], '/');
  int endIndex = (int)(endPoint - split_buf[1]);
  strncpy(src_ip, split_buf[1], endIndex);
  src_ip[endIndex] = '\0';
  endPoint = strchr(split_buf[6], '\n');
  endIndex = (int)(endPoint - split_buf[6]);
  strncpy(if_name, split_buf[6], endIndex);
  if_name[endIndex] = '\0';
  printf("src_ip: %s\n", src_ip);
  printf("if_name: %s\n", if_name);
  uint8_t *data = generateVoipInvitePacket(
      "yys", "070-123-4567", "070-884-1231", "voip.kt.com", src_ip);
  generateUdpPacket(if_name, src_ip, args[1], 5060, 5060, data);
  free(data);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11fd <main+0x3d>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1452 <main+0x292>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   10a0 <memset@plt>
lea    0xe0e(%rip),%rdi
call   1070 <system@plt>
lea    0xe36(%rip),%rdi
lea    0xe3d(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1266 <main+0xa6>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1452 <main+0x292>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   10a0 <memset@plt>
lea    -0x130(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xff,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
lea    0xde4(%rip),%rdi
call   1070 <system@plt>
lea    -0x130(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x250(%rbp,%rax,8)
ff
movslq -0x20(%rbp),%rax
cmpq   $0x0,-0x250(%rbp,%rax,8)
je     130d <main+0x14d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xda7(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x250(%rbp,%rax,8)
ff
jmp    12cd <main+0x10d>
mov    -0x248(%rbp),%rdi
mov    $0x2f,%esi
call   1080 <strchr@plt>
mov    %rax,-0x258(%rbp)
mov    -0x258(%rbp),%rax
mov    -0x248(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x25c(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x248(%rbp),%rsi
mov    -0x25c(%rbp),%edx
call   1040 <strncpy@plt>
movslq -0x25c(%rbp),%rax
movb   $0x0,-0x140(%rbp,%rax,1)
mov    -0x220(%rbp),%rdi
mov    $0xa,%esi
call   1080 <strchr@plt>
mov    %rax,-0x258(%rbp)
mov    -0x258(%rbp),%rax
mov    -0x220(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x25c(%rbp)
lea    -0x160(%rbp),%rdi
mov    -0x220(%rbp),%rsi
mov    -0x25c(%rbp),%edx
call   1040 <strncpy@plt>
movslq -0x25c(%rbp),%rax
movb   $0x0,-0x160(%rbp,%rax,1)
lea    -0x140(%rbp),%rsi
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x160(%rbp),%rsi
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x140(%rbp),%r8
lea    0xcc3(%rip),%rdi
lea    0xcc0(%rip),%rsi
lea    0xcc6(%rip),%rdx
lea    0xccc(%rip),%rcx
call   10c0 <generateVoipInvitePacket@plt>
mov    %rax,-0x268(%rbp)
lea    -0x160(%rbp),%rdi
lea    -0x140(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x268(%rbp),%r9
mov    $0x13c4,%r8d
mov    %r8d,%ecx
call   10b0 <generateUdpPacket@plt>
mov    -0x268(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
cmp    $0x2,%edi
jne    137a <main+0x1aa>
mov    %rsi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xdfd(%rip),%rdi
call   1080 <system@plt>
lea    0xe25(%rip),%rdi
lea    0xe2c(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1383 <main+0x1b3>
mov    %rax,%rbx
lea    0x120(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   10b0 <memset@plt>
mov    %rbp,%rdi
mov    $0xff,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fread@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0xde2(%rip),%rdi
call   1080 <system@plt>
lea    0xe3a(%rip),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10f0 <strtok@plt>
mov    %rax,0x30(%rsp)
lea    0x38(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %rbx,%rsi
call   10f0 <strtok@plt>
mov    %rax,0x0(%rbp)
add    $0x8,%rbp
test   %rax,%rax
jne    1290 <main+0xc0>
mov    0x38(%rsp),%rbx
mov    0x60(%rsp),%r12
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1090 <strchr@plt>
mov    %rax,%rbp
sub    %rbx,%rbp
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,0x20(%rsp,%rax,1)
mov    %r12,%rdi
mov    $0xa,%esi
call   1090 <strchr@plt>
mov    %rax,%rbp
sub    %r12,%rbp
mov    %rsp,%r13
mov    %r13,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1040 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xd46(%rip),%rdi
xor    %ebp,%ebp
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd3f(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd3b(%rip),%rdi
lea    0xd38(%rip),%rsi
lea    0xd3e(%rip),%rdx
lea    0xd44(%rip),%rcx
mov    %r15,%r8
call   10d0 <generateVoipInvitePacket@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rdx
mov    %r13,%rdi
mov    %r15,%rsi
mov    $0x13c4,%ecx
mov    $0x13c4,%r8d
mov    %rax,%r9
call   10c0 <generateUdpPacket@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1394 <main+0x1c4>
lea    0xd29(%rip),%rdi
jmp    138a <main+0x1ba>
lea    0xd0e(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"usage: ./voipInvitePacketGenerator destIPAddress \0A\00"
@.str.1 = [66 x i8] c"ip addr | grep \22eth0\22 | grep \22inet\22 | grep \22brd\22 >> /tmp/temp.txt\00"
@.str.2 = [14 x i8] c"/tmp/temp.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [19 x i8] c"File open failed \0A\00"
@.str.5 = [17 x i8] c"rm /tmp/temp.txt\00"
@.str.6 = [2 x i8] c" \00"
@.str.7 = [12 x i8] c"src_ip: %s\0A\00"
@.str.8 = [13 x i8] c"if_name: %s\0A\00"
@.str.9 = [4 x i8] c"yys\00"
@.str.10 = [13 x i8] c"070-123-4567\00"
@.str.11 = [13 x i8] c"070-884-1231\00"
@.str.12 = [12 x i8] c"voip.kt.com\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 [256 x i8]
%11 = alloca [16 x i8]
%12 = alloca [20 x i8]
%13 = alloca [30 x i8*]
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %108
21: ; preds = %2
store i32 0, i32* %8
store i32 0, i32* %9
%22 = bitcast [20 x i8]* %12 to i8*
%23 = call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %24, i32** %6
%25 = load i32*, i32** %6
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %108
29: ; preds = %21
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%31 = call i32 @memset(i8* %30, i32 0, i32 256)
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%33 = load i32*, i32** %6
%34 = call i32 @fread(i8* %32, i32 255, i32 1, i32* %33)
store i32 %34, i32* %7
%35 = load i32*, i32** %6
%36 = call i32 @fclose(i32* %35)
%37 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%39 = call i8* @strtok(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 %41
store i8* %39, i8** %42
br label %43
43: ; preds = %49, %29
%44 = load i32, i32* %8
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 %45
%47 = load i8*, i8** %46
%48 = icmp ne i8* %47, null
br i1 %48, label %49, label %56
49: ; preds = %43
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
%52 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 %54
store i8* %52, i8** %55
br label %43
56: ; preds = %43
%57 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 1
%58 = load i8*, i8** %57
%59 = call i8* @strchr(i8* %58, i8 signext 47)
store i8* %59, i8** %14
%60 = load i8*, i8** %14
%61 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 1
%62 = load i8*, i8** %61
%63 = ptrtoint i8* %60 to i64
%64 = ptrtoint i8* %62 to i64
%65 = sub i64 %63, %64
%66 = trunc i64 %65 to i32
store i32 %66, i32* %15
%67 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%68 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 1
%69 = load i8*, i8** %68
%70 = load i32, i32* %15
%71 = call i32 @strncpy(i8* %67, i8* %69, i32 %70)
%72 = load i32, i32* %15
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 %73
store i8 0, i8* %74
%75 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 6
%76 = load i8*, i8** %75
%77 = call i8* @strchr(i8* %76, i8 signext 10)
store i8* %77, i8** %14
%78 = load i8*, i8** %14
%79 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 6
%80 = load i8*, i8** %79
%81 = ptrtoint i8* %78 to i64
%82 = ptrtoint i8* %80 to i64
%83 = sub i64 %81, %82
%84 = trunc i64 %83 to i32
store i32 %84, i32* %15
%85 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%86 = getelementptr inbounds [30 x i8*], [30 x i8*]* %13, i64 0, i64 6
%87 = load i8*, i8** %86
%88 = load i32, i32* %15
%89 = call i32 @strncpy(i8* %85, i8* %87, i32 %88)
%90 = load i32, i32* %15
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 %91
store i8 0, i8* %92
%93 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %93)
%95 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%98 = call i32* @generateVoipInvitePacket(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* %97)
store i32* %98, i32** %16
%99 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%100 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = load i8*, i8** %102
%104 = load i32*, i32** %16
%105 = call i32 @generateUdpPacket(i8* %99, i8* %100, i8* %103, i32 5060, i32 5060, i32* %104)
%106 = load i32*, i32** %16
%107 = call i32 @free(i32* %106)
store i32 0, i32* %3
br label %108
108: ; preds = %56, %27, %19
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
@.str.1 = [66 x i8] c"ip addr | grep \22eth0\22 | grep \22inet\22 | grep \22brd\22 >> /tmp/temp.txt\00"
@.str.2 = [14 x i8] c"/tmp/temp.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.5 = [17 x i8] c"rm /tmp/temp.txt\00"
@.str.6 = [2 x i8] c" \00"
@.str.7 = [12 x i8] c"src_ip: %s\0A\00"
@.str.8 = [13 x i8] c"if_name: %s\0A\00"
@.str.9 = [4 x i8] c"yys\00"
@.str.10 = [13 x i8] c"070-123-4567\00"
@.str.11 = [13 x i8] c"070-884-1231\00"
@.str.12 = [12 x i8] c"voip.kt.com\00"
@str = [18 x i8] c"File open failed \00"
@str.13 = [50 x i8] c"usage: ./voipInvitePacketGenerator destIPAddress \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [16 x i8]
%5 = alloca [20 x i8]
%6 = alloca [30 x i8*]
%7 = icmp eq i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.13, i64 0, i64 0))
br label %66
10: ; preds = %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = bitcast [30 x i8*]* %6 to i8*
%15 = tail call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %64
20: ; preds = %10
%21 = call i32 @memset(i8* %11, i32 0, i32 256)
%22 = call i32 @fread(i8* %11, i32 255, i32 1, i32* %16)
%23 = call i32 @fclose(i32* %16)
%24 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%25 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%26 = getelementptr inbounds [30 x i8*], [30 x i8*]* %6, i64 0, i64 0
store i8* %25, i8** %26
%27 = icmp ne i8* %25, null
br label %28
28: ; preds = %20, %28
%29 = phi i64 [ %30, %28 ], [ 0, %20 ]
%30 = add nuw nsw i64 %29, 1
%31 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%32 = getelementptr inbounds [30 x i8*], [30 x i8*]* %6, i64 0, i64 %30
store i8* %31, i8** %32
%33 = icmp eq i8* %31, null
br i1 %33, label %34, label %28
34: ; preds = %28
%35 = getelementptr inbounds [30 x i8*], [30 x i8*]* %6, i64 0, i64 1
%36 = load i8*, i8** %35
%37 = getelementptr inbounds [30 x i8*], [30 x i8*]* %6, i64 0, i64 6
%38 = load i8*, i8** %37
%39 = call i8* @strchr(i8* dereferenceable(1) %36, i8 signext 47)
%40 = ptrtoint i8* %39 to i64
%41 = ptrtoint i8* %36 to i64
%42 = sub i64 %40, %41
%43 = trunc i64 %42 to i32
%44 = call i32 @strncpy(i8* %12, i8* %36, i32 %43)
%45 = shl i64 %42, 32
%46 = ashr exact i64 %45, 32
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 %46
store i8 0, i8* %47
%48 = call i8* @strchr(i8* dereferenceable(1) %38, i8 signext 10)
%49 = ptrtoint i8* %48 to i64
%50 = ptrtoint i8* %38 to i64
%51 = sub i64 %49, %50
%52 = trunc i64 %51 to i32
%53 = call i32 @strncpy(i8* %13, i8* %38, i32 %52)
%54 = shl i64 %51, 32
%55 = ashr exact i64 %54, 32
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %12)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %13)
%59 = call i32* @generateVoipInvitePacket(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* %12)
%60 = getelementptr inbounds i8*, i8** %1, i64 1
%61 = load i8*, i8** %60
%62 = call i32 @generateUdpPacket(i8* %13, i8* %12, i8* %61, i32 5060, i32 5060, i32* %59)
%63 = call i32 @free(i32* %59)
br label %64
64: ; preds = %34, %18
%65 = phi i32 [ -1, %18 ], [ 0, %34 ]
br label %66
66: ; preds = %64, %8
%67 = phi i32 [ -1, %8 ], [ %65, %64 ]
ret i32 %67
}