#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*/ mps_lib_assert_fail(char *, int, char *);
size_t StringLength(const char *s) {
  size_t i;
  do {
    if (s != NULL)
      do {
      } while (0);
    else
      mps_lib_assert_fail("/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/"
                          "hornet/refs/heads/master/mps/mpm.c",
                          575, ("s != NULL"));
  } while (0);
  for (i = 0; s[i] != '\0'; i++)
    do {
    } while (0);
  return (i);
}


x86 assembly (clang, -O0):
<StringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <StringLength+0x26>
jmp    112c <StringLength+0x1c>
jmp    1131 <StringLength+0x21>
jmp    114e <StringLength+0x3e>
lea    0xec3(%rip),%rdi
mov    $0x23f,%esi
lea    0xf3c(%rip),%rdx
call   1030 <mps_lib_assert_fail@plt>
jmp    1153 <StringLength+0x43>
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1190 <StringLength+0x80>
jmp    1175 <StringLength+0x65>
jmp    117a <StringLength+0x6a>
jmp    117f <StringLength+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    115b <StringLength+0x4b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringLength>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1131 <StringLength+0x21>
lea    0xee0(%rip),%rdi
lea    0xf5e(%rip),%rdx
mov    $0x23f,%esi
call   1030 <mps_lib_assert_fail@plt>
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rbx,%rax,1)
lea    0x1(%rax),%rax
jne    1140 <StringLength+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/hornet/refs/heads/master/mps/mpm.c\00"
@.str.1 = [10 x i8] c"s != NULL\00"
define i64 @StringLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
br label %4
4: ; preds = %1
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
br label %12
10: ; preds = %4
%11 = call i32 @mps_lib_assert_fail(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %9
br label %13
13: ; preds = %12
store i64 0, i64* %3
br label %14
14: ; preds = %24, %13
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %14
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
%25 = load i64, i64* %3
%26 = add i64 %25, 1
store i64 %26, i64* %3
br label %14
27: ; preds = %14
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/hornet/refs/heads/master/mps/mpm.c\00"
@.str.1 = [10 x i8] c"s != NULL\00"
define i64 @StringLength(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @mps_lib_assert_fail(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
br label %6
6: ; preds = %5, %6
%7 = phi i64 [ %11, %6 ], [ 0, %5 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add i64 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
ret i64 %7
}