#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*/ ctfail();
int /*<<< orphan*/ ctlogpn(char *, int, char *, char *, ...);
char *readline(int);
int /*<<< orphan*/ strstr(char *, char *);
void ckrespsub(int fd, char *sub) {
  char *line;
  line = readline(fd);
  do
    if (!(strstr(line, sub))) {
      ctlogpn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/davies/beanstalkd/refs/heads/master/"
              "integ-test.c",
              224, "%s",
              "test: "
              "strstr(line, sub)");
      ctlogpn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/davies/beanstalkd/refs/heads/master/"
              "integ-test.c",
              224, "\"%s\" not in \"%s\"", sub, line);
      ctfail();
    }
  while (0);
}


x86 assembly (clang, -O0):
<ckrespsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readline@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%eax
jne    11bb <ckrespsub+0x7b>
lea    0xe88(%rip),%rdi
mov    $0xe0,%esi
lea    0xf07(%rip),%rdx
lea    0xf03(%rip),%rcx
mov    $0x0,%al
call   1040 <ctlogpn@plt>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe5f(%rip),%rdi
mov    $0xe0,%esi
lea    0xef9(%rip),%rdx
mov    $0x0,%al
call   1040 <ctlogpn@plt>
mov    $0x0,%al
call   1050 <ctfail@plt>
jmp    11c0 <ckrespsub+0x80>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckrespsub>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1030 <readline@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
test   %eax,%eax
je     1165 <ckrespsub+0x25>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe94(%rip),%r15
lea    0xf18(%rip),%rdx
lea    0xf14(%rip),%rcx
mov    %r15,%rdi
mov    $0xe0,%esi
xor    %eax,%eax
call   1040 <ctlogpn@plt>
lea    0xf16(%rip),%rdx
mov    %r15,%rdi
mov    $0xe0,%esi
mov    %r14,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <ctlogpn@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <ctfail@plt>

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/davies/beanstalkd/refs/heads/master/integ-test.c\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"test: strstr(line, sub)\00"
@.str.3 = [17 x i8] c"\22%s\22 not in \22%s\22\00"
define void @ckrespsub(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8* @readline(i32 %6)
store i8* %7, i8** %5
br label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i32 @strstr(i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %8
%14 = call i32 (i8*, i32, i8*, i8*, ...) @ctlogpn(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = call i32 (i8*, i32, i8*, i8*, ...) @ctlogpn(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %15, i8* %16)
%18 = call i32 (...) @ctfail()
br label %19
19: ; preds = %13, %8
br label %20
20: ; preds = %19
ret void
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/davies/beanstalkd/refs/heads/master/integ-test.c\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"test: strstr(line, sub)\00"
@.str.3 = [17 x i8] c"\22%s\22 not in \22%s\22\00"
define void @ckrespsub(i32 %0, i8* %1) {
%3 = tail call i8* @readline(i32 %0)
%4 = tail call i32 @strstr(i8* %3, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, i8*, ...) @ctlogpn(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (i8*, i32, i8*, i8*, ...) @ctlogpn(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %1, i8* %3)
%9 = tail call i32 (...) @ctfail()
br label %10
10: ; preds = %6, %2
ret void
}