#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*/ _exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           unsigned long long, char *);
int /*<<< orphan*/ stderr;
int str_len(char *);
void test_len(void) {
  if (str_len("") != 0)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/strtest.c"),
              (unsigned long long)(15), (("str_len return's bad length")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
  if (str_len("\0ahoj") != 0)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/strtest.c"),
              (unsigned long long)(16), (("str_len return's bad length")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
  if (str_len("a\0hoj") != 1)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/strtest.c"),
              (unsigned long long)(17), (("str_len return's bad length")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
  if (str_len("ahoj\0") != 4)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/strtest.c"),
              (unsigned long long)(18), (("str_len return's bad length")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
  if (str_len("ahoj") != 4)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/strtest.c"),
              (unsigned long long)(19), (("str_len return's bad length")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
}


x86 assembly (clang, -O0):
<test_len>:
push   %rbp
mov    %rsp,%rbp
lea    0xec1(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x0,%eax
je     119e <test_len+0x5e>
jmp    115e <test_len+0x1e>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
lea    0xe98(%rip),%rdx
mov    $0xf,%ecx
lea    0xf22(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
lea    0xf1f(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x0,%eax
je     11f8 <test_len+0xb8>
jmp    11b8 <test_len+0x78>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xe38(%rip),%rsi
lea    0xe3e(%rip),%rdx
mov    $0x10,%ecx
lea    0xec8(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
lea    0xecb(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x1,%eax
je     1252 <test_len+0x112>
jmp    1212 <test_len+0xd2>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
lea    0xde4(%rip),%rdx
mov    $0x11,%ecx
lea    0xe6e(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
lea    0xe77(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x4,%eax
je     12ac <test_len+0x16c>
jmp    126c <test_len+0x12c>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
lea    0xd84(%rip),%rsi
lea    0xd8a(%rip),%rdx
mov    $0x12,%ecx
lea    0xe14(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
lea    0xe0c(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x4,%eax
je     1306 <test_len+0x1c6>
jmp    12c6 <test_len+0x186>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0xd2a(%rip),%rsi
lea    0xd30(%rip),%rdx
mov    $0x13,%ecx
lea    0xdba(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_len>:
push   %rbx
lea    0xec4(%rip),%rdi
call   1060 <str_len@plt>
test   %eax,%eax
jne    119e <test_len+0x5e>
lea    0xf6c(%rip),%rdi
call   1060 <str_len@plt>
test   %eax,%eax
jne    11c6 <test_len+0x86>
lea    0xf62(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x1,%eax
jne    11eb <test_len+0xab>
lea    0xf57(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x4,%eax
jne    1210 <test_len+0xd0>
lea    0xf31(%rip),%rdi
call   1060 <str_len@plt>
cmp    $0x4,%eax
jne    1235 <test_len+0xf5>
pop    %rbx
ret
mov    0x2e3b(%rip),%rbx
mov    (%rbx),%edi
lea    0xe52(%rip),%rsi
lea    0xe58(%rip),%rdx
lea    0xee7(%rip),%r8
mov    $0xf,%ecx
jmp    1258 <test_len+0x118>
mov    0x2e13(%rip),%rbx
mov    (%rbx),%edi
lea    0xe2a(%rip),%rsi
lea    0xe30(%rip),%rdx
lea    0xebf(%rip),%r8
mov    $0x10,%ecx
jmp    1258 <test_len+0x118>
mov    0x2dee(%rip),%rbx
mov    (%rbx),%edi
lea    0xe05(%rip),%rsi
lea    0xe0b(%rip),%rdx
lea    0xe9a(%rip),%r8
mov    $0x11,%ecx
jmp    1258 <test_len+0x118>
mov    0x2dc9(%rip),%rbx
mov    (%rbx),%edi
lea    0xde0(%rip),%rsi
lea    0xde6(%rip),%rdx
lea    0xe75(%rip),%r8
mov    $0x12,%ecx
jmp    1258 <test_len+0x118>
mov    0x2da4(%rip),%rbx
mov    (%rbx),%edi
lea    0xdbb(%rip),%rsi
lea    0xdc1(%rip),%rdx
lea    0xe50(%rip),%r8
mov    $0x13,%ecx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.2 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/strtest.c\00"
@.str.3 = [28 x i8] c"str_len return's bad length\00"
@.str.4 = [6 x i8] c"\00ahoj\00"
@.str.5 = [6 x i8] c"a\00hoj\00"
@.str.6 = [6 x i8] c"ahoj\00\00"
@.str.7 = [5 x i8] c"ahoj\00"
define void @test_len() {
%1 = call i32 @str_len(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
br label %4
4: ; preds = %3
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 15, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = call i32 @_exit(i32 111)
unreachable
10: ; No predecessors!
br label %11
11: ; preds = %10, %0
%12 = call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 @fflush(i32 %18)
%20 = call i32 @_exit(i32 111)
unreachable
21: ; No predecessors!
br label %22
22: ; preds = %21, %11
%23 = call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp ne i32 %23, 1
br i1 %24, label %25, label %33
25: ; preds = %22
br label %26
26: ; preds = %25
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 @fflush(i32 %29)
%31 = call i32 @_exit(i32 111)
unreachable
32: ; No predecessors!
br label %33
33: ; preds = %32, %22
%34 = call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp ne i32 %34, 4
br i1 %35, label %36, label %44
36: ; preds = %33
br label %37
37: ; preds = %36
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 @fflush(i32 %40)
%42 = call i32 @_exit(i32 111)
unreachable
43: ; No predecessors!
br label %44
44: ; preds = %43, %33
%45 = call i32 @str_len(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%46 = icmp ne i32 %45, 4
br i1 %46, label %47, label %55
47: ; preds = %44
br label %48
48: ; preds = %47
%49 = load i32, i32* @stderr
%50 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%51 = load i32, i32* @stderr
%52 = call i32 @fflush(i32 %51)
%53 = call i32 @_exit(i32 111)
unreachable
54: ; No predecessors!
br label %55
55: ; preds = %54, %44
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.2 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/strtest.c\00"
@.str.3 = [28 x i8] c"str_len return's bad length\00"
@.str.4 = [6 x i8] c"\00ahoj\00"
@.str.5 = [6 x i8] c"a\00hoj\00"
@.str.6 = [6 x i8] c"ahoj\00\00"
@.str.7 = [5 x i8] c"ahoj\00"
define void @test_len() {
%1 = tail call i32 @str_len(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 15, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @_exit(i32 111)
unreachable
9: ; preds = %0
%10 = tail call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 @fflush(i32 %15)
%17 = tail call i32 @_exit(i32 111)
unreachable
18: ; preds = %9
%19 = tail call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 1
br i1 %20, label %27, label %21
21: ; preds = %18
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 @fflush(i32 %24)
%26 = tail call i32 @_exit(i32 111)
unreachable
27: ; preds = %18
%28 = tail call i32 @str_len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp eq i32 %28, 4
br i1 %29, label %36, label %30
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = tail call i32 @fflush(i32 %33)
%35 = tail call i32 @_exit(i32 111)
unreachable
36: ; preds = %27
%37 = tail call i32 @str_len(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp eq i32 %37, 4
br i1 %38, label %45, label %39
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 @fflush(i32 %42)
%44 = tail call i32 @_exit(i32 111)
unreachable
45: ; preds = %36
ret void
}