#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bmw_small_expand1(int, int /*<<< orphan*/ *, void const *,
                                     void const *);
int /*<<< orphan*/ bmw_small_expand2(int, int /*<<< orphan*/ *, void const *,
                                     void const *);
void bmw_small_f1(uint32_t *q, const void *m, const void *h) {
  uint8_t i;
  q[16] = bmw_small_expand1(0, q, m, h);
  q[17] = bmw_small_expand1(1, q, m, h);
  for (i = 2; i < 16; ++i) {
    q[16 + i] = bmw_small_expand2(i, q, m, h);
  }
}


x86 assembly (clang, -O0):
<bmw_small_f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1040 <bmw_small_expand1@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x40(%rax)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1040 <bmw_small_expand1@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x44(%rax)
movl   $0x2,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    11b4 <bmw_small_f1+0x94>
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x10,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1176 <bmw_small_f1+0x56>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmw_small_f1>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <bmw_small_expand1@plt>
mov    %eax,0x40(%rbx)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <bmw_small_expand1@plt>
mov    %eax,0x44(%rbx)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x48(%rbx)
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x4c(%rbx)
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x50(%rbx)
mov    $0x5,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x54(%rbx)
mov    $0x6,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x58(%rbx)
mov    $0x7,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x5c(%rbx)
mov    $0x8,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x60(%rbx)
mov    $0x9,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x64(%rbx)
mov    $0xa,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x68(%rbx)
mov    $0xb,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x6c(%rbx)
mov    $0xc,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x70(%rbx)
mov    $0xd,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x74(%rbx)
mov    $0xe,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x78(%rbx)
mov    $0xf,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <bmw_small_expand2@plt>
mov    %eax,0x7c(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bmw_small_f1(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @bmw_small_expand1(i32 0, i32* %8, i8* %9, i8* %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 16
store i32 %11, i32* %13
%14 = load i32*, i32** %4
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @bmw_small_expand1(i32 1, i32* %14, i8* %15, i8* %16)
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 17
store i32 %17, i32* %19
store i32 2, i32* %7
br label %20
20: ; preds = %34, %3
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 16
br i1 %22, label %23, label %37
23: ; preds = %20
%24 = load i32, i32* %7
%25 = load i32*, i32** %4
%26 = load i8*, i8** %5
%27 = load i8*, i8** %6
%28 = call i32 @bmw_small_expand2(i32 %24, i32* %25, i8* %26, i8* %27)
%29 = load i32*, i32** %4
%30 = load i32, i32* %7
%31 = add nsw i32 16, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
store i32 %28, i32* %33
br label %34
34: ; preds = %23
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %20
37: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @bmw_small_f1(i32* %0, i8* %1, i8* %2) {
%4 = tail call i32 @bmw_small_expand1(i32 0, i32* %0, i8* %1, i8* %2)
%5 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %4, i32* %5
%6 = tail call i32 @bmw_small_expand1(i32 1, i32* %0, i8* %1, i8* %2)
%7 = getelementptr inbounds i32, i32* %0, i64 17
store i32 %6, i32* %7
%8 = tail call i32 @bmw_small_expand2(i32 2, i32* %0, i8* %1, i8* %2)
%9 = getelementptr inbounds i32, i32* %0, i64 18
store i32 %8, i32* %9
%10 = tail call i32 @bmw_small_expand2(i32 3, i32* %0, i8* %1, i8* %2)
%11 = getelementptr inbounds i32, i32* %0, i64 19
store i32 %10, i32* %11
%12 = tail call i32 @bmw_small_expand2(i32 4, i32* %0, i8* %1, i8* %2)
%13 = getelementptr inbounds i32, i32* %0, i64 20
store i32 %12, i32* %13
%14 = tail call i32 @bmw_small_expand2(i32 5, i32* %0, i8* %1, i8* %2)
%15 = getelementptr inbounds i32, i32* %0, i64 21
store i32 %14, i32* %15
%16 = tail call i32 @bmw_small_expand2(i32 6, i32* %0, i8* %1, i8* %2)
%17 = getelementptr inbounds i32, i32* %0, i64 22
store i32 %16, i32* %17
%18 = tail call i32 @bmw_small_expand2(i32 7, i32* %0, i8* %1, i8* %2)
%19 = getelementptr inbounds i32, i32* %0, i64 23
store i32 %18, i32* %19
%20 = tail call i32 @bmw_small_expand2(i32 8, i32* %0, i8* %1, i8* %2)
%21 = getelementptr inbounds i32, i32* %0, i64 24
store i32 %20, i32* %21
%22 = tail call i32 @bmw_small_expand2(i32 9, i32* %0, i8* %1, i8* %2)
%23 = getelementptr inbounds i32, i32* %0, i64 25
store i32 %22, i32* %23
%24 = tail call i32 @bmw_small_expand2(i32 10, i32* %0, i8* %1, i8* %2)
%25 = getelementptr inbounds i32, i32* %0, i64 26
store i32 %24, i32* %25
%26 = tail call i32 @bmw_small_expand2(i32 11, i32* %0, i8* %1, i8* %2)
%27 = getelementptr inbounds i32, i32* %0, i64 27
store i32 %26, i32* %27
%28 = tail call i32 @bmw_small_expand2(i32 12, i32* %0, i8* %1, i8* %2)
%29 = getelementptr inbounds i32, i32* %0, i64 28
store i32 %28, i32* %29
%30 = tail call i32 @bmw_small_expand2(i32 13, i32* %0, i8* %1, i8* %2)
%31 = getelementptr inbounds i32, i32* %0, i64 29
store i32 %30, i32* %31
%32 = tail call i32 @bmw_small_expand2(i32 14, i32* %0, i8* %1, i8* %2)
%33 = getelementptr inbounds i32, i32* %0, i64 30
store i32 %32, i32* %33
%34 = tail call i32 @bmw_small_expand2(i32 15, i32* %0, i8* %1, i8* %2)
%35 = getelementptr inbounds i32, i32* %0, i64 31
store i32 %34, i32* %35
ret void
}