#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*/ imprima(int *, int);
void recursEsp(int s[], int k, int m, int n) {
  if (m > n)
    imprima(s, k);
  else {
    s[k + 1] = m;
    recursEsp(s, k + 1, m + 1, n);
    recursEsp(s, k, m + 1, n);
  }
}


x86 assembly (clang, -O0):
<recursEsp>:
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    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1152 <recursEsp+0x32>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <imprima@plt>
jmp    1192 <recursEsp+0x72>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
call   1040 <recursEsp@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
call   1040 <recursEsp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursEsp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r12
cmp    %ecx,%edx
jg     116e <recursEsp+0x4e>
mov    %ecx,%r15d
mov    %edx,%ebp
lea    0x1(%r14),%eax
movslq %eax,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,(%r12,%r13,4)
lea    0x1(%rbp),%ebx
mov    %r12,%rdi
mov    %r13d,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
call   1040 <recursEsp@plt>
cmp    %r15d,%ebp
mov    %ebx,%ebp
jne    1150 <recursEsp+0x30>
mov    %r12,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <imprima@plt>

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

LLVM IR (-O2):
define void @recursEsp(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
br label %12
10: ; preds = %12, %4
%11 = tail call i32 @imprima(i32* %0, i32 %1)
ret void
12: ; preds = %6, %12
%13 = phi i32 [ %2, %6 ], [ %14, %12 ]
store i32 %13, i32* %9
%14 = add nsw i32 %13, 1
tail call void @recursEsp(i32* %0, i32 %7, i32 %14, i32 %3)
%15 = icmp eq i32 %13, %3
br i1 %15, label %10, label %12
}