void unpack_receive_string_test(int _i __attribute__((unused))) {
  tcase_fn_start(""
                 "unpack_receive_string_test",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/DistributedClocks/CVector/"
                 "refs/heads/master/src/test/cvec_test.c",
                 202);
  {
    char *filename = "testLog";
    struct vcLog *testLog = init_cvector("Proc1", filename);
    int bufferLen = 256;
    char *expected = "Test";
    char input[] = {0xa5, 0x50, 0x72, 0x6f, 0x63, 0x31, 0xc4, 0x04, 0x54, 0x65,
                    0x73, 0x74, 0x81, 0xa5, 0x50, 0x72, 0x6f, 0x63, 0x31, 0x02};
    int contentLen;
    char *result = unpack_receive(testLog, "Unpacking String.", input,
                                  bufferLen, &contentLen);
    do {
      const char *_ck_x = (result);
      const char *_ck_y = (expected);
      const char *_ck_x_s;
      const char *_ck_y_s;
      const char *_ck_x_q;
      const char *_ck_y_q;
      if (_ck_x != ((void *)0)) {
        _ck_x_q = "\"";
        _ck_x_s = _ck_x;
      } else {
        _ck_x_q = "";
        _ck_x_s = "(null)";
      }
      if (_ck_y != ((void *)0)) {
        _ck_y_q = "\"";
        _ck_y_s = _ck_y;
      } else {
        _ck_y_q = "";
        _ck_y_s = "(null)";
      }
      ((0 && (_ck_x == ((void *)0)) && (_ck_y == ((void *)0))) ||
       (0 && ((_ck_x == ((void *)0)) || (_ck_y == ((void *)0))) &&
        (_ck_x != _ck_y)) ||
       ((_ck_x != ((void *)0)) && (_ck_y != ((void *)0)) &&
        (0 == strcmp(_ck_y, _ck_x))))
          ? _mark_point(
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/DistributedClocks/CVector/"
                "refs/heads/master/src/test/cvec_test.c",
                210)
          : _ck_assert_failed(
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/DistributedClocks/CVector/"
                "refs/heads/master/src/test/cvec_test.c",
                210,
                "Assertion '"
                "(0 && (_ck_x == NULL) && (_ck_y == NULL)) || (0 && ((_ck_x == "
                "NULL) || (_ck_y == NULL)) && (_ck_x != _ck_y)) || ((_ck_x != "
                "NULL) && (_ck_y != NULL) && (0 == strcmp(_ck_y, _ck_x)))"
                "' failed",
                "Assertion '%s' failed: %s == %s%s%s, %s == %s%s%s",
                "result"
                " "
                "=="
                " "
                "expected",
                "result", _ck_x_q, _ck_x_s, _ck_x_q, "expected", _ck_y_q,
                _ck_y_s, _ck_y_q, ((void *)0));
    } while (0);
    test_write(testLog, "Unpacking String.\n");
  }
}


