unsigned uRewriteIPAndPortSIPLine(char *cSIPMessage, const char *cNewIP,
                                  unsigned uNewPort) {
  char *cp;
  char *cp1;
  char *cpNextLine;
  char cSomething[100] = {""};
  char cPrefix[100] = {""};
  char cSIPLine[256] = {""};
  char cMessage[2048] = {""};
  if ((cp = strchr(cSIPMessage, '\r'))) {
    cpNextLine = cp + 1;
    *cp = 0;
    sprintf(cSIPLine, "%.255s", cSIPMessage);
    *cp = '\r';
  } else
    return (1);
  if (!(strstr(cSIPLine, "INVITE ") || strstr(cSIPLine, "CANCEL ") ||
        strstr(cSIPLine, "OPTIONS ")))
    return (2);
  cp = strstr(cSIPLine, "sip:");
  *cp = 0;
  sprintf(cPrefix, "%.99s", cSIPLine);
  if ((cp1 = strchr(cp + strlen("sip:"), '@'))) {
    *cp1 = 0;
    sprintf(cSomething, "%.99s", cp + strlen("sip:"));
  }
  if (!uNewPort)
    uNewPort = 5060;
  if (cSomething[0])
    sprintf(cSIPLine, "%ssip:%s@%s:%u SIP/2.0\r", cPrefix, cSomething, cNewIP,
            uNewPort);
  else
    sprintf(cSIPLine, "%ssip:%s:%u SIP/2.0\r", cPrefix, cNewIP, uNewPort);
  sprintf(cMessage, "%.2047s", cpNextLine);
  char cFormat[16] = {""};
  sprintf(cFormat, "%%s%%.%us", (unsigned)(2047 - strlen(cSIPLine)));
  sprintf(cSIPMessage, cFormat, cSIPLine, cMessage);
  return (0);
}


