int slop_encode_str(int buf, int crc, char *s) {
  if (s == 0)
    deb_err(249,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/xtforever/xtcw/refs/heads/master/"
            "network-engine/slop4.c",
            __FUNCTION__, "");
  while (*s)
    crc = slop_encode(buf, crc, *s++);
  return crc;
}


x86 assembly (clang, -O0):
<slop_encode_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115e <slop_encode_str+0x3e>
mov    $0xf9,%edi
lea    0xeb7(%rip),%rsi
lea    0xf42(%rip),%rdx
lea    0xf3a(%rip),%rcx
mov    $0x0,%al
call   1030 <deb_err@plt>
jmp    1163 <slop_encode_str+0x43>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1197 <slop_encode_str+0x77>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edx
mov    $0x0,%al
call   1040 <slop_encode@plt>
mov    %eax,-0x8(%rbp)
jmp    1163 <slop_encode_str+0x43>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slop_encode_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
test   %rdx,%rdx
jne    1152 <slop_encode_str+0x32>
lea    0xec8(%rip),%rsi
lea    0xf53(%rip),%rdx
lea    0xf4b(%rip),%rcx
mov    $0xf9,%edi
xor    %eax,%eax
call   1030 <deb_err@plt>
mov    (%rbx),%al
test   %al,%al
je     117c <slop_encode_str+0x5c>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edx
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <slop_encode@plt>
mov    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <slop_encode_str+0x40>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/xtforever/xtcw/refs/heads/master/network-engine/slop4.c\00"
@__FUNCTION__.slop_encode_str = [16 x i8] c"slop_encode_str\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @slop_encode_str(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @deb_err to i32 (i32, i8*, i8*, i8*, ...)*)(i32 249, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.slop_encode_str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
br label %12
12: ; preds = %16, %11
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %6
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @slop_encode to i32 (i32, i32, i32, ...)*)(i32 %17, i32 %18, i32 %22)
store i32 %23, i32* %5
br label %12
24: ; preds = %12
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/xtforever/xtcw/refs/heads/master/network-engine/slop4.c\00"
@__FUNCTION__.slop_encode_str = [16 x i8] c"slop_encode_str\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @slop_encode_str(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @deb_err to i32 (i32, i8*, i8*, i8*, ...)*)(i32 249, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.slop_encode_str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %7, %10
%11 = phi i8 [ %17, %10 ], [ %8, %7 ]
%12 = phi i8* [ %14, %10 ], [ %2, %7 ]
%13 = phi i32 [ %16, %10 ], [ %1, %7 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = sext i8 %11 to i32
%16 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @slop_encode to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %13, i32 %15)
%17 = load i8, i8* %14
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %7
%20 = phi i32 [ %1, %7 ], [ %16, %10 ]
ret i32 %20
}