#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 expression {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_expression(struct expression *);
struct expression *parse_file(char const *);
int /*<<< orphan*/ run_test_belief_propagation(struct expression *,
                                               char const *);
int /*<<< orphan*/ run_test_loopy_belief_propagation(struct expression *,
                                                     char const *);
void run_tests_with_file(const char *file_name, unsigned int num_iterations) {
  unsigned int i;
  struct expression *expr;
  expr = parse_file(file_name);
  for (i = 0; i < num_iterations; ++i) {
    run_test_belief_propagation(expr, file_name);
  }
  for (i = 0; i < num_iterations; ++i) {
    run_test_loopy_belief_propagation(expr, file_name);
  }
  delete_expression(expr);
}


x86 assembly (clang, -O0):
<run_tests_with_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <parse_file@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    118a <run_tests_with_file+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <run_test_belief_propagation@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <run_tests_with_file+0x23>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11b8 <run_tests_with_file+0x78>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <run_test_loopy_belief_propagation@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1191 <run_tests_with_file+0x51>
mov    -0x18(%rbp),%rdi
call   1060 <delete_expression@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests_with_file>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <parse_file@plt>
mov    %rax,%r15
test   %ebx,%ebx
je     1190 <run_tests_with_file+0x50>
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <run_test_belief_propagation@plt>
add    $0xffffffff,%ebp
jne    1160 <run_tests_with_file+0x20>
test   %ebx,%ebx
je     1190 <run_tests_with_file+0x50>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <run_test_loopy_belief_propagation@plt>
add    $0xffffffff,%ebx
jne    1180 <run_tests_with_file+0x40>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <delete_expression@plt>

LLVM IR (-O0):
%struct.expression = type { i32 }
define void @run_tests_with_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.expression*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call %struct.expression* @parse_file(i8* %7)
store %struct.expression* %8, %struct.expression** %6
store i32 0, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load %struct.expression*, %struct.expression** %6
%15 = load i8*, i8** %3
%16 = call i32 @run_test_belief_propagation(%struct.expression* %14, i8* %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
store i32 0, i32* %5
br label %21
21: ; preds = %29, %20
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = icmp ult i32 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load %struct.expression*, %struct.expression** %6
%27 = load i8*, i8** %3
%28 = call i32 @run_test_loopy_belief_propagation(%struct.expression* %26, i8* %27)
br label %29
29: ; preds = %25
%30 = load i32, i32* %5
%31 = add i32 %30, 1
store i32 %31, i32* %5
br label %21
32: ; preds = %21
%33 = load %struct.expression*, %struct.expression** %6
%34 = call i32 @delete_expression(%struct.expression* %33)
ret void
}

LLVM IR (-O2):
%struct.expression = type { i32 }
define void @run_tests_with_file(i8* %0, i32 %1) {
%3 = tail call %struct.expression* @parse_file(i8* %0)
%4 = icmp eq i32 %1, 0
br i1 %4, label %16, label %6
5: ; preds = %6
br i1 %4, label %16, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @run_test_belief_propagation(%struct.expression* %3, i8* %0)
%9 = add nuw i32 %7, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %5, label %6
11: ; preds = %5, %11
%12 = phi i32 [ %14, %11 ], [ 0, %5 ]
%13 = tail call i32 @run_test_loopy_belief_propagation(%struct.expression* %3, i8* %0)
%14 = add nuw i32 %12, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %11
16: ; preds = %11, %2, %5
%17 = tail call i32 @delete_expression(%struct.expression* %3)
ret void
}