#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 */
struct utest {
  int dummy;
};
struct context {
  int dummy;
};
struct constraint {
  int dummy;
};

/* Variables and functions */
scalar_t__ context_findIdx(struct context *, struct constraint const *);
struct constraint *context_getAt(struct context *, int, int);
struct constraint const *context_getIdx(struct context *, int /*<<< orphan*/);
struct constraint *context_getInc(struct context *, int, int);
int /*<<< orphan*/ ut_trace(struct context *, int, int,
                            struct constraint const *,
                            struct constraint const *);
int /*<<< orphan*/ utest_test(struct utest *, int, char *, char *, int);
void ut_testNul(struct utest *utest, struct context *cxt, int i, int j) {
  const struct constraint *cst1 = context_getAt(cxt, i, j);
  const struct constraint *cst2 = context_getInc(cxt, i, j);
  utest_test(
      utest,
      (cst1 == cst2 && cst1 == context_getIdx(cxt, 0) &&
       0 == context_findIdx(cxt, cst1)),
      "cst1 == cst2 && cst1 == context_getIdx(cxt,0) && 0 == "
      "context_findIdx(cxt, cst1)",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/jbakosi/ndiff/refs/heads/master/src/context.c",
      521);
  if (cst1 != cst2)
    ut_trace(cxt, i, j, cst1, cst2);
}


x86 assembly (clang, -O0):
<ut_testNul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1070 <context_getAt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <context_getInc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x29(%rbp)
jne    11fa <ut_testNul+0x9a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <context_getIdx@plt>
mov    -0x40(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x29(%rbp)
jne    11fa <ut_testNul+0x9a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <context_findIdx@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xdf3(%rip),%rdx
lea    0xe3d(%rip),%rcx
mov    $0x209,%r8d
call   1080 <utest_test@plt>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1244 <ut_testNul+0xe4>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <ut_trace@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_testNul>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %rsi,%r12
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1070 <context_getAt@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <context_getInc@plt>
cmp    %rax,%r15
je     11d6 <ut_testNul+0x76>
mov    %rax,%r13
lea    0xe61(%rip),%rdx
lea    0xeab(%rip),%rcx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x209,%r8d
call   1080 <utest_test@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r13,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <ut_trace@plt>
xor    %ebx,%ebx
mov    %r12,%rdi
xor    %esi,%esi
call   1060 <context_getIdx@plt>
cmp    %rax,%r15
jne    11fa <ut_testNul+0x9a>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <context_findIdx@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xdff(%rip),%rdx
lea    0xe49(%rip),%rcx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x209,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <utest_test@plt>

LLVM IR (-O0):
%struct.utest = type { i32 }
%struct.context = type { i32 }
%struct.constraint = type { i32 }
@.str = [81 x i8] c"cst1 == cst2 && cst1 == context_getIdx(cxt,0) && 0 == context_findIdx(cxt, cst1)\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jbakosi/ndiff/refs/heads/master/src/context.c\00"
define void @ut_testNul(%struct.utest* %0, %struct.context* %1, i32 %2, i32 %3) {
%5 = alloca %struct.utest*
%6 = alloca %struct.context*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.constraint*
%10 = alloca %struct.constraint*
store %struct.utest* %0, %struct.utest** %5
store %struct.context* %1, %struct.context** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load %struct.context*, %struct.context** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call %struct.constraint* @context_getAt(%struct.context* %11, i32 %12, i32 %13)
store %struct.constraint* %14, %struct.constraint** %9
%15 = load %struct.context*, %struct.context** %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call %struct.constraint* @context_getInc(%struct.context* %15, i32 %16, i32 %17)
store %struct.constraint* %18, %struct.constraint** %10
%19 = load %struct.utest*, %struct.utest** %5
%20 = load %struct.constraint*, %struct.constraint** %9
%21 = load %struct.constraint*, %struct.constraint** %10
%22 = icmp eq %struct.constraint* %20, %21
br i1 %22, label %23, label %33
23: ; preds = %4
%24 = load %struct.constraint*, %struct.constraint** %9
%25 = load %struct.context*, %struct.context** %6
%26 = call %struct.constraint* @context_getIdx(%struct.context* %25, i32 0)
%27 = icmp eq %struct.constraint* %24, %26
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = load %struct.context*, %struct.context** %6
%30 = load %struct.constraint*, %struct.constraint** %9
%31 = call i64 @context_findIdx(%struct.context* %29, %struct.constraint* %30)
%32 = icmp eq i64 0, %31
br label %33
33: ; preds = %28, %23, %4
%34 = phi i1 [ false, %23 ], [ false, %4 ], [ %32, %28 ]
%35 = zext i1 %34 to i32
%36 = call i32 @utest_test(%struct.utest* %19, i32 %35, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 521)
%37 = load %struct.constraint*, %struct.constraint** %9
%38 = load %struct.constraint*, %struct.constraint** %10
%39 = icmp ne %struct.constraint* %37, %38
br i1 %39, label %40, label %47
40: ; preds = %33
%41 = load %struct.context*, %struct.context** %6
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = load %struct.constraint*, %struct.constraint** %9
%45 = load %struct.constraint*, %struct.constraint** %10
%46 = call i32 @ut_trace(%struct.context* %41, i32 %42, i32 %43, %struct.constraint* %44, %struct.constraint* %45)
br label %47
47: ; preds = %40, %33
ret void
}

LLVM IR (-O2):
%struct.utest = type { i32 }
%struct.context = type { i32 }
%struct.constraint = type { i32 }
@.str = [81 x i8] c"cst1 == cst2 && cst1 == context_getIdx(cxt,0) && 0 == context_findIdx(cxt, cst1)\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jbakosi/ndiff/refs/heads/master/src/context.c\00"
define void @ut_testNul(%struct.utest* %0, %struct.context* %1, i32 %2, i32 %3) {
%5 = tail call %struct.constraint* @context_getAt(%struct.context* %1, i32 %2, i32 %3)
%6 = tail call %struct.constraint* @context_getInc(%struct.context* %1, i32 %2, i32 %3)
%7 = icmp eq %struct.constraint* %5, %6
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = tail call %struct.constraint* @context_getIdx(%struct.context* %1, i32 0)
%10 = icmp eq %struct.constraint* %5, %9
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = tail call i64 @context_findIdx(%struct.context* %1, %struct.constraint* %5)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %11, %8
%16 = phi i32 [ %14, %11 ], [ 0, %8 ]
%17 = tail call i32 @utest_test(%struct.utest* %0, i32 %16, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 521)
br label %21
18: ; preds = %4
%19 = tail call i32 @utest_test(%struct.utest* %0, i32 0, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 521)
%20 = tail call i32 @ut_trace(%struct.context* %1, i32 %2, i32 %3, %struct.constraint* %5, %struct.constraint* %6)
br label %21
21: ; preds = %15, %18
ret void
}