#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*/ addFailure(char *, long, char const *);
int /*<<< orphan*/ stdimpl_strcat(char *, char *);
int /*<<< orphan*/ stdimpl_strcpy(char *, char *);
int stdimpl_strlen(char const *);
int /*<<< orphan*/ stdimpl_strncat(char *, char const *, int);
void assertImplementationCStr(const char *expected, const char *actual,
                              long line, const char *file) {
  char buffer[64];
  int el;
  int al;
  if (expected) {
    el = stdimpl_strlen(expected);
  } else {
    el = 4;
    expected = "null";
  }
  if (actual) {
    al = stdimpl_strlen(actual);
  } else {
    al = 4;
    actual = "null";
  }
  if (el > ((64 - 11 - 1) / 2)) {
    if (al > ((64 - 11 - 1) / 2)) {
      al = ((64 - 11 - 1) / 2);
      el = ((64 - 11 - 1) / 2);
    } else {
      int w = ((64 - 11 - 1) / 2) + (((64 - 11 - 1) / 2) - al);
      if (el > w) {
        el = w;
      }
    }
  } else {
    int w = ((64 - 11 - 1) / 2) + (((64 - 11 - 1) / 2) - el);
    if (al > w) {
      al = w;
    }
  }
  stdimpl_strcpy(buffer, "exp \"");
  stdimpl_strncat(buffer, expected, el);
  stdimpl_strcat(buffer, "\" was \"");
  stdimpl_strncat(buffer, actual, al);
  stdimpl_strcat(buffer, "\"");
  addFailure(buffer, line, file);
}


