#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 int64_t;

/* Variables and functions */
int /*<<< orphan*/ BruteForce(char *, int /*<<< orphan*/, int, char *, int);
int /*<<< orphan*/ Free(char *, int /*<<< orphan*/);
scalar_t__ Malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void Brute(int max_k, char *alpha, int alpha_size) {
  int64_t x;
  char *buf = (char *)Malloc((max_k + 1) * sizeof(char));
  for (x = max_k; x <= max_k; ++x) {
    x = max_k;
    memset(buf, 0, max_k + 1);
    BruteForce(buf, 0, x, alpha, alpha_size);
  }
  Free(buf, 0);
}


x86 assembly (clang, -O0):
<Brute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <Malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11b6 <Brute+0x76>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
xor    %esi,%esi
call   1050 <BruteForce@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <Brute+0x2f>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1060 <Free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Brute>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%r12d
lea    0x1(%r12),%ebx
mov    %ebx,%edi
call   1030 <Malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <memset@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1050 <BruteForce@plt>
mov    %rbp,%rdi
xor    %esi,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <Free@plt>

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

LLVM IR (-O2):
define void @Brute(i32 %0, i8* %1, i32 %2) {
%4 = add nsw i32 %0, 1
%5 = tail call i64 @Malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memset(i8* %6, i32 0, i32 %4)
%8 = tail call i32 @BruteForce(i8* %6, i32 0, i32 %0, i8* %1, i32 %2)
%9 = tail call i32 @Free(i8* %6, i32 0)
ret void
}