#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int check_blocks(int *, int, int *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(int *);
int *get_blocks(char *, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int *lower_blocks, *upper_blocks;
  int lower_num_blocks, upper_num_blocks;
  int rc = EXIT_SUCCESS;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s lower-file upper-file\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  lower_blocks = get_blocks(argv[1], &lower_num_blocks);
  if (!lower_blocks)
    exit(EXIT_FAILURE);
  upper_blocks = get_blocks(argv[2], &upper_num_blocks);
  if (!upper_blocks) {
    free(lower_blocks);
    exit(EXIT_FAILURE);
  }
  rc = check_blocks(lower_blocks, lower_num_blocks, upper_blocks,
                    upper_num_blocks);
  free(upper_blocks);
  free(lower_blocks);
  exit(rc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11a6 <main+0x56>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe6d(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <get_blocks@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11d4 <main+0x84>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <get_blocks@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    120b <main+0xbb>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
call   1050 <check_blocks@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1193 <main+0x43>
mov    0x8(%rbx),%rdi
lea    0xc(%rsp),%rsi
call   1040 <get_blocks@plt>
test   %rax,%rax
je     11ab <main+0x5b>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1040 <get_blocks@plt>
test   %rax,%rax
jne    11b9 <main+0x69>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    11ab <main+0x5b>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe5a(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ecx
mov    %r14,%rdi
mov    %rax,%rdx
call   1050 <check_blocks@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s lower-file upper-file\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* @EXIT_SUCCESS
store i32 %11, i32* %10
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @get_blocks(i8* %25, i32* %8)
store i32* %26, i32** %6
%27 = load i32*, i32** %6
%28 = icmp ne i32* %27, null
br i1 %28, label %32, label %29
29: ; preds = %22
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %22
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32* @get_blocks(i8* %35, i32* %9)
store i32* %36, i32** %7
%37 = load i32*, i32** %7
%38 = icmp ne i32* %37, null
br i1 %38, label %44, label %39
39: ; preds = %32
%40 = load i32*, i32** %6
%41 = call i32 @free(i32* %40)
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %32
%45 = load i32*, i32** %6
%46 = load i32, i32* %8
%47 = load i32*, i32** %7
%48 = load i32, i32* %9
%49 = call i32 @check_blocks(i32* %45, i32 %46, i32* %47, i32 %48)
store i32 %49, i32* %10
%50 = load i32*, i32** %7
%51 = call i32 @free(i32* %50)
%52 = load i32*, i32** %6
%53 = call i32 @free(i32* %52)
%54 = load i32, i32* %10
%55 = call i32 @exit(i32 %54)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s lower-file upper-file\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i32* @get_blocks(i8* %16, i32* %3)
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %14
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32* @get_blocks(i8* %24, i32* %4)
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = call i32 @free(i32* %17)
%29 = load i32, i32* @EXIT_FAILURE
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %22
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = call i32 @check_blocks(i32* %17, i32 %32, i32* %25, i32 %33)
%35 = call i32 @free(i32* %25)
%36 = call i32 @free(i32* %17)
%37 = call i32 @exit(i32 %34)
unreachable
}