#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*/ compress(char *, int, int, char *);
int /*<<< orphan*/ decompress(char *, int, int);
int /*<<< orphan*/ hexToStr(char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int main() {
  char outStr[16384 * 4];
  compress(
      "connect "
      "\"\\challenge\\984599813\\qport\\57203\\protocol\\69\\cl_"
      "voip\\0\\name\\TestName\\rate\\3000\\snaps\\20\\color1\\4\\color2\\5\\ha"
      "ndi2cap\\100\\sex\\male\\cl_guid\\12345678901234567890123456789012\"",
      150, 4, outStr);
  char inStr[30] = "54 68 65 20 43 61 74";
  strcpy(outStr, hexToStr(outStr));
  decompress(outStr, 150, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10040,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10010(%rbp),%rcx
lea    0xea0(%rip),%rdi
mov    $0x96,%esi
mov    $0x4,%edx
call   1040 <compress@plt>
mov    0xf4a(%rip),%rax
mov    %rax,-0x10030(%rbp)
mov    0xf44(%rip),%rax
mov    %rax,-0x10028(%rbp)
mov    0xf3e(%rip),%rax
mov    %rax,-0x10020(%rbp)
mov    0xf39(%rip),%eax
mov    %eax,-0x10018(%rbp)
mov    0xf30(%rip),%ax
mov    %ax,-0x10014(%rbp)
lea    -0x10010(%rbp),%rax
mov    %rax,-0x10038(%rbp)
lea    -0x10010(%rbp),%rdi
call   1030 <hexToStr@plt>
mov    -0x10038(%rbp),%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
lea    -0x10010(%rbp),%rdi
mov    $0x96,%esi
mov    $0x4,%edx
call   1060 <decompress@plt>
xor    %eax,%eax
add    $0x10040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10000,%rsp
lea    0xeb1(%rip),%rdi
mov    %rsp,%rbx
mov    $0x96,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1040 <compress@plt>
mov    %rbx,%rdi
call   1030 <hexToStr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x96,%esi
mov    $0x4,%edx
call   1060 <decompress@plt>
xor    %eax,%eax
add    $0x10000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [180 x i8] c"connect \22\\challenge\\984599813\\qport\\57203\\protocol\\69\\cl_voip\\0\\name\\TestName\\rate\\3000\\snaps\\20\\color1\\4\\color2\\5\\handi2cap\\100\\sex\\male\\cl_guid\\12345678901234567890123456789012\22\00"
@__const.main.inStr = [30 x i8] c"54 68 65 20 43 61 74\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [65536 x i8]
%3 = alloca [30 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%5 = call i32 @compress(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 150, i32 4, i8* %4)
%6 = bitcast [30 x i8]* %3 to i8*
%7 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%9 = call i32 @hexToStr(i8* %8)
%10 = call i32 @strcpy(i8* %7, i32 %9)
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%12 = call i32 @decompress(i8* %11, i32 150, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [180 x i8] c"connect \22\\challenge\\984599813\\qport\\57203\\protocol\\69\\cl_voip\\0\\name\\TestName\\rate\\3000\\snaps\\20\\color1\\4\\color2\\5\\handi2cap\\100\\sex\\male\\cl_guid\\12345678901234567890123456789012\22\00"
define i32 @main() {
%1 = alloca [65536 x i8]
%2 = getelementptr inbounds [65536 x i8], [65536 x i8]* %1, i64 0, i64 0
%3 = call i32 @compress(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 150, i32 4, i8* %2)
%4 = call i32 @hexToStr(i8* %2)
%5 = call i32 @strcpy(i8* %2, i32 %4)
%6 = call i32 @decompress(i8* %2, i32 150, i32 4)
ret i32 0
}