#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 *, ...);
int cheat_print_parameters(size_t const parameters) {
  size_t index;
  for (index = 0; index < parameters; ++index) {
    if (index != 0)
      (void)printf(", ");
    (void)printf("x%zu", index + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cheat_print_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1172 <cheat_print_parameters+0x62>
cmpq   $0x0,-0x10(%rbp)
je     114b <cheat_print_parameters+0x3b>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <cheat_print_parameters+0x14>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheat_print_parameters>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1189 <cheat_print_parameters+0x79>
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
mov    $0x1,%r12d
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x1,%rbx
je     1189 <cheat_print_parameters+0x79>
sub    %rbx,%r12
mov    $0x2,%ebx
lea    0xeb2(%rip),%r14
lea    0xeae(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r12,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x2,%rax
jne    1160 <cheat_print_parameters+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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