#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 printArguments(int n, int p, int q, int *levelsTheyCanPass) {
  int loop;
  printf("n=%d\n", n);
  printf("p=%d:", p);
  for (loop = 0; loop < p; loop++)
    printf(" %d", levelsTheyCanPass[loop]);
  printf(";\n");
  printf("q=%d:", q);
  for (loop = 0; loop < q; loop++)
    printf(" %d", levelsTheyCanPass[loop + p]);
  printf(".\n");
}


x86 assembly (clang, -O0):
<printArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1181 <printArguments+0x71>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <printArguments+0x3e>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11df <printArguments+0xcf>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <printArguments+0x97>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArguments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    1187 <printArguments+0x67>
mov    %r15d,%ebx
lea    0xea8(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbp,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1170 <printArguments+0x50>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    11d6 <printArguments+0xb6>
movslq %r15d,%rax
mov    %r14d,%r15d
lea    (%r12,%rax,4),%rbx
lea    0xe52(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    11c0 <printArguments+0xa0>
lea    0xe3b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"n=%d\0A\00"
@.str.1 = [6 x i8] c"p=%d:\00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [3 x i8] c";\0A\00"
@.str.4 = [6 x i8] c"q=%d:\00"
@.str.5 = [3 x i8] c".\0A\00"
define void @printArguments(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %12)
store i32 0, i32* %9
br label %14
14: ; preds = %25, %4
%15 = load i32, i32* %9
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32*, i32** %8
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %14
28: ; preds = %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %30)
store i32 0, i32* %9
br label %32
32: ; preds = %45, %28
%33 = load i32, i32* %9
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = load i32*, i32** %8
%38 = load i32, i32* %9
%39 = load i32, i32* %6
%40 = add nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %37, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %36
%46 = load i32, i32* %9
%47 = add nsw i32 %46, 1
store i32 %47, i32* %9
br label %32
48: ; preds = %32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"n=%d\0A\00"
@.str.1 = [6 x i8] c"p=%d:\00"
@.str.2 = [4 x i8] c" %d\00"
@.str.4 = [6 x i8] c"q=%d:\00"
@str = [2 x i8] c";\00"
@str.6 = [2 x i8] c".\00"
define void @printArguments(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %15, %10 ]
%12 = getelementptr inbounds i32, i32* %3, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %4
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %2)
%20 = icmp sgt i32 %2, 0
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = sext i32 %1 to i64
%23 = zext i32 %2 to i64
br label %24
24: ; preds = %21, %24
%25 = phi i64 [ 0, %21 ], [ %30, %24 ]
%26 = add nsw i64 %25, %22
%27 = getelementptr inbounds i32, i32* %3, i64 %26
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i64 %25, 1
%31 = icmp eq i64 %30, %23
br i1 %31, label %32, label %24
32: ; preds = %24, %17
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret void
}