#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 calcphaseinc(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
void print_phaseinc(int fnum) {
  int multi;
  int block;
  printf("FNUM table for %d : \r\n", fnum);
  for (multi = 0; multi < 16; multi++) {
    for (block = 0; block < 8; block++) {
      int phinc = calcphaseinc(fnum, block, multi);
      printf("%d ", phinc);
    }
    printf("\r\n");
  }
  printf("\r\n");
}


x86 assembly (clang, -O0):
<print_phaseinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11aa <print_phaseinc+0x8a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    118e <print_phaseinc+0x6e>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <calcphaseinc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <print_phaseinc+0x34>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <print_phaseinc+0x23>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_phaseinc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec7(%rip),%r14
lea    0xec4(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x5,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x6,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    $0x7,%esi
mov    %ebp,%edx
call   1030 <calcphaseinc@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x1,%ebp
cmp    $0x10,%ebp
jne    1160 <print_phaseinc+0x30>
lea    0xdd3(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"FNUM table for %d : \0D\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@str.3 = [2 x i8] c"\0D\00"
define void @print_phaseinc(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %22, %3 ]
%5 = tail call i32 @calcphaseinc(i32 %0, i32 0, i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @calcphaseinc(i32 %0, i32 1, i32 %4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @calcphaseinc(i32 %0, i32 2, i32 %4)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = tail call i32 @calcphaseinc(i32 %0, i32 3, i32 %4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = tail call i32 @calcphaseinc(i32 %0, i32 4, i32 %4)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = tail call i32 @calcphaseinc(i32 %0, i32 5, i32 %4)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = tail call i32 @calcphaseinc(i32 %0, i32 6, i32 %4)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = tail call i32 @calcphaseinc(i32 %0, i32 7, i32 %4)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
%22 = add nuw nsw i32 %4, 1
%23 = icmp eq i32 %22, 16
br i1 %23, label %24, label %3
24: ; preds = %3
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret void
}