x86 assembly (clang, -O0):
<assertImplementationCStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1184 <assertImplementationCStr+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <stdimpl_strlen@plt>
mov    %eax,-0x64(%rbp)
jmp    1196 <assertImplementationCStr+0x46>
movl   $0x4,-0x64(%rbp)
lea    0xe6e(%rip),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11b2 <assertImplementationCStr+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <stdimpl_strlen@plt>
mov    %eax,-0x68(%rbp)
jmp    11c4 <assertImplementationCStr+0x74>
movl   $0x4,-0x68(%rbp)
lea    0xe40(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1a,-0x64(%rbp)
jle    1215 <assertImplementationCStr+0xc5>
cmpl   $0x1a,-0x68(%rbp)
jle    11eb <assertImplementationCStr+0x9b>
movl   $0x1a,-0x68(%rbp)
movl   $0x1a,-0x64(%rbp)
jmp    1210 <assertImplementationCStr+0xc0>
mov    $0x1a,%eax
sub    -0x68(%rbp),%eax
add    $0x1a,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jle    120b <assertImplementationCStr+0xbb>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    1210 <assertImplementationCStr+0xc0>
jmp    123a <assertImplementationCStr+0xea>
mov    $0x1a,%eax
sub    -0x64(%rbp),%eax
add    $0x1a,%eax
mov    %eax,-0x70(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    1235 <assertImplementationCStr+0xe5>
mov    -0x70(%rbp),%eax
mov    %eax,-0x68(%rbp)
jmp    123a <assertImplementationCStr+0xea>
lea    -0x60(%rbp),%rdi
lea    0xdc0(%rip),%rsi
call   1070 <stdimpl_strcpy@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x64(%rbp),%edx
call   1050 <stdimpl_strncat@plt>
lea    -0x60(%rbp),%rdi
lea    0xda6(%rip),%rsi
call   1060 <stdimpl_strcat@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x68(%rbp),%edx
call   1050 <stdimpl_strncat@plt>
lea    -0x60(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1060 <stdimpl_strcat@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <addFailure@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertImplementationCStr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r12
test   %rdi,%rdi
mov    %rdx,0x8(%rsp)
je     119f <assertImplementationCStr+0x4f>
mov    %rdi,%r13
call   1030 <stdimpl_strlen@plt>
mov    %eax,%ebp
test   %r12,%r12
je     11ba <assertImplementationCStr+0x6a>
mov    %r12,%rdi
call   1030 <stdimpl_strlen@plt>
cmp    $0x1a,%ebp
jle    11e7 <assertImplementationCStr+0x97>
mov    $0x1a,%r14d
cmp    $0x1a,%eax
jle    11cb <assertImplementationCStr+0x7b>
mov    $0x1a,%ebx
jmp    11f6 <assertImplementationCStr+0xa6>
mov    $0x4,%ebp
lea    0xe55(%rip),%r13
test   %r12,%r12
je     11df <assertImplementationCStr+0x8f>
mov    %r12,%rdi
call   1030 <stdimpl_strlen@plt>
jmp    11e7 <assertImplementationCStr+0x97>
lea    0xe3f(%rip),%r12
mov    $0x4,%eax
cmp    $0x1a,%ebp
jle    11e7 <assertImplementationCStr+0x97>
mov    $0x34,%r14d
sub    %eax,%r14d
cmp    %r14d,%ebp
cmovle %ebp,%r14d
mov    %eax,%ebx
jmp    11f6 <assertImplementationCStr+0xa6>
mov    %r13,%r12
mov    $0x4,%eax
mov    $0x34,%ebx
sub    %ebp,%ebx
cmp    %ebx,%eax
cmovle %eax,%ebx
mov    %ebp,%r14d
lea    0xe08(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <stdimpl_strcpy@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
call   1050 <stdimpl_strncat@plt>
lea    0xdec(%rip),%rsi
mov    %rbp,%rdi
call   1060 <stdimpl_strcat@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1050 <stdimpl_strncat@plt>
lea    0xdce(%rip),%rsi
mov    %rbp,%rdi
call   1060 <stdimpl_strcat@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
call   1040 <addFailure@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
@.str.1 = [6 x i8] c"exp \22\00"
@.str.2 = [8 x i8] c"\22 was \22\00"
@.str.3 = [2 x i8] c"\22\00"
define void @assertImplementationCStr(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca [64 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = call i32 @stdimpl_strlen(i8* %17)
store i32 %18, i32* %10
br label %20
19: ; preds = %4
store i32 4, i32* %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5
br label %20
20: ; preds = %19, %16
%21 = load i8*, i8** %6
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i8*, i8** %6
%25 = call i32 @stdimpl_strlen(i8* %24)
store i32 %25, i32* %11
br label %27
26: ; preds = %20
store i32 4, i32* %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %10
%29 = icmp sgt i32 %28, 26
br i1 %29, label %30, label %45
30: ; preds = %27
%31 = load i32, i32* %11
%32 = icmp sgt i32 %31, 26
br i1 %32, label %33, label %34
33: ; preds = %30
store i32 26, i32* %11
store i32 26, i32* %10
br label %44
34: ; preds = %30
%35 = load i32, i32* %11
%36 = sub nsw i32 26, %35
%37 = add nsw i32 26, %36
store i32 %37, i32* %12
%38 = load i32, i32* %10
%39 = load i32, i32* %12
%40 = icmp sgt i32 %38, %39
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = load i32, i32* %12
store i32 %42, i32* %10
br label %43
43: ; preds = %41, %34
br label %44
44: ; preds = %43, %33
br label %55
45: ; preds = %27
%46 = load i32, i32* %10
%47 = sub nsw i32 26, %46
%48 = add nsw i32 26, %47
store i32 %48, i32* %13
%49 = load i32, i32* %11
%50 = load i32, i32* %13
%51 = icmp sgt i32 %49, %50
br i1 %51, label %52, label %54
52: ; preds = %45
%53 = load i32, i32* %13
store i32 %53, i32* %11
br label %54
54: ; preds = %52, %45
br label %55
55: ; preds = %54, %44
%56 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%57 = call i32 @stdimpl_strcpy(i8* %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%58 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%59 = load i8*, i8** %5
%60 = load i32, i32* %10
%61 = call i32 @stdimpl_strncat(i8* %58, i8* %59, i32 %60)
%62 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%63 = call i32 @stdimpl_strcat(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%64 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%65 = load i8*, i8** %6
%66 = load i32, i32* %11
%67 = call i32 @stdimpl_strncat(i8* %64, i8* %65, i32 %66)
%68 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%69 = call i32 @stdimpl_strcat(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%70 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%71 = load i64, i64* %7
%72 = load i8*, i8** %8
%73 = call i32 @addFailure(i8* %70, i64 %71, i8* %72)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
@.str.1 = [6 x i8] c"exp \22\00"
@.str.2 = [8 x i8] c"\22 was \22\00"
@.str.3 = [2 x i8] c"\22\00"
define void @assertImplementationCStr(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = icmp eq i8* %0, null
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @stdimpl_strlen(i8* %0)
%10 = icmp eq i8* %1, null
br i1 %10, label %18, label %15
11: ; preds = %4
%12 = icmp eq i8* %1, null
br i1 %12, label %28, label %13
13: ; preds = %11
%14 = tail call i32 @stdimpl_strlen(i8* %1)
br label %28
15: ; preds = %8
%16 = tail call i32 @stdimpl_strlen(i8* %1)
%17 = icmp sgt i32 %9, 26
br i1 %17, label %20, label %28
18: ; preds = %8
%19 = icmp sgt i32 %9, 26
br i1 %19, label %22, label %28
20: ; preds = %15
%21 = icmp sgt i32 %16, 26
br i1 %21, label %36, label %22
22: ; preds = %18, %20
%23 = phi i32 [ %16, %20 ], [ 4, %18 ]
%24 = phi i8* [ %1, %20 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %18 ]
%25 = sub i32 52, %23
%26 = icmp sgt i32 %9, %25
%27 = select i1 %26, i32 %25, i32 %9
br label %36
28: ; preds = %11, %13, %18, %15
%29 = phi i8* [ %0, %18 ], [ %0, %15 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %13 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %11 ]
%30 = phi i32 [ %9, %18 ], [ %9, %15 ], [ 4, %13 ], [ 4, %11 ]
%31 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %18 ], [ %1, %15 ], [ %1, %13 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %11 ]
%32 = phi i32 [ 4, %18 ], [ %16, %15 ], [ %14, %13 ], [ 4, %11 ]
%33 = sub i32 52, %30
%34 = icmp sgt i32 %32, %33
%35 = select i1 %34, i32 %33, i32 %32
br label %36
36: ; preds = %20, %22, %28
%37 = phi i8* [ %0, %22 ], [ %29, %28 ], [ %0, %20 ]
%38 = phi i8* [ %24, %22 ], [ %31, %28 ], [ %1, %20 ]
%39 = phi i32 [ %27, %22 ], [ %30, %28 ], [ 26, %20 ]
%40 = phi i32 [ %23, %22 ], [ %35, %28 ], [ 26, %20 ]
%41 = call i32 @stdimpl_strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @stdimpl_strncat(i8* %6, i8* %37, i32 %39)
%43 = call i32 @stdimpl_strcat(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @stdimpl_strncat(i8* %6, i8* %38, i32 %40)
%45 = call i32 @stdimpl_strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 @addFailure(i8* %6, i64 %2, i8* %3)
ret void
}