#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*/ combos_(int *, char *, int *);
int strlen(char *);
int main(int narg, char **argv) {
  char *file = " ";
  int i, len = 1;
  if (narg > 1) {
    for (i = 1; i < narg; i++) {
      len = strlen(argv[i]);
      combos_(&len, argv[i], &len);
    }
  } else {
    combos_(&len, file, &len);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11a4 <main+0x84>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119f <main+0x7f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    -0x20(%rbp),%rdx
mov    %rdx,%rdi
call   1040 <combos_@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <main+0x39>
jmp    11b4 <main+0x94>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    %rdx,%rdi
call   1040 <combos_@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
cmp    $0x2,%edi
jl     1177 <main+0x57>
mov    %rsi,%r12
mov    %edi,%r15d
mov    $0x1,%ebx
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r12,%rbx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,0x4(%rsp)
mov    (%r12,%rbx,8),%rsi
mov    %r14,%rdi
mov    %r14,%rdx
call   1040 <combos_@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <main+0x30>
jmp    118b <main+0x6b>
lea    0xe82(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    %rdi,%rdx
call   1040 <combos_@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %15, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %3
%13 = load i8*, i8** %10
%14 = call i32 @combos_(i32* %3, i8* %13, i32* %3)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %19, label %8
17: ; preds = %2
%18 = call i32 @combos_(i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %19
19: ; preds = %8, %17
ret i32 0
}