#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 GF8Add(int, int);
int /*<<< orphan*/ printf(char *, ...);
void PintAddList() {
  for (int i = 0; i < 256; i++) {
    for (int j = 0; j < 256; j++) {
      printf("%4d ", GF8Add(i, j));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PintAddList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1195 <PintAddList+0x75>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1179 <PintAddList+0x59>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <GF8Add@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <PintAddList+0x23>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <PintAddList+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PintAddList>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%r14
xor    %ebp,%ebp
nopl   (%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <GF8Add@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1150 <PintAddList+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1140 <PintAddList+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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