#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*/ checkExtension(char *, char *);
size_t compile(char *);
int /*<<< orphan*/ printf(char *, char *);
int serialize(char *, size_t);
int __compile(char *filename) {
  size_t length;
  if (!checkExtension(filename, ".zzp")) {
    printf("Error: The file \"%s\" isn't zzp source code.", filename);
    return 1;
  }
  length = compile(filename);
  return length ? serialize(filename, length) : 1;
}


x86 assembly (clang, -O0):
<__compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <checkExtension@plt>
cmp    $0x0,%eax
jne    1181 <__compile+0x41>
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c1 <__compile+0x81>
mov    -0x10(%rbp),%rdi
call   1040 <compile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11ae <__compile+0x6e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <serialize@plt>
mov    %eax,-0x1c(%rbp)
jmp    11bb <__compile+0x7b>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bb <__compile+0x7b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__compile>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1060 <checkExtension@plt>
test   %eax,%eax
je     116d <__compile+0x2d>
mov    %rbx,%rdi
call   1040 <compile@plt>
test   %rax,%rax
je     117c <__compile+0x3c>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <serialize@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".zzp\00"
@.str.1 = [44 x i8] c"Error: The file \22%s\22 isn't zzp source code.\00"
define i32 @__compile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @checkExtension(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 1, i32* %2
br label %23
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i64 @compile(i8* %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i32 @serialize(i8* %17, i64 %18)
br label %21
20: ; preds = %11
br label %21
21: ; preds = %20, %16
%22 = phi i32 [ %19, %16 ], [ 1, %20 ]
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %8
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [5 x i8] c".zzp\00"
@.str.1 = [44 x i8] c"Error: The file \22%s\22 isn't zzp source code.\00"
define i32 @__compile(i8* %0) {
%2 = tail call i32 @checkExtension(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %11
6: ; preds = %1
%7 = tail call i64 @compile(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @serialize(i8* %0, i64 %7)
br label %11
11: ; preds = %9, %6, %4
%12 = phi i32 [ 1, %4 ], [ %10, %9 ], [ 1, %6 ]
ret i32 %12
}