#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void SendInfToFile(FILE *pFile, int n, int **x) {
  int i, j;
  for (i = 0; i < n; i++) {
    fprintf(pFile, "\n");
    for (j = 0; j < n; j++)
      fprintf(pFile, "%4d ", x[i][j]);
  }
  fclose(pFile);
}


x86 assembly (clang, -O0):
<SendInfToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b1 <SendInfToFile+0x91>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119e <SendInfToFile+0x7e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115f <SendInfToFile+0x3f>
jmp    11a3 <SendInfToFile+0x83>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <SendInfToFile+0x1a>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendInfToFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
test   %esi,%esi
jle    1196 <SendInfToFile+0x66>
mov    %rdx,%r14
mov    %esi,%r13d
lea    0xeb1(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %r12,%rsi
call   1040 <fputc@plt>
xor    %ebp,%ebp
nop
mov    (%r14,%rbx,8),%rax
mov    (%rax,%rbp,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1170 <SendInfToFile+0x40>
add    $0x1,%rbx
cmp    %r13,%rbx
jne    1160 <SendInfToFile+0x30>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%4d \00"
define void @SendInfToFile(i32* nocapture %0, i32 %1, i32** nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %22
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %19, %5
%8 = phi i64 [ 0, %5 ], [ %20, %19 ]
%9 = tail call i32 @fputc(i32 10, i32* %0)
%10 = getelementptr inbounds i32*, i32** %2, i64 %8
br label %11
11: ; preds = %7, %11
%12 = phi i64 [ 0, %7 ], [ %17, %11 ]
%13 = load i32*, i32** %10
%14 = getelementptr inbounds i32, i32* %13, i64 %12
%15 = load i32, i32* %14
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %6
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = add nuw nsw i64 %8, 1
%21 = icmp eq i64 %20, %6
br i1 %21, label %22, label %7
22: ; preds = %19, %3
%23 = tail call i32 @fclose(i32* %0)
ret void
}