x86 assembly (clang, -O0):
<uRewriteIPAndPortSIPLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0xa10(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1206 <uRewriteIPAndPortSIPLine+0xb6>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe0d(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x28(%rbp),%rax
movb   $0xd,(%rax)
jmp    1212 <uRewriteIPAndPortSIPLine+0xc2>
movl   $0x1,-0x4(%rbp)
jmp    13f4 <uRewriteIPAndPortSIPLine+0x2a4>
lea    -0x210(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
jne    1275 <uRewriteIPAndPortSIPLine+0x125>
lea    -0x210(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
jne    1275 <uRewriteIPAndPortSIPLine+0x125>
lea    -0x210(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
jne    1275 <uRewriteIPAndPortSIPLine+0x125>
movl   $0x2,-0x4(%rbp)
jmp    13f4 <uRewriteIPAndPortSIPLine+0x2a4>
lea    -0x210(%rbp),%rdi
lea    0xd9d(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x28(%rbp),%rdi
add    $0x4,%rdi
mov    $0x40,%esi
call   1040 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     12f3 <uRewriteIPAndPortSIPLine+0x1a3>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
lea    -0xa0(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0x4,%rdx
lea    0xd39(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    1304 <uRewriteIPAndPortSIPLine+0x1b4>
movl   $0x13c4,-0x1c(%rbp)
cmpb   $0x0,-0xa0(%rbp)
je     1341 <uRewriteIPAndPortSIPLine+0x1f1>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    1365 <uRewriteIPAndPortSIPLine+0x215>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xce5(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0xa10(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xce1(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0xa20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0xa20(%rbp),%rax
mov    %rax,-0xa28(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xa28(%rbp),%rdi
mov    %rax,%rcx
mov    $0x7ff,%eax
sub    %rcx,%rax
mov    %eax,%edx
lea    0xc9a(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0xa20(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    -0xa10(%rbp),%rcx
mov    $0x0,%al
call   1060 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uRewriteIPAndPortSIPLine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9f8,%rsp
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%r12
xorps  %xmm0,%xmm0
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xe0(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
lea    0x1f0(%rsp),%rdi
mov    $0x800,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    %r12,%rdi
mov    $0xd,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1390 <uRewriteIPAndPortSIPLine+0x240>
mov    %rax,%rbp
movb   $0x0,(%rax)
lea    0xd7b(%rip),%rsi
lea    0xf0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
movb   $0xd,0x0(%rbp)
lea    0xd62(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
jne    12e8 <uRewriteIPAndPortSIPLine+0x198>
lea    0xd56(%rip),%rsi
lea    0xf0(%rsp),%rdi
call   1070 <strstr@plt>
test   %rax,%rax
jne    12e8 <uRewriteIPAndPortSIPLine+0x198>
lea    0xd45(%rip),%rsi
lea    0xf0(%rsp),%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     1432 <uRewriteIPAndPortSIPLine+0x2e2>
lea    0xd31(%rip),%rsi
lea    0xf0(%rsp),%r13
mov    %r13,%rdi
call   1070 <strstr@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xd19(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     134d <uRewriteIPAndPortSIPLine+0x1fd>
movb   $0x0,(%rax)
lea    0xcea(%rip),%rsi
lea    0x80(%rsp),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
add    $0x1,%rbp
test   %r15d,%r15d
mov    $0x13c4,%r9d
cmovne %r15d,%r9d
cmpb   $0x0,0x80(%rsp)
je     139a <uRewriteIPAndPortSIPLine+0x24a>
lea    0xcbc(%rip),%rsi
lea    0xf0(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0x80(%rsp),%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1060 <sprintf@plt>
jmp    13bb <uRewriteIPAndPortSIPLine+0x26b>
mov    $0x1,%ebx
jmp    141e <uRewriteIPAndPortSIPLine+0x2ce>
lea    0xca2(%rip),%rsi
lea    0xf0(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    %r14,%rcx
mov    %r9d,%r8d
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xc96(%rip),%rsi
xor    %ebx,%ebx
lea    0x1f0(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xf0(%rsp),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    $0x7ff,%edx
sub    %eax,%edx
lea    0xc62(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %ebx,%eax
add    $0x9f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%ebx
jmp    141e <uRewriteIPAndPortSIPLine+0x2ce>

LLVM IR (-O0):
@.str = [7 x i8] c"%.255s\00"
@.str.1 = [8 x i8] c"INVITE \00"
@.str.2 = [8 x i8] c"CANCEL \00"
@.str.3 = [9 x i8] c"OPTIONS \00"
@.str.4 = [5 x i8] c"sip:\00"
@.str.5 = [6 x i8] c"%.99s\00"
@.str.6 = [24 x i8] c"%ssip:%s@%s:%u SIP/2.0\0D\00"
@.str.7 = [21 x i8] c"%ssip:%s:%u SIP/2.0\0D\00"
@.str.8 = [8 x i8] c"%.2047s\00"
@.str.9 = [10 x i8] c"%%s%%.%us\00"
define i32 @uRewriteIPAndPortSIPLine(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [100 x i8]
%12 = alloca [100 x i8]
%13 = alloca [256 x i8]
%14 = alloca [2048 x i8]
%15 = alloca [16 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%16 = bitcast [100 x i8]* %11 to i8*
%17 = bitcast [100 x i8]* %12 to i8*
%18 = bitcast [256 x i8]* %13 to i8*
%19 = bitcast [2048 x i8]* %14 to i8*
%20 = load i8*, i8** %5
%21 = call i8* @strchr(i8* %20, i32 13)
store i8* %21, i8** %8
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %31
23: ; preds = %3
%24 = load i8*, i8** %8
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %10
%26 = load i8*, i8** %8
store i8 0, i8* %26
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%28 = load i8*, i8** %5
%29 = call i32 (i8*, i8*, ...) @sprintf(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = load i8*, i8** %8
store i8 13, i8* %30
br label %32
31: ; preds = %3
store i32 1, i32* %4
br label %99
32: ; preds = %23
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%34 = call i8* @strstr(i8* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp ne i8* %34, null
br i1 %35, label %45, label %36
36: ; preds = %32
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%38 = call i8* @strstr(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp ne i8* %38, null
br i1 %39, label %45, label %40
40: ; preds = %36
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%42 = call i8* @strstr(i8* %41, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%43 = icmp ne i8* %42, null
br i1 %43, label %45, label %44
44: ; preds = %40
store i32 2, i32* %4
br label %99
45: ; preds = %40, %36, %32
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%47 = call i8* @strstr(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8* %47, i8** %8
%48 = load i8*, i8** %8
store i8 0, i8* %48
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %50)
%52 = load i8*, i8** %8
%53 = getelementptr inbounds i8, i8* %52, i64 4
%54 = call i8* @strchr(i8* %53, i32 64)
store i8* %54, i8** %9
%55 = icmp ne i8* %54, null
br i1 %55, label %56, label %62
56: ; preds = %45
%57 = load i8*, i8** %9
store i8 0, i8* %57
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%59 = load i8*, i8** %8
%60 = getelementptr inbounds i8, i8* %59, i64 4
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %56, %45
%63 = load i32, i32* %7
%64 = icmp ne i32 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %62
store i32 5060, i32* %7
br label %66
66: ; preds = %65, %62
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%68 = load i8, i8* %67
%69 = icmp ne i8 %68, 0
br i1 %69, label %70, label %77
70: ; preds = %66
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%74 = load i8*, i8** %6
%75 = load i32, i32* %7
%76 = call i32 (i8*, i8*, ...) @sprintf(i8* %71, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %72, i8* %73, i8* %74, i32 %75)
br label %83
77: ; preds = %66
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%80 = load i8*, i8** %6
%81 = load i32, i32* %7
%82 = call i32 (i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %79, i8* %80, i32 %81)
br label %83
83: ; preds = %77, %70
%84 = getelementptr inbounds [2048 x i8], [2048 x i8]* %14, i64 0, i64 0
%85 = load i8*, i8** %10
%86 = call i32 (i8*, i8*, ...) @sprintf(i8* %84, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %85)
%87 = bitcast [16 x i8]* %15 to i8*
%88 = getelementptr inbounds [16 x i8], [16 x i8]* %15, i64 0, i64 0
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%90 = call i64 @strlen(i8* %89)
%91 = sub i64 2047, %90
%92 = trunc i64 %91 to i32
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %88, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %92)
%94 = load i8*, i8** %5
%95 = getelementptr inbounds [16 x i8], [16 x i8]* %15, i64 0, i64 0
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%97 = getelementptr inbounds [2048 x i8], [2048 x i8]* %14, i64 0, i64 0
%98 = call i32 (i8*, i8*, ...) @sprintf(i8* %94, i8* %95, i8* %96, i8* %97)
store i32 0, i32* %4
br label %99
99: ; preds = %83, %44, %31
%100 = load i32, i32* %4
ret i32 %100
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.255s\00"
@.str.1 = [8 x i8] c"INVITE \00"
@.str.2 = [8 x i8] c"CANCEL \00"
@.str.3 = [9 x i8] c"OPTIONS \00"
@.str.4 = [5 x i8] c"sip:\00"
@.str.5 = [6 x i8] c"%.99s\00"
@.str.6 = [24 x i8] c"%ssip:%s@%s:%u SIP/2.0\0D\00"
@.str.7 = [21 x i8] c"%ssip:%s:%u SIP/2.0\0D\00"
@.str.8 = [8 x i8] c"%.2047s\00"
@.str.9 = [10 x i8] c"%%s%%.%us\00"
define i32 @uRewriteIPAndPortSIPLine(i8* %0, i8* %1, i32 %2) {
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [256 x i8]
%7 = alloca [2048 x i8]
%8 = alloca [16 x i8]
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%13 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%14 = icmp eq i8* %13, null
br i1 %14, label %51, label %15
15: ; preds = %3
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 0, i8* %13
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
store i8 13, i8* %13
%18 = call i8* @strstr(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = call i8* @strstr(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = call i8* @strstr(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i8* %24, null
br i1 %25, label %51, label %26
26: ; preds = %23, %20, %15
%27 = call i8* @strstr(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8 0, i8* %27
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%29 = getelementptr inbounds i8, i8* %27, i64 4
%30 = call i8* @strchr(i8* %29, i32 64)
%31 = icmp eq i8* %30, null
br i1 %31, label %34, label %32
32: ; preds = %26
store i8 0, i8* %30
%33 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %29)
br label %34
34: ; preds = %32, %26
%35 = icmp eq i32 %2, 0
%36 = select i1 %35, i32 5060, i32 %2
%37 = load i8, i8* %9
%38 = icmp eq i8 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %34
%40 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %10, i8* %9, i8* %1, i32 %36)
br label %43
41: ; preds = %34
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %10, i8* %1, i32 %36)
br label %43
43: ; preds = %41, %39
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %16)
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%46 = call i64 @strlen(i8* %11)
%47 = trunc i64 %46 to i32
%48 = sub i32 2047, %47
%49 = call i32 (i8*, i8*, ...) @sprintf(i8* %45, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %48)
%50 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* %45, i8* %11, i8* %12)
br label %51
51: ; preds = %23, %3, %43
%52 = phi i32 [ 0, %43 ], [ 1, %3 ], [ 2, %23 ]
ret i32 %52
}