#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 */
scalar_t__ all_digits_within_range(char *, int);
int get_max_count(int);
int get_min_count(int);
scalar_t__ no_numbers_repeat(char *, int);
int /*<<< orphan*/ output_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void complete_arrangement(int object_count) {
  char number_string[10];
  int max_count;
  int min_count;
  int i;
  min_count = get_min_count(object_count);
  max_count = get_max_count(object_count);
  for (i = min_count; i < max_count; i++) {
    sprintf(number_string, "%d", i);
    if (all_digits_within_range(number_string, object_count) &&
        no_numbers_repeat(number_string, object_count)) {
      output_number_string(number_string);
    }
  }
}


x86 assembly (clang, -O0):
<complete_arrangement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_min_count@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1080 <get_max_count@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ee <complete_arrangement+0x8e>
lea    -0xe(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe5f(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <all_digits_within_range@plt>
cmp    $0x0,%rax
je     11db <complete_arrangement+0x7b>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1070 <no_numbers_repeat@plt>
cmp    $0x0,%rax
je     11db <complete_arrangement+0x7b>
lea    -0xe(%rbp),%rdi
call   1060 <output_number_string@plt>
jmp    11e0 <complete_arrangement+0x80>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <complete_arrangement+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complete_arrangement>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r12d
call   1030 <get_min_count@plt>
mov    %eax,%ebp
mov    %r12d,%edi
call   1080 <get_max_count@plt>
cmp    %eax,%ebp
jge    11df <complete_arrangement+0x7f>
mov    %eax,%r14d
lea    0xe74(%rip),%r15
lea    0x6(%rsp),%rbx
jmp    11a8 <complete_arrangement+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    %ebp,%r14d
je     11df <complete_arrangement+0x7f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
call   1050 <all_digits_within_range@plt>
test   %rax,%rax
je     11a0 <complete_arrangement+0x40>
mov    %rbx,%rdi
mov    %r12d,%esi
call   1070 <no_numbers_repeat@plt>
test   %rax,%rax
je     11a0 <complete_arrangement+0x40>
mov    %rbx,%rdi
call   1060 <output_number_string@plt>
jmp    11a0 <complete_arrangement+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @complete_arrangement(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @get_min_count(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %2
%10 = call i32 @get_max_count(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %5
store i32 %11, i32* %6
br label %12
12: ; preds = %33, %1
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%18 = load i32, i32* %6
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%21 = load i32, i32* %2
%22 = call i64 @all_digits_within_range(i8* %20, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%26 = load i32, i32* %2
%27 = call i64 @no_numbers_repeat(i8* %25, i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%31 = call i32 @output_number_string(i8* %30)
br label %32
32: ; preds = %29, %24, %16
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %12
36: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @complete_arrangement(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @get_min_count(i32 %0)
%5 = tail call i32 @get_max_count(i32 %0)
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %20
7: ; preds = %1, %17
%8 = phi i32 [ %18, %17 ], [ %4, %1 ]
%9 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i64 @all_digits_within_range(i8* %3, i32 %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = call i64 @no_numbers_repeat(i8* %3, i32 %0)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 @output_number_string(i8* %3)
br label %17
17: ; preds = %7, %12, %15
%18 = add i32 %8, 1
%19 = icmp eq i32 %18, %5
br i1 %19, label %20, label %7
20: ; preds = %17, %1
ret void
}