x86 assembly (clang, -O0):
<unpack_receive_string_test>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %edi,-0x2c(%rbp)
lea    0xe72(%rip),%rdi
lea    0xe86(%rip),%rsi
mov    $0xca,%edx
mov    $0x0,%al
call   1030 <tcase_fn_start@plt>
lea    0xf0e(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1090 <init_cvector@plt>
cltq
mov    %rax,-0x40(%rbp)
movl   $0x100,-0x44(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x1033(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x1030(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x102e(%rip),%eax
mov    %eax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    -0x44(%rbp),%ecx
lea    0xec2(%rip),%rsi
lea    -0x74(%rbp),%r8
mov    $0x0,%al
call   1060 <unpack_receive@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     125d <unpack_receive_string_test+0xed>
lea    0xe98(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x98(%rbp)
jmp    1279 <unpack_receive_string_test+0x109>
lea    0xfa5(%rip),%rax
mov    %rax,-0xa8(%rbp)
lea    0xe6b(%rip),%rax
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x90(%rbp)
je     12a8 <unpack_receive_string_test+0x138>
lea    0xe4d(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
jmp    12c4 <unpack_receive_string_test+0x154>
lea    0xf5a(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    0xe20(%rip),%rax
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     1317 <unpack_receive_string_test+0x1a7>
cmpq   $0x0,-0x90(%rbp)
je     1317 <unpack_receive_string_test+0x1a7>
mov    -0x90(%rbp),%rdi
mov    -0x88(%rbp),%rsi
call   1070 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1317 <unpack_receive_string_test+0x1a7>
lea    0xd15(%rip),%rdi
mov    $0xd2,%esi
mov    $0x0,%al
call   1080 <_mark_point@plt>
jmp    13a5 <unpack_receive_string_test+0x235>
mov    -0xa8(%rbp),%r12
mov    -0x98(%rbp),%r15
mov    -0xa8(%rbp),%r14
mov    -0xb0(%rbp),%r11
mov    -0xa0(%rbp),%r10
mov    -0xb0(%rbp),%rax
lea    0xcd3(%rip),%rdi
mov    $0xd2,%esi
lea    0xd90(%rip),%rdx
lea    0xe50(%rip),%rcx
lea    0xe7b(%rip),%r8
lea    0xe87(%rip),%r9
lea    0xe77(%rip),%rbx
xor    %r13d,%r13d
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
movq   $0x0,0x38(%rsp)
mov    $0x0,%al
call   1050 <_ck_assert_failed@plt>
mov    -0x40(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1040 <test_write@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_receive_string_test>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe7e(%rip),%rdi
lea    0xe92(%rip),%rsi
mov    $0xca,%edx
xor    %eax,%eax
call   1030 <tcase_fn_start@plt>
lea    0xf22(%rip),%rdi
lea    0xf13(%rip),%rsi
xor    %eax,%eax
call   1090 <init_cvector@plt>
movslq %eax,%r14
movaps 0x105c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x231636f,0x20(%rsp)
02
lea    0xf01(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
mov    %r14,%rdi
mov    $0x100,%ecx
xor    %eax,%eax
call   1060 <unpack_receive@plt>
movslq %eax,%rsi
lea    0xef2(%rip),%r15
test   %esi,%esi
cmovne %rsi,%r15
lea    0x1011(%rip),%rbx
lea    0xedc(%rip),%r12
cmovne %r12,%rbx
je     1215 <unpack_receive_string_test+0xa5>
lea    0xeb8(%rip),%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1266 <unpack_receive_string_test+0xf6>
lea    0xea8(%rip),%r10
lea    0xfc4(%rip),%r11
lea    0xdf1(%rip),%rdi
lea    0xeb3(%rip),%rdx
lea    0xf73(%rip),%rcx
lea    0xf9e(%rip),%r8
lea    0xfaa(%rip),%r9
mov    $0xd2,%esi
xor    %eax,%eax
push   $0x0
push   %r12
push   %r10
push   %r12
push   %r11
push   %rbx
push   %r15
push   %rbx
call   1050 <_ck_assert_failed@plt>
add    $0x40,%rsp
jmp    1279 <unpack_receive_string_test+0x109>
lea    0xdae(%rip),%rdi
mov    $0xd2,%esi
xor    %eax,%eax
call   1080 <_mark_point@plt>
lea    0xf77(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <test_write@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.vcLog = type opaque
@.str = [27 x i8] c"unpack_receive_string_test\00"
@.str.1 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DistributedClocks/CVector/refs/heads/master/src/test/cvec_test.c\00"
@.str.2 = [8 x i8] c"testLog\00"
@.str.3 = [6 x i8] c"Proc1\00"
@.str.4 = [5 x i8] c"Test\00"
@__const.unpack_receive_string_test.input = [20 x i8] c"\A5Proc1\C4\04Test\81\A5Proc1\02"
@.str.5 = [18 x i8] c"Unpacking String.\00"
@.str.6 = [2 x i8] c"\22\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [7 x i8] c"(null)\00"
@.str.9 = [199 x i8] c"Assertion '(0 && (_ck_x == NULL) && (_ck_y == NULL)) || (0 && ((_ck_x == NULL) || (_ck_y == NULL)) && (_ck_x != _ck_y)) || ((_ck_x != NULL) && (_ck_y != NULL) && (0 == strcmp(_ck_y, _ck_x)))' failed\00"
@.str.10 = [50 x i8] c"Assertion '%s' failed: %s == %s%s%s, %s == %s%s%s\00"
@.str.11 = [19 x i8] c"result == expected\00"
@.str.12 = [7 x i8] c"result\00"
@.str.13 = [9 x i8] c"expected\00"
@.str.14 = [19 x i8] c"Unpacking String.\0A\00"
define void @unpack_receive_string_test(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.vcLog*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [20 x i8]
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i32 %0, i32* %2
%16 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @tcase_fn_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 202)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %3
%17 = load i8*, i8** %3
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @init_cvector to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to %struct.vcLog*
store %struct.vcLog* %20, %struct.vcLog** %4
store i32 256, i32* %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %6
%21 = bitcast [20 x i8]* %7 to i8*
%22 = load %struct.vcLog*, %struct.vcLog** %4
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%24 = load i32, i32* %5
%25 = call i32 (%struct.vcLog*, i8*, i8*, i32, i32*, ...) bitcast (i32 (...)* @unpack_receive to i32 (%struct.vcLog*, i8*, i8*, i32, i32*, ...)*)(%struct.vcLog* %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %23, i32 %24, i32* %8)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %9
br label %28
28: ; preds = %1
%29 = load i8*, i8** %9
store i8* %29, i8** %10
%30 = load i8*, i8** %6
store i8* %30, i8** %11
%31 = load i8*, i8** %10
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %35
33: ; preds = %28
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %14
%34 = load i8*, i8** %10
store i8* %34, i8** %12
br label %36
35: ; preds = %28
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %12
br label %36
36: ; preds = %35, %33
%37 = load i8*, i8** %11
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %41
39: ; preds = %36
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %15
%40 = load i8*, i8** %11
store i8* %40, i8** %13
br label %42
41: ; preds = %36
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %13
br label %42
42: ; preds = %41, %39
%43 = load i8*, i8** %10
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %55
45: ; preds = %42
%46 = load i8*, i8** %11
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %55
48: ; preds = %45
%49 = load i8*, i8** %11
%50 = load i8*, i8** %10
%51 = call i32 @strcmp(i8* %49, i8* %50)
%52 = icmp eq i32 0, %51
br i1 %52, label %53, label %55
53: ; preds = %48
%54 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_mark_point to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 210)
br label %63
55: ; preds = %48, %45, %42
%56 = load i8*, i8** %14
%57 = load i8*, i8** %12
%58 = load i8*, i8** %14
%59 = load i8*, i8** %15
%60 = load i8*, i8** %13
%61 = load i8*, i8** %15
%62 = call i32 (i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_ck_assert_failed to i32 (i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %56, i8* %57, i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %59, i8* %60, i8* %61, i8* null)
br label %63
63: ; preds = %55, %53
%64 = phi i32 [ %54, %53 ], [ %62, %55 ]
br label %65
65: ; preds = %63
%66 = load %struct.vcLog*, %struct.vcLog** %4
%67 = call i32 (%struct.vcLog*, i8*, ...) bitcast (i32 (...)* @test_write to i32 (%struct.vcLog*, i8*, ...)*)(%struct.vcLog* %66, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.vcLog = type opaque
@.str = [27 x i8] c"unpack_receive_string_test\00"
@.str.1 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DistributedClocks/CVector/refs/heads/master/src/test/cvec_test.c\00"
@.str.2 = [8 x i8] c"testLog\00"
@.str.3 = [6 x i8] c"Proc1\00"
@.str.4 = [5 x i8] c"Test\00"
@__const.unpack_receive_string_test.input = [20 x i8] c"\A5Proc1\C4\04Test\81\A5Proc1\02"
@.str.5 = [18 x i8] c"Unpacking String.\00"
@.str.6 = [2 x i8] c"\22\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [7 x i8] c"(null)\00"
@.str.9 = [199 x i8] c"Assertion '(0 && (_ck_x == NULL) && (_ck_y == NULL)) || (0 && ((_ck_x == NULL) || (_ck_y == NULL)) && (_ck_x != _ck_y)) || ((_ck_x != NULL) && (_ck_y != NULL) && (0 == strcmp(_ck_y, _ck_x)))' failed\00"
@.str.10 = [50 x i8] c"Assertion '%s' failed: %s == %s%s%s, %s == %s%s%s\00"
@.str.11 = [19 x i8] c"result == expected\00"
@.str.12 = [7 x i8] c"result\00"
@.str.13 = [9 x i8] c"expected\00"
@.str.14 = [19 x i8] c"Unpacking String.\0A\00"
define void @unpack_receive_string_test(i32 %0) {
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @tcase_fn_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 202)
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @init_cvector to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.vcLog*
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = bitcast i32* %3 to i8*
%10 = call i32 (%struct.vcLog*, i8*, i8*, i32, i32*, ...) bitcast (i32 (...)* @unpack_receive to i32 (%struct.vcLog*, i8*, i8*, i32, i32*, ...)*)(%struct.vcLog* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %8, i32 256, i32* %3)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = icmp eq i32 %10, 0
%14 = select i1 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %12
%15 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
br i1 %13, label %21, label %16
16: ; preds = %1
%17 = call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_mark_point to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 210)
br label %23
21: ; preds = %16, %1
%22 = call i32 (i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_ck_assert_failed to i32 (i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.1, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %15, i8* %14, i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
br label %23
23: ; preds = %21, %19
%24 = call i32 (%struct.vcLog*, i8*, ...) bitcast (i32 (...)* @test_write to i32 (%struct.vcLog*, i8*, ...)*)(%struct.vcLog* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
ret void
}