#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*/ array(int *, int);
void wellOrderdStrings(int a[], int n, int k, int i) {
  int j;
  if (i == k) {
    array(a, k);
  } else if (i < k) {
    for (j = (i > 0) ? a[i - 1] + 1 : 1; j <= n; j++) {
      a[i] = j;
      wellOrderdStrings(a, n, k, i + 1);
    }
  }
}


x86 assembly (clang, -O0):
<wellOrderdStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1152 <wellOrderdStrings+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <array@plt>
jmp    11dd <wellOrderdStrings+0xbd>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d8 <wellOrderdStrings+0xb8>
cmpl   $0x0,-0x14(%rbp)
jle    1183 <wellOrderdStrings+0x63>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1190 <wellOrderdStrings+0x70>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1190 <wellOrderdStrings+0x70>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d3 <wellOrderdStrings+0xb3>
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
call   1040 <wellOrderdStrings@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1196 <wellOrderdStrings+0x76>
jmp    11d8 <wellOrderdStrings+0xb8>
jmp    11dd <wellOrderdStrings+0xbd>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wellOrderdStrings>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdi,%rbp
cmp    %edx,%ecx
jne    114e <wellOrderdStrings+0x2e>
mov    %rbp,%rdi
mov    %r12d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <array@plt>
jge    11b1 <wellOrderdStrings+0x91>
mov    %edx,%r13d
mov    %esi,%r14d
test   %r12d,%r12d
jle    116e <wellOrderdStrings+0x4e>
lea    -0x1(%r12),%eax
mov    0x0(%rbp,%rax,4),%ebx
add    $0x1,%ebx
cmp    %r14d,%ebx
jle    1178 <wellOrderdStrings+0x58>
jmp    11b1 <wellOrderdStrings+0x91>
mov    $0x1,%ebx
cmp    %r14d,%ebx
jg     11b1 <wellOrderdStrings+0x91>
movslq %r12d,%rax
mov    %rax,(%rsp)
add    $0x1,%r12d
lea    0x1(%r14),%r15d
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rax
mov    %ebx,0x0(%rbp,%rax,4)
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
call   1040 <wellOrderdStrings@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1190 <wellOrderdStrings+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @wellOrderdStrings(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = call i32 @array(i32* %14, i32 %15)
br label %55
17: ; preds = %4
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %54
21: ; preds = %17
%22 = load i32, i32* %8
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load i32*, i32** %5
%26 = load i32, i32* %8
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %25, i64 %28
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
br label %33
32: ; preds = %21
br label %33
33: ; preds = %32, %24
%34 = phi i32 [ %31, %24 ], [ 1, %32 ]
store i32 %34, i32* %9
br label %35
35: ; preds = %50, %33
%36 = load i32, i32* %9
%37 = load i32, i32* %6
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %53
39: ; preds = %35
%40 = load i32, i32* %9
%41 = load i32*, i32** %5
%42 = load i32, i32* %8
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
store i32 %40, i32* %44
%45 = load i32*, i32** %5
%46 = load i32, i32* %6
%47 = load i32, i32* %7
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
br label %50
50: ; preds = %39
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %35
53: ; preds = %35
br label %54
54: ; preds = %53, %17
br label %55
55: ; preds = %54, %13
ret void
}

LLVM IR (-O2):
define void @wellOrderdStrings(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, %2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @array(i32* %0, i32 %3)
br label %29
8: ; preds = %4
%9 = icmp slt i32 %3, %2
br i1 %9, label %10, label %29
10: ; preds = %8
%11 = icmp sgt i32 %3, 0
br i1 %11, label %12, label %18
12: ; preds = %10
%13 = add nsw i32 %3, -1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
br label %18
18: ; preds = %10, %12
%19 = phi i32 [ %17, %12 ], [ 1, %10 ]
%20 = icmp sgt i32 %19, %1
br i1 %20, label %29, label %21
21: ; preds = %18
%22 = sext i32 %3 to i64
%23 = getelementptr inbounds i32, i32* %0, i64 %22
%24 = add nsw i32 %3, 1
br label %25
25: ; preds = %21, %25
%26 = phi i32 [ %19, %21 ], [ %27, %25 ]
store i32 %26, i32* %23
tail call void @wellOrderdStrings(i32* %0, i32 %1, i32 %2, i32 %24)
%27 = add i32 %26, 1
%28 = icmp eq i32 %26, %1
br i1 %28, label %29, label %25
29: ; preds = %25, %18, %8, %6
ret void
}