#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 atoi(char *);
int /*<<< orphan*/ brute(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc < 3)
    return 1;
  int depth = atoi(argv[2]);
  int len = atoi(argv[1]);
  while (len <= depth)
    brute(argv[1], 0, len++);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    119e <main+0x7e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1197 <main+0x77>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
xor    %esi,%esi
call   1030 <brute@plt>
jmp    116c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     11a0 <main+0x80>
mov    %rsi,%r14
mov    0x10(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
mov    0x8(%r14),%r12
mov    %r12,%rdi
call   1040 <atoi@plt>
xor    %ebp,%ebp
cmp    %r15d,%eax
jg     11a0 <main+0x80>
mov    %eax,%ebx
xor    %ebp,%ebp
mov    %r12,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <brute@plt>
cmp    %r15d,%ebx
je     11a0 <main+0x80>
add    $0x1,%ebx
neg    %r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%r14),%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <brute@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1180 <main+0x60>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = icmp sgt i32 %10, %7
br i1 %11, label %21, label %12
12: ; preds = %4
%13 = tail call i32 @brute(i8* %9, i32 0, i32 %10)
%14 = icmp eq i32 %10, %7
br i1 %14, label %21, label %15
15: ; preds = %12, %15
%16 = phi i32 [ %17, %15 ], [ %10, %12 ]
%17 = add i32 %16, 1
%18 = load i8*, i8** %8
%19 = tail call i32 @brute(i8* %18, i32 0, i32 %17)
%20 = icmp eq i32 %17, %7
br i1 %20, label %21, label %15
21: ; preds = %15, %12, %4, %2
%22 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 0, %12 ], [ 0, %15 ]
ret i32 %22
}