#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*/ printf(char *, char *, ...);
int t0_bin_write_read_check();
int t1_bin_write_read_check_multiple();
int t2_write_read_check();
int t3_write_read_check_multiple();
int t4_write_all_log();
int t5_all_tests_on_static();
int main(int argc, char **argv) {
  int ret;
  ret = t0_bin_write_read_check();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           566 - 2, ret);
    goto test_fail;
  }
  ret = t1_bin_write_read_check_multiple();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           572 - 2, ret);
    goto test_fail;
  }
  ret = t2_write_read_check();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           578 - 2, ret);
    goto test_fail;
  }
  ret = t3_write_read_check_multiple();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           584 - 2, ret);
    goto test_fail;
  }
  ret = t4_write_all_log();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           590 - 2, ret);
    goto test_fail;
  }
  ret = t5_all_tests_on_static();
  if (ret < 0) {
    printf("%s:%i FAILED ret = %i\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
           "kernel-tests/smd/smem_log_test.c",
           596 - 2, ret);
    goto test_fail;
  }
  printf("%s: PASSED\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/"
         "kernel-tests/smd/smem_log_test.c");
test_fail:
  exit(ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10a0 <t0_bin_write_read_check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11cc <main+0x4c>
mov    -0x14(%rbp),%ecx
lea    0xe4c(%rip),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x234,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
mov    $0x0,%al
call   1070 <t1_bin_write_read_check_multiple@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1202 <main+0x82>
mov    -0x14(%rbp),%ecx
lea    0xe16(%rip),%rdi
lea    0xe26(%rip),%rsi
mov    $0x23a,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
mov    $0x0,%al
call   1090 <t2_write_read_check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1238 <main+0xb8>
mov    -0x14(%rbp),%ecx
lea    0xde0(%rip),%rdi
lea    0xdf0(%rip),%rsi
mov    $0x240,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
mov    $0x0,%al
call   1030 <t3_write_read_check_multiple@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    126e <main+0xee>
mov    -0x14(%rbp),%ecx
lea    0xdaa(%rip),%rdi
lea    0xdba(%rip),%rsi
mov    $0x246,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
mov    $0x0,%al
call   1050 <t4_write_all_log@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12a4 <main+0x124>
mov    -0x14(%rbp),%ecx
lea    0xd74(%rip),%rdi
lea    0xd84(%rip),%rsi
mov    $0x24c,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
mov    $0x0,%al
call   1040 <t5_all_tests_on_static@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12da <main+0x15a>
mov    -0x14(%rbp),%ecx
lea    0xd3e(%rip),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x252,%edx
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x16f>
lea    0xdd3(%rip),%rdi
lea    0xd2f(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   10a0 <t0_bin_write_read_check@plt>
test   %eax,%eax
jns    11a6 <main+0x26>
mov    %eax,%ebx
lea    0xe6b(%rip),%rdi
lea    0xe7b(%rip),%rsi
mov    $0x234,%edx
jmp    1251 <main+0xd1>
xor    %eax,%eax
call   1070 <t1_bin_write_read_check_multiple@plt>
test   %eax,%eax
jns    11cb <main+0x4b>
mov    %eax,%ebx
lea    0xe46(%rip),%rdi
lea    0xe56(%rip),%rsi
mov    $0x23a,%edx
jmp    1251 <main+0xd1>
xor    %eax,%eax
call   1090 <t2_write_read_check@plt>
test   %eax,%eax
jns    11ed <main+0x6d>
mov    %eax,%ebx
lea    0xe21(%rip),%rdi
lea    0xe31(%rip),%rsi
mov    $0x240,%edx
jmp    1251 <main+0xd1>
xor    %eax,%eax
call   1030 <t3_write_read_check_multiple@plt>
test   %eax,%eax
jns    120f <main+0x8f>
mov    %eax,%ebx
lea    0xdff(%rip),%rdi
lea    0xe0f(%rip),%rsi
mov    $0x246,%edx
jmp    1251 <main+0xd1>
xor    %eax,%eax
call   1050 <t4_write_all_log@plt>
test   %eax,%eax
jns    1231 <main+0xb1>
mov    %eax,%ebx
lea    0xddd(%rip),%rdi
lea    0xded(%rip),%rsi
mov    $0x24c,%edx
jmp    1251 <main+0xd1>
xor    %eax,%eax
call   1040 <t5_all_tests_on_static@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1261 <main+0xe1>
lea    0xdbb(%rip),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x252,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1080 <exit@plt>
lea    0xe4c(%rip),%rdi
lea    0xda8(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s:%i FAILED ret = %i\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/kernel-tests/smd/smem_log_test.c\00"
@.str.2 = [12 x i8] c"%s: PASSED\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @t0_bin_write_read_check()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 564, i32 %11)
br label %50
13: ; preds = %2
%14 = call i32 (...) @t1_bin_write_read_check_multiple()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 570, i32 %18)
br label %50
20: ; preds = %13
%21 = call i32 (...) @t2_write_read_check()
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %6
%26 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 576, i32 %25)
br label %50
27: ; preds = %20
%28 = call i32 (...) @t3_write_read_check_multiple()
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* %6
%33 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 582, i32 %32)
br label %50
34: ; preds = %27
%35 = call i32 (...) @t4_write_all_log()
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %6
%40 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 588, i32 %39)
br label %50
41: ; preds = %34
%42 = call i32 (...) @t5_all_tests_on_static()
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* %6
%47 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 594, i32 %46)
br label %50
48: ; preds = %41
%49 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0))
br label %50
50: ; preds = %48, %45, %38, %31, %24, %17, %10
%51 = load i32, i32* %6
%52 = call i32 @exit(i32 %51)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s:%i FAILED ret = %i\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eliot-shao/qcom/refs/heads/master/kernel-tests/smd/smem_log_test.c\00"
@.str.2 = [12 x i8] c"%s: PASSED\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @t0_bin_write_read_check()
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 564, i32 %3)
br label %34
7: ; preds = %2
%8 = tail call i32 (...) @t1_bin_write_read_check_multiple()
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 570, i32 %8)
br label %34
12: ; preds = %7
%13 = tail call i32 (...) @t2_write_read_check()
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 576, i32 %13)
br label %34
17: ; preds = %12
%18 = tail call i32 (...) @t3_write_read_check_multiple()
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 582, i32 %18)
br label %34
22: ; preds = %17
%23 = tail call i32 (...) @t4_write_all_log()
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 588, i32 %23)
br label %34
27: ; preds = %22
%28 = tail call i32 (...) @t5_all_tests_on_static()
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 594, i32 %28)
br label %34
32: ; preds = %27
%33 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %30, %25, %20, %15, %10, %5
%35 = phi i32 [ %3, %5 ], [ %8, %10 ], [ %13, %15 ], [ %18, %20 ], [ %23, %25 ], [ %28, %30 ], [ %28, %32 ]
%36 = tail call i32 @exit(i32 %35)
unreachable
}