#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*/ printf(char *, ...);
void print_combos(char **combos, const int length, const int result) {
  for (int i = 0; i < length; i++) {
    printf("%s=%d", combos[i], result);
    if (i != length - 1) {
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<print_combos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1184 <print_combos+0x74>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x10(%rbp),%edx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1171 <print_combos+0x61>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1176 <print_combos+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_combos+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_combos>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    117b <print_combos+0x5b>
mov    %edx,%r15d
mov    %rdi,%r12
lea    -0x1(%rsi),%r13d
mov    %esi,%ebx
lea    0xebe(%rip),%r14
xor    %ebp,%ebp
jmp    1159 <print_combos+0x39>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     117b <print_combos+0x5b>
mov    (%r12,%rbp,8),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbp,%r13
je     1150 <print_combos+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1150 <print_combos+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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