#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 */
struct frameset {
  int dummy;
};

/* Variables and functions */
struct frameset *frameset_from_anm(unsigned char const *, size_t);
struct frameset *frameset_from_fbx(unsigned char const *, size_t);
scalar_t__ strcmpi(char const *, char *);
struct frameset *frameset_from_mem_buf(const unsigned char *data, size_t sz,
                                       const char *hint) {
  if (strcmpi(hint, "fbx") == 0)
    return frameset_from_fbx(data, sz);
  if (strcmpi(hint, "anm") == 0)
    return frameset_from_anm(data, sz);
  return 0;
}


x86 assembly (clang, -O0):
<frameset_from_mem_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x0,%rax
jne    1174 <frameset_from_mem_buf+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <frameset_from_fbx@plt>
mov    %rax,-0x8(%rbp)
jmp    11ac <frameset_from_mem_buf+0x7c>
mov    -0x20(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x0,%rax
jne    11a4 <frameset_from_mem_buf+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <frameset_from_anm@plt>
mov    %rax,-0x8(%rbp)
jmp    11ac <frameset_from_mem_buf+0x7c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frameset_from_mem_buf>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebb(%rip),%rsi
mov    %rdx,%rdi
call   1050 <strcmpi@plt>
test   %rax,%rax
je     116e <frameset_from_mem_buf+0x3e>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmpi@plt>
test   %rax,%rax
je     117e <frameset_from_mem_buf+0x4e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <frameset_from_fbx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <frameset_from_anm@plt>

LLVM IR (-O0):
%struct.frameset = type { i32 }
@.str = [4 x i8] c"fbx\00"
@.str.1 = [4 x i8] c"anm\00"
define %struct.frameset* @frameset_from_mem_buf(i8* %0, i64 %1, i8* %2) {
%4 = alloca %struct.frameset*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = call i64 @strcmpi(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call %struct.frameset* @frameset_from_fbx(i8* %12, i64 %13)
store %struct.frameset* %14, %struct.frameset** %4
br label %24
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = call i64 @strcmpi(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = load i64, i64* %6
%22 = call %struct.frameset* @frameset_from_anm(i8* %20, i64 %21)
store %struct.frameset* %22, %struct.frameset** %4
br label %24
23: ; preds = %15
store %struct.frameset* null, %struct.frameset** %4
br label %24
24: ; preds = %23, %19, %11
%25 = load %struct.frameset*, %struct.frameset** %4
ret %struct.frameset* %25
}

LLVM IR (-O2):
%struct.frameset = type { i32 }
@.str = [4 x i8] c"fbx\00"
@.str.1 = [4 x i8] c"anm\00"
define %struct.frameset* @frameset_from_mem_buf(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strcmpi(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call %struct.frameset* @frameset_from_fbx(i8* %0, i64 %1)
br label %13
8: ; preds = %3
%9 = tail call i64 @strcmpi(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call %struct.frameset* @frameset_from_anm(i8* %0, i64 %1)
br label %13
13: ; preds = %8, %11, %6
%14 = phi %struct.frameset* [ %7, %6 ], [ %12, %11 ], [ null, %8 ]
ret %struct.frameset* %14
}