#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*/ init_pair(int, int, int);
void generate_all_color_pairs() {
  int foreground;
  int background;
  int i = 1;
  for (background = 0; background < 8; background++) {
    for (foreground = 0; foreground < 8; foreground++) {
      init_pair(i, foreground, background);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<generate_all_color_pairs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1179 <generate_all_color_pairs+0x69>
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    1166 <generate_all_color_pairs+0x56>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <init_pair@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <generate_all_color_pairs+0x27>
jmp    116b <generate_all_color_pairs+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <generate_all_color_pairs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_all_color_pairs>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x1,%r14d
nopl   0x0(%rax)
mov    %r14d,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x1(%r14),%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x2(%r14),%edi
mov    $0x2,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x3(%r14),%edi
mov    $0x3,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x4(%r14),%edi
mov    $0x4,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x5(%r14),%edi
mov    $0x5,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x6(%r14),%edi
mov    $0x6,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
lea    0x7(%r14),%edi
mov    $0x7,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
add    $0x1,%ebx
add    $0x8,%r14d
cmp    $0x8,%ebx
jne    1120 <generate_all_color_pairs+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @generate_all_color_pairs() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %25
7: ; preds = %4
store i32 0, i32* %1
br label %8
8: ; preds = %18, %7
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @init_pair(i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %11
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %8
21: ; preds = %8
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @generate_all_color_pairs() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %19, %1 ]
%3 = phi i32 [ 0, %0 ], [ %20, %1 ]
%4 = tail call i32 @init_pair(i32 %2, i32 0, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = tail call i32 @init_pair(i32 %5, i32 1, i32 %3)
%7 = add nuw nsw i32 %2, 2
%8 = tail call i32 @init_pair(i32 %7, i32 2, i32 %3)
%9 = add nuw nsw i32 %2, 3
%10 = tail call i32 @init_pair(i32 %9, i32 3, i32 %3)
%11 = add nuw nsw i32 %2, 4
%12 = tail call i32 @init_pair(i32 %11, i32 4, i32 %3)
%13 = add nuw nsw i32 %2, 5
%14 = tail call i32 @init_pair(i32 %13, i32 5, i32 %3)
%15 = add nuw nsw i32 %2, 6
%16 = tail call i32 @init_pair(i32 %15, i32 6, i32 %3)
%17 = add nuw nsw i32 %2, 7
%18 = tail call i32 @init_pair(i32 %17, i32 7, i32 %3)
%19 = add nuw nsw i32 %2, 8
%20 = add nuw nsw i32 %3, 1
%21 = icmp eq i32 %20, 8
br i1 %21, label %22, label %1
22: ; preds = %1
ret void
}