#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*/ receive_sndd(unsigned char *);
int /*<<< orphan*/ xprintf(char *);
int blofeld_file_sysex(void *buffer, int len) {
  unsigned char *buf = buffer;
  xprintf("Blofeld read sound dump from file\n");
  if (len <= 2 || buf[2] != 0x13 || buf[4] != 0x10)
    return -1;
  receive_sndd(buf);
}


x86 assembly (clang, -O0):
<blofeld_file_sysex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xec2(%rip),%rdi
call   1040 <xprintf@plt>
cmpl   $0x2,-0x14(%rbp)
jle    116f <blofeld_file_sysex+0x4f>
mov    -0x20(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x13,%eax
jne    116f <blofeld_file_sysex+0x4f>
mov    -0x20(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x10,%eax
je     117b <blofeld_file_sysex+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <blofeld_file_sysex+0x64>
mov    -0x20(%rbp),%rdi
call   1030 <receive_sndd@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blofeld_file_sysex>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1040 <xprintf@plt>
cmp    $0x3,%ebp
jl     114d <blofeld_file_sysex+0x2d>
cmpb   $0x13,0x2(%rbx)
jne    114d <blofeld_file_sysex+0x2d>
cmpb   $0x10,0x4(%rbx)
jne    114d <blofeld_file_sysex+0x2d>
mov    %rbx,%rdi
call   1030 <receive_sndd@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Blofeld read sound dump from file\0A\00"
define i32 @blofeld_file_sysex(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
store i8* %7, i8** %6
%8 = call i32 @xprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 2
br i1 %10, label %23, label %11
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp ne i32 %15, 19
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 16
br i1 %22, label %23, label %24
23: ; preds = %17, %11, %2
store i32 -1, i32* %3
br label %27
24: ; preds = %17
%25 = load i8*, i8** %6
%26 = call i32 @receive_sndd(i8* %25)
br label %27
27: ; preds = %24, %23
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [35 x i8] c"Blofeld read sound dump from file\0A\00"
define i32 @blofeld_file_sysex(i8* %0, i32 %1) {
%3 = tail call i32 @xprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i32 %1, 3
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 19
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 16
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i32 @receive_sndd(i8* %0)
br label %15
15: ; preds = %2, %5, %9, %13
ret i32 -1
}