#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*/ printf(char *, ...);
int test_convert_htmly_links_from_markdown();
int test_htmly_extract_header();
int test_htmly_to_zeroblog();
int test_markdown_to_zeroblog();
int test_replace_link();
int test_zeroblog_extract_value();
int test_zeroblog_remove_carriage_returns();
int test_zeroblog_to_markdown();
int test_zeronet_date_to_readable();
int main(int argc, char *argv[]) {
  int result;
  result = test_convert_htmly_links_from_markdown();
  if (result != 0) {
    printf("test_convert_htmly_links_from_markdown returned %d\n", result);
    return 1;
  }
  result = test_zeroblog_extract_value();
  if (result != 0) {
    printf("test_zeroblog_extract_value returned %d\n", result);
    return 2;
  }
  result = test_markdown_to_zeroblog();
  if (result != 0) {
    printf("test_markdown_to_zeroblog returned %d\n", result);
    return 3;
  }
  result = test_htmly_extract_header();
  if (result != 0) {
    printf("test_htmly_extract_header returned %d\n", result);
    return 4;
  }
  result = test_htmly_to_zeroblog();
  if (result != 0) {
    printf("test_htmly_to_zeroblog returned %d\n", result);
    return 5;
  }
  result = test_replace_link();
  if (result != 0) {
    printf("test_replace_link returned %d\n", result);
    return 6;
  }
  result = test_zeroblog_remove_carriage_returns();
  if (result != 0) {
    printf("test_zeroblog_remove_carriage_returns returned %d\n", result);
    return 7;
  }
  result = test_zeronet_date_to_readable();
  if (result != 0) {
    printf("test_zeronet_date_to_readable returned %d\n", result);
    return 8;
  }
  result = test_zeroblog_to_markdown();
  if (result != 0) {
    printf("test_zeroblog_to_markdown returned %d\n", result);
    return 9;
  }
  printf("All tests passed\n");
  return 0;
}


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   1090 <test_convert_htmly_links_from_markdown@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11e7 <main+0x47>
mov    -0x14(%rbp),%esi
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   1050 <test_zeroblog_extract_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1218 <main+0x78>
mov    -0x14(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   1030 <test_markdown_to_zeroblog@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1249 <main+0xa9>
mov    -0x14(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   10a0 <test_htmly_extract_header@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     127a <main+0xda>
mov    -0x14(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   1070 <test_htmly_to_zeroblog@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12ab <main+0x10b>
mov    -0x14(%rbp),%esi
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   10b0 <test_replace_link@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12dc <main+0x13c>
mov    -0x14(%rbp),%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x6,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   1080 <test_zeroblog_remove_carriage_returns@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     130d <main+0x16d>
mov    -0x14(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x7,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   1060 <test_zeronet_date_to_readable@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     133e <main+0x19e>
mov    -0x14(%rbp),%esi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8,-0x4(%rbp)
jmp    1384 <main+0x1e4>
mov    $0x0,%al
call   10c0 <test_zeroblog_to_markdown@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     136f <main+0x1cf>
mov    -0x14(%rbp),%esi
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x9,-0x4(%rbp)
jmp    1384 <main+0x1e4>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   10a0 <test_convert_htmly_links_from_markdown@plt>
test   %eax,%eax
je     11d6 <main+0x26>
lea    0xe3d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   1060 <test_zeroblog_extract_value@plt>
test   %eax,%eax
je     11fb <main+0x4b>
lea    0xe4c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   1040 <test_markdown_to_zeroblog@plt>
test   %eax,%eax
je     1220 <main+0x70>
lea    0xe50(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   10b0 <test_htmly_extract_header@plt>
test   %eax,%eax
je     1245 <main+0x95>
lea    0xe52(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   1080 <test_htmly_to_zeroblog@plt>
test   %eax,%eax
je     126a <main+0xba>
lea    0xe54(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   10c0 <test_replace_link@plt>
test   %eax,%eax
je     128c <main+0xdc>
lea    0xe53(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x6,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   1090 <test_zeroblog_remove_carriage_returns@plt>
test   %eax,%eax
je     12ae <main+0xfe>
lea    0xe50(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7,%ebx
jmp    1300 <main+0x150>
xor    %eax,%eax
call   1070 <test_zeronet_date_to_readable@plt>
test   %eax,%eax
je     12d0 <main+0x120>
lea    0xe61(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%ebx
jmp    1300 <main+0x150>
xor    %ebx,%ebx
xor    %eax,%eax
call   10d0 <test_zeroblog_to_markdown@plt>
test   %eax,%eax
je     12f4 <main+0x144>
lea    0xe68(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x9,%ebx
jmp    1300 <main+0x150>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"test_convert_htmly_links_from_markdown returned %d\0A\00"
@.str.1 = [41 x i8] c"test_zeroblog_extract_value returned %d\0A\00"
@.str.2 = [39 x i8] c"test_markdown_to_zeroblog returned %d\0A\00"
@.str.3 = [39 x i8] c"test_htmly_extract_header returned %d\0A\00"
@.str.4 = [36 x i8] c"test_htmly_to_zeroblog returned %d\0A\00"
@.str.5 = [31 x i8] c"test_replace_link returned %d\0A\00"
@.str.6 = [51 x i8] c"test_zeroblog_remove_carriage_returns returned %d\0A\00"
@.str.7 = [43 x i8] c"test_zeronet_date_to_readable returned %d\0A\00"
@.str.8 = [39 x i8] c"test_zeroblog_to_markdown returned %d\0A\00"
@.str.9 = [18 x i8] c"All tests 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 (...) @test_convert_htmly_links_from_markdown()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 1, i32* %3
br label %71
13: ; preds = %2
%14 = call i32 (...) @test_zeroblog_extract_value()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %18)
store i32 2, i32* %3
br label %71
20: ; preds = %13
%21 = call i32 (...) @test_markdown_to_zeroblog()
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %25)
store i32 3, i32* %3
br label %71
27: ; preds = %20
%28 = call i32 (...) @test_htmly_extract_header()
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %32)
store i32 4, i32* %3
br label %71
34: ; preds = %27
%35 = call i32 (...) @test_htmly_to_zeroblog()
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %39)
store i32 5, i32* %3
br label %71
41: ; preds = %34
%42 = call i32 (...) @test_replace_link()
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %46)
store i32 6, i32* %3
br label %71
48: ; preds = %41
%49 = call i32 (...) @test_zeroblog_remove_carriage_returns()
store i32 %49, i32* %6
%50 = load i32, i32* %6
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* %6
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0), i32 %53)
store i32 7, i32* %3
br label %71
55: ; preds = %48
%56 = call i32 (...) @test_zeronet_date_to_readable()
store i32 %56, i32* %6
%57 = load i32, i32* %6
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i32, i32* %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %60)
store i32 8, i32* %3
br label %71
62: ; preds = %55
%63 = call i32 (...) @test_zeroblog_to_markdown()
store i32 %63, i32* %6
%64 = load i32, i32* %6
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = load i32, i32* %6
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %67)
store i32 9, i32* %3
br label %71
69: ; preds = %62
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %3
br label %71
71: ; preds = %69, %66, %59, %52, %45, %38, %31, %24, %17, %10
%72 = load i32, i32* %3
ret i32 %72
}

LLVM IR (-O2):
@.str = [52 x i8] c"test_convert_htmly_links_from_markdown returned %d\0A\00"
@.str.1 = [41 x i8] c"test_zeroblog_extract_value returned %d\0A\00"
@.str.2 = [39 x i8] c"test_markdown_to_zeroblog returned %d\0A\00"
@.str.3 = [39 x i8] c"test_htmly_extract_header returned %d\0A\00"
@.str.4 = [36 x i8] c"test_htmly_to_zeroblog returned %d\0A\00"
@.str.5 = [31 x i8] c"test_replace_link returned %d\0A\00"
@.str.6 = [51 x i8] c"test_zeroblog_remove_carriage_returns returned %d\0A\00"
@.str.7 = [43 x i8] c"test_zeronet_date_to_readable returned %d\0A\00"
@.str.8 = [39 x i8] c"test_zeroblog_to_markdown returned %d\0A\00"
@str = [17 x i8] c"All tests passed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_convert_htmly_links_from_markdown()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %49
7: ; preds = %2
%8 = tail call i32 (...) @test_zeroblog_extract_value()
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %49
12: ; preds = %7
%13 = tail call i32 (...) @test_markdown_to_zeroblog()
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %49
17: ; preds = %12
%18 = tail call i32 (...) @test_htmly_extract_header()
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %18)
br label %49
22: ; preds = %17
%23 = tail call i32 (...) @test_htmly_to_zeroblog()
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %49
27: ; preds = %22
%28 = tail call i32 (...) @test_replace_link()
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %28)
br label %49
32: ; preds = %27
%33 = tail call i32 (...) @test_zeroblog_remove_carriage_returns()
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0), i32 %33)
br label %49
37: ; preds = %32
%38 = tail call i32 (...) @test_zeronet_date_to_readable()
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %38)
br label %49
42: ; preds = %37
%43 = tail call i32 (...) @test_zeroblog_to_markdown()
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %43)
br label %49
47: ; preds = %42
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %49
49: ; preds = %47, %45, %40, %35, %30, %25, %20, %15, %10, %5
%50 = phi i32 [ 1, %5 ], [ 2, %10 ], [ 3, %15 ], [ 4, %20 ], [ 5, %25 ], [ 6, %30 ], [ 7, %35 ], [ 8, %40 ], [ 9, %45 ], [ 0, %47 ]
ret i32 %50
}