#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 */
struct bilist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pbuckets(struct bilist ****buckets, struct bilist **listspace, int maxdeg,
              int nsets) {
  struct bilist *lptr;
  int i, j;
  void p1bucket();
  printf("\n");
  for (i = 0; i < nsets; i++) {
    for (j = 0; j < nsets; j++) {
      if (i != j) {
        printf("For transition %d -> %d\n", i, j);
        if (j > i) {
          lptr = listspace[j - 1];
        } else {
          lptr = listspace[j];
        }
        p1bucket(buckets[i][j], lptr, maxdeg);
        printf("\n");
      }
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<pbuckets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1216 <pbuckets+0xf6>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1203 <pbuckets+0xe3>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     11f0 <pbuckets+0xd0>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    11b0 <pbuckets+0x90>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    11c0 <pbuckets+0xa0>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <p1bucket@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f5 <pbuckets+0xd5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115e <pbuckets+0x3e>
jmp    1208 <pbuckets+0xe8>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <pbuckets+0x2b>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbuckets>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%r13
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    11bd <pbuckets+0x8d>
mov    %ebx,%r15d
xor    %ebx,%ebx
jmp    1169 <pbuckets+0x39>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %r15,%rbx
je     11bd <pbuckets+0x8d>
xor    %ebp,%ebp
jmp    1179 <pbuckets+0x49>
nopl   (%rax)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1160 <pbuckets+0x30>
cmp    %rbp,%rbx
je     1170 <pbuckets+0x40>
lea    0xe7b(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbp,%rbx
mov    %rbp,%rax
sbb    $0x0,%rax
mov    (%r12,%rax,8),%rsi
mov    0x0(%r13,%rbx,8),%rax
mov    (%rax,%rbp,8),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <p1bucket@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1170 <pbuckets+0x40>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.bilist = type { i32 }
@.str = [2 x i8] c"\0A\00"
@.str.1 = [25 x i8] c"For transition %d -> %d\0A\00"
define void @pbuckets(%struct.bilist**** %0, %struct.bilist** %1, i32 %2, i32 %3) {
%5 = alloca %struct.bilist****
%6 = alloca %struct.bilist**
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.bilist*
%10 = alloca i32
%11 = alloca i32
store %struct.bilist**** %0, %struct.bilist***** %5
store %struct.bilist** %1, %struct.bilist*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %10
br label %13
13: ; preds = %64, %4
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %67
17: ; preds = %13
store i32 0, i32* %11
br label %18
18: ; preds = %60, %17
%19 = load i32, i32* %11
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %63
22: ; preds = %18
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = icmp ne i32 %23, %24
br i1 %25, label %26, label %59
26: ; preds = %22
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28)
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %40
33: ; preds = %26
%34 = load %struct.bilist**, %struct.bilist*** %6
%35 = load i32, i32* %11
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds %struct.bilist*, %struct.bilist** %34, i64 %37
%39 = load %struct.bilist*, %struct.bilist** %38
store %struct.bilist* %39, %struct.bilist** %9
br label %46
40: ; preds = %26
%41 = load %struct.bilist**, %struct.bilist*** %6
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds %struct.bilist*, %struct.bilist** %41, i64 %43
%45 = load %struct.bilist*, %struct.bilist** %44
store %struct.bilist* %45, %struct.bilist** %9
br label %46
46: ; preds = %40, %33
%47 = load %struct.bilist****, %struct.bilist***** %5
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds %struct.bilist***, %struct.bilist**** %47, i64 %49
%51 = load %struct.bilist***, %struct.bilist**** %50
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds %struct.bilist**, %struct.bilist*** %51, i64 %53
%55 = load %struct.bilist**, %struct.bilist*** %54
%56 = load %struct.bilist*, %struct.bilist** %9
%57 = load i32, i32* %7
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %46, %22
br label %60
60: ; preds = %59
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %18
63: ; preds = %18
br label %64
64: ; preds = %63
%65 = load i32, i32* %10
%66 = add nsw i32 %65, 1
store i32 %66, i32* %10
br label %13
67: ; preds = %13
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

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