#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char get_dic(char);
void create_dic(FILE *fp_out, int start, char *str, char *sol, int n,
                long int tot) {
  int i = 0;
  char dic = ' ';
  if (i >= n)
    return;
  for (i = start; i < n; i++) {
    dic = get_dic(str[i]);
    if (dic != ' ') {
      sol[i] = dic;
      fprintf(fp_out, "%s\n", sol);
      create_dic(fp_out, i + 1, str, sol, n, tot);
      sol[i] = str[i];
    }
  }
}


x86 assembly (clang, -O0):
<create_dic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movb   $0x20,-0x35(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     116b <create_dic+0x3b>
jmp    1208 <create_dic+0xd8>
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1208 <create_dic+0xd8>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <get_dic@plt>
mov    %al,-0x35(%rbp)
movsbl -0x35(%rbp),%eax
cmp    $0x20,%eax
je     11f5 <create_dic+0xc5>
mov    -0x35(%rbp),%dl
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe45(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x34(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1030 <create_dic@plt>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    11fa <create_dic+0xca>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1171 <create_dic+0x41>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dic>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
test   %r8d,%r8d
jle    11bf <create_dic+0x8f>
mov    %r8d,%r15d
cmp    %r8d,%esi
jge    11bf <create_dic+0x8f>
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rdi,%r12
movslq %esi,%r13
jmp    11a4 <create_dic+0x74>
nopw   0x0(%rax,%rax,1)
mov    %al,(%rbx,%r13,1)
mov    %r12,%rdi
lea    0xe92(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
lea    0x1(%r13),%r14
mov    %r12,%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r15d,%r8d
mov    (%rsp),%r9
call   1030 <create_dic@plt>
movzbl 0x0(%rbp,%r13,1),%eax
mov    %al,(%rbx,%r13,1)
mov    %r14,%r13
cmp    %r15d,%r14d
je     11bf <create_dic+0x8f>
movsbl 0x0(%rbp,%r13,1),%edi
call   1050 <get_dic@plt>
cmp    $0x20,%al
jne    1160 <create_dic+0x30>
add    $0x1,%r13
mov    %r13d,%r14d
cmp    %r15d,%r14d
jne    11a4 <create_dic+0x74>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @create_dic(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i8
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i64 %5, i64* %12
store i32 0, i32* %13
store i8 32, i8* %14
%15 = load i32, i32* %13
%16 = load i32, i32* %11
%17 = icmp sge i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %6
br label %64
19: ; preds = %6
%20 = load i32, i32* %8
store i32 %20, i32* %13
br label %21
21: ; preds = %61, %19
%22 = load i32, i32* %13
%23 = load i32, i32* %11
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %64
25: ; preds = %21
%26 = load i8*, i8** %9
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = call signext i8 @get_dic(i8 signext %30)
store i8 %31, i8* %14
%32 = load i8, i8* %14
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 32
br i1 %34, label %35, label %60
35: ; preds = %25
%36 = load i8, i8* %14
%37 = load i8*, i8** %10
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
store i8 %36, i8* %40
%41 = load i32*, i32** %7
%42 = load i8*, i8** %10
%43 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %42)
%44 = load i32*, i32** %7
%45 = load i32, i32* %13
%46 = add nsw i32 %45, 1
%47 = load i8*, i8** %9
%48 = load i8*, i8** %10
%49 = load i32, i32* %11
%50 = load i64, i64* %12
%51 = load i8*, i8** %9
%52 = load i32, i32* %13
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
%55 = load i8, i8* %54
%56 = load i8*, i8** %10
%57 = load i32, i32* %13
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %56, i64 %58
store i8 %55, i8* %59
br label %60
60: ; preds = %35, %25
br label %61
61: ; preds = %60
%62 = load i32, i32* %13
%63 = add nsw i32 %62, 1
store i32 %63, i32* %13
br label %21
64: ; preds = %18, %21
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @create_dic(i32* nocapture %0, i32 %1, i8* nocapture %2, i8* %3, i32 %4, i64 %5) {
%7 = icmp sgt i32 %4, 0
%8 = icmp slt i32 %1, %4
%9 = and i1 %7, %8
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = sext i32 %1 to i64
br label %12
12: ; preds = %10, %27
%13 = phi i64 [ %11, %10 ], [ %29, %27 ]
%14 = getelementptr inbounds i8, i8* %2, i64 %13
%15 = load i8, i8* %14
%16 = tail call signext i8 @get_dic(i8 signext %15)
%17 = icmp eq i8 %16, 32
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = add nsw i64 %13, 1
%20 = trunc i64 %19 to i32
br label %27
21: ; preds = %12
%22 = getelementptr inbounds i8, i8* %3, i64 %13
store i8 %16, i8* %22
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%24 = add nsw i64 %13, 1
%25 = trunc i64 %24 to i32
tail call void @create_dic(i32* %0, i32 %25, i8* %2, i8* %3, i32 %4, i64 %5)
%26 = load i8, i8* %14
store i8 %26, i8* %22
br label %27
27: ; preds = %18, %21
%28 = phi i32 [ %20, %18 ], [ %25, %21 ]
%29 = phi i64 [ %19, %18 ], [ %24, %21 ]
%30 = icmp eq i32 %28, %4
br i1 %30, label %31, label %12
31: ; preds = %27, %6
ret void
}