#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*/ arr3;
typedef int /*<<< orphan*/ arr2;
typedef int /*<<< orphan*/ arr1;

/* Variables and functions */
int /*<<< orphan*/ printAllComb(char *, int);
int /*<<< orphan*/ printf(char *);
void testPrintAllComb(void) {
  char arr1[] = "abc";
  char arr2[] = "abcd";
  char arr3[] = "abcde";
  printAllComb(arr1, sizeof(arr1) - 1);
  printf("-----------------\n");
  printAllComb(arr2, sizeof(arr2) - 1);
  printf("-----------------\n");
  printAllComb(arr3, sizeof(arr3) - 1);
  printf("-----------------\n");
}


x86 assembly (clang, -O0):
<testPrintAllComb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0xb(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x3,%esi
call   1040 <printAllComb@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x9(%rbp),%rdi
mov    $0x4,%esi
call   1040 <printAllComb@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
mov    $0x5,%esi
call   1040 <printAllComb@plt>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPrintAllComb>:
push   %rbx
sub    $0x20,%rsp
movl   $0x636261,0x1c(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x64636261,0xc(%rsp)
64
movw   $0x65,0x18(%rsp)
movl   $0x64636261,0x14(%rsp)
64
lea    0x1c(%rsp),%rdi
mov    $0x3,%esi
call   1040 <printAllComb@plt>
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1040 <printAllComb@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rdi
mov    $0x5,%esi
call   1040 <printAllComb@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.testPrintAllComb.arr1 = [4 x i8] c"abc\00"
@__const.testPrintAllComb.arr2 = [5 x i8] c"abcd\00"
@__const.testPrintAllComb.arr3 = [6 x i8] c"abcde\00"
@.str = [19 x i8] c"-----------------\0A\00"
define void @testPrintAllComb() {
%1 = alloca [4 x i8]
%2 = alloca [5 x i8]
%3 = alloca [6 x i8]
%4 = bitcast [4 x i8]* %1 to i8*
%5 = bitcast [5 x i8]* %2 to i8*
%6 = bitcast [6 x i8]* %3 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%8 = call i32 @printAllComb(i8* %7, i32 3)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = call i32 @printAllComb(i8* %10, i32 4)
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%14 = call i32 @printAllComb(i8* %13, i32 5)
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.testPrintAllComb.arr2 = [5 x i8] c"abcd\00"
@__const.testPrintAllComb.arr3 = [6 x i8] c"abcde\00"
@str.2 = [18 x i8] c"-----------------\00"
define void @testPrintAllComb() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [6 x i8]
%4 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%7 = call i32 @printAllComb(i8* %4, i32 3)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @printAllComb(i8* %5, i32 4)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
%11 = call i32 @printAllComb(i8* %6, i32 5)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret void
}