#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);
scalar_t__ strcmp(char *, char *);
void ckresp(int fd, char *exp) {
  char *line;
  line = readline(fd);
  do
    if (!(strcmp(exp, line) == 0)) {
      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",
              214, "%s",
              "test: "
              "strcmp(exp, line) == 0");
      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",
              214, "\"%s\" != \"%s\"", exp, line);
      ctfail();
    }
  while (0);
}


x86 assembly (clang, -O0):
<ckresp>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11bc <ckresp+0x7c>
lea    0xe87(%rip),%rdi
mov    $0xd6,%esi
lea    0xf06(%rip),%rdx
lea    0xf02(%rip),%rcx
mov    $0x0,%al
call   1050 <ctlogpn@plt>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe5e(%rip),%rdi
mov    $0xd6,%esi
lea    0xefd(%rip),%rdx
mov    $0x0,%al
call   1050 <ctlogpn@plt>
mov    $0x0,%al
call   1060 <ctfail@plt>
jmp    11c1 <ckresp+0x81>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckresp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1030 <readline@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ac <ckresp+0x6c>
lea    0xe99(%rip),%r15
lea    0xf1d(%rip),%rdx
lea    0xf19(%rip),%rcx
mov    %r15,%rdi
mov    $0xd6,%esi
xor    %eax,%eax
call   1050 <ctlogpn@plt>
lea    0xf20(%rip),%rdx
mov    %r15,%rdi
mov    $0xd6,%esi
mov    %r14,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1050 <ctlogpn@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <ctfail@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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 = [29 x i8] c"test: strcmp(exp, line) == 0\00"
@.str.3 = [13 x i8] c"\22%s\22 != \22%s\22\00"
define void @ckresp(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** %4
%10 = load i8*, i8** %5
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 %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 214, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 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 214, i8* getelementptr inbounds ([13 x i8], [13 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 = [29 x i8] c"test: strcmp(exp, line) == 0\00"
@.str.3 = [13 x i8] c"\22%s\22 != \22%s\22\00"
define void @ckresp(i32 %0, i8* %1) {
%3 = tail call i8* @readline(i32 %0)
%4 = tail call i64 @strcmp(i8* %1, i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
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 214, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 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 214, i8* getelementptr inbounds ([13 x i8], [13 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
}