#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*/ cheat_print_parameters(size_t);
int /*<<< orphan*/ printf(char *, ...);
int cheat_print_definitions(size_t const parameters) {
  size_t index;
  for (index = 1; index < parameters; ++index) {
    (void)printf("#define CHEAT_COMMAS_%zu(", index);
    (void)cheat_print_parameters(index + 1);
    (void)printf(") ");
    (void)cheat_print_parameters(index + 1);
    (void)printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<cheat_print_definitions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    119b <cheat_print_definitions+0x7b>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <cheat_print_parameters@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <cheat_print_parameters@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <cheat_print_definitions+0x14>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheat_print_definitions>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%rdi
jb     119a <cheat_print_definitions+0x6a>
mov    %rdi,%r14
mov    $0x1,%ebx
lea    0xeb3(%rip),%r15
lea    0xec6(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <cheat_print_parameters@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <cheat_print_parameters@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    %rbx,%r14
jne    1160 <cheat_print_definitions+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"#define CHEAT_COMMAS_%zu(\00"
@.str.1 = [3 x i8] c") \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @cheat_print_definitions(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %19, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i64, i64* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i64, i64* %3
%12 = add i64 %11, 1
%13 = call i32 @cheat_print_parameters(i64 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = load i64, i64* %3
%16 = add i64 %15, 1
%17 = call i32 @cheat_print_parameters(i64 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %8
%20 = load i64, i64* %3
%21 = add i64 %20, 1
store i64 %21, i64* %3
br label %4
22: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"#define CHEAT_COMMAS_%zu(\00"
@.str.1 = [3 x i8] c") \00"
define i32 @cheat_print_definitions(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = add nuw i64 %4, 1
%7 = tail call i32 @cheat_print_parameters(i64 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @cheat_print_parameters(i64 %6)
%10 = tail call i32 @putchar(i32 10)
%11 = icmp eq i64 %6, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
ret i32 0
}