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

/* Variables and functions */
int RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *filename = (argc > 1) ? argv[1] : "lwe_a.h";
  printf("Writing matrix to file %s\n", filename);
  FILE *f = fopen(filename, "wt");
  if (f == NULL) {
    printf("ERROR: Could not open the file");
    return 0;
  }
  int i, j;
  int N = 752;
  uint16_t lwe_a[N * N];
  uint16_t lwe_a_transpose[N * N];
  if (1 != RAND_bytes((unsigned char *)lwe_a, N * N * sizeof(uint16_t))) {
    printf("ERROR\n");
    exit(1);
  }
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++) {
      lwe_a_transpose[j * N + i] = lwe_a[i * N + j];
    }
  fprintf(f, "#ifndef _LWE_A_H_\n#define _LWE_A_H_\n\n");
  fprintf(f, "uint16_t lwe_a[%d * %d] = {\n", N, N);
  for (i = 0; i < N * N; i += 8) {
    fprintf(f, "  ");
    for (j = 0; j < 8; j++) {
      fprintf(f, "0x%04X, ", lwe_a[i + j]);
    }
    fprintf(f, "\n");
  }
  fprintf(f, "};\n\n");
  fprintf(f, "uint16_t lwe_a_transpose[%d * %d] = {\n", N, N);
  for (i = 0; i < N * N; i += 8) {
    fprintf(f, "  ");
    for (j = 0; j < 8; j++) {
      fprintf(f, "0x%04X, ", lwe_a_transpose[i + j]);
    }
    fprintf(f, "\n");
  }
  fprintf(f, "};\n#endif /* _LWE_A_H_ */");
  fclose(f);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1191 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    11a1 <main+0x41>
lea    0xe68(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    11a1 <main+0x41>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11f4 <main+0x94>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1487 <main+0x327>
movl   $0x2f0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
imul   %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x60(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
imul   %eax,%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <RAND_bytes@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1283 <main+0x123>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12f2 <main+0x192>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12df <main+0x17f>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    -0x24(%rbp),%edx
imul   -0x2c(%rbp),%edx
add    -0x28(%rbp),%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    129d <main+0x13d>
jmp    12e4 <main+0x184>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    128a <main+0x12a>
mov    -0x20(%rbp),%rdi
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xd5d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    13a8 <main+0x248>
mov    -0x20(%rbp),%rdi
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x8,-0x28(%rbp)
jge    1388 <main+0x228>
mov    -0x60(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd1f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    134e <main+0x1ee>
mov    -0x20(%rbp),%rdi
lea    0xd0b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x24(%rbp)
jmp    1323 <main+0x1c3>
mov    -0x20(%rbp),%rdi
lea    0xce8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    145e <main+0x2fe>
mov    -0x20(%rbp),%rdi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x8,-0x28(%rbp)
jge    143e <main+0x2de>
mov    -0x58(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1404 <main+0x2a4>
mov    -0x20(%rbp),%rdi
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x24(%rbp)
jmp    13d9 <main+0x279>
mov    -0x20(%rbp),%rdi
lea    0xc5e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jl     11ac <main+0x1c>
mov    0x8(%rsi),%rbx
jmp    11b3 <main+0x23>
lea    0xe4d(%rip),%rbx
lea    0xe4e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe58(%rip),%rsi
mov    %rbx,%rdi
call   1090 <fopen@plt>
test   %rax,%rax
je     14ba <main+0x32a>
mov    %rax,%r13
mov    %rsp,%r15
mov    %rsp,%r14
add    $0xffffffffffdd7c00,%r14
mov    %r14,%rsp
mov    %rsp,%r12
add    $0xffffffffffdd7c00,%r12
mov    %r12,%rsp
mov    %r14,%rdi
mov    $0x228400,%esi
call   1050 <RAND_bytes@plt>
cmp    $0x1,%eax
jne    14d9 <main+0x349>
xor    %eax,%eax
mov    %r12,%rcx
mov    %r14,%rdx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%esi
mov    %rcx,%rdi
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rdx,%rsi,4),%ebx
mov    %ebx,(%rdi)
mov    (%rdx,%rsi,4),%ebx
mov    %ebx,0xbc0(%rdi)
add    $0x2,%rsi
add    $0x1780,%rdi
cmp    $0x2f1,%rsi
jne    1230 <main+0xa0>
add    $0x1,%rax
add    $0xbc0,%rdx
add    $0x4,%rcx
cmp    $0x2f0,%rax
jne    1220 <main+0x90>
mov    %r12,-0x30(%rbp)
mov    %r15,-0x38(%rbp)
lea    0xdcc(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10b0 <fwrite@plt>
lea    0xdd9(%rip),%rsi
mov    %r13,%rdi
mov    $0x2f0,%edx
mov    $0x2f0,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xfffffffffffffff8,%r15
lea    0xdd4(%rip),%rbx
lea    0xdd0(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r13,%rcx
call   10b0 <fwrite@plt>
mov    0x20(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x24(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x28(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2c(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x30(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x34(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x38(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x3c(%r14,%r15,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   1070 <fputc@plt>
add    $0x8,%r15
cmp    $0x8a0f8,%r15
jb     12c0 <main+0x130>
lea    0xd0a(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10b0 <fwrite@plt>
lea    0xcf6(%rip),%rsi
mov    %r13,%rdi
mov    $0x2f0,%edx
mov    $0x2f0,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xfffffffffffffff8,%rbx
lea    0xcc3(%rip),%r14
lea    0xcbf(%rip),%r15
mov    -0x30(%rbp),%r12
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r13,%rcx
call   10b0 <fwrite@plt>
mov    0x20(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x24(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x28(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2c(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x30(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x34(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x38(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x3c(%r12,%rbx,4),%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   1070 <fputc@plt>
add    $0x8,%rbx
cmp    $0x8a0f8,%rbx
jb     13d0 <main+0x240>
lea    0xc26(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10b0 <fwrite@plt>
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rsp
jmp    14c8 <main+0x338>
lea    0xb65(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbfa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"lwe_a.h\00"
@.str.1 = [27 x i8] c"Writing matrix to file %s\0A\00"
@.str.2 = [3 x i8] c"wt\00"
@.str.3 = [31 x i8] c"ERROR: Could not open the file\00"
@.str.4 = [7 x i8] c"ERROR\0A\00"
@.str.5 = [38 x i8] c"#ifndef _LWE_A_H_\0A#define _LWE_A_H_\0A\0A\00"
@.str.6 = [29 x i8] c"uint16_t lwe_a[%d * %d] = {\0A\00"
@.str.7 = [3 x i8] c" \00"
@.str.8 = [9 x i8] c"0x%04X, \00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [5 x i8] c"};\0A\0A\00"
@.str.11 = [39 x i8] c"uint16_t lwe_a_transpose[%d * %d] = {\0A\00"
@.str.12 = [26 x i8] c"};\0A#endif /* _LWE_A_H_ */\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %16
%22 = phi i8* [ %19, %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %20 ]
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = load i8*, i8** %6
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %26, i32** %7
%27 = load i32*, i32** %7
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %21
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %168
31: ; preds = %21
store i32 752, i32* %10
%32 = load i32, i32* %10
%33 = load i32, i32* %10
%34 = mul nsw i32 %32, %33
%35 = zext i32 %34 to i64
%36 = call i8* @llvm.stacksave()
store i8* %36, i8** %11
%37 = alloca i32, i64 %35
store i64 %35, i64* %12
%38 = load i32, i32* %10
%39 = load i32, i32* %10
%40 = mul nsw i32 %38, %39
%41 = zext i32 %40 to i64
%42 = alloca i32, i64 %41
store i64 %41, i64* %13
%43 = bitcast i32* %37 to i8*
%44 = load i32, i32* %10
%45 = load i32, i32* %10
%46 = mul nsw i32 %44, %45
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 4
%49 = trunc i64 %48 to i32
%50 = call i32 @RAND_bytes(i8* %43, i32 %49)
%51 = icmp ne i32 1, %50
br i1 %51, label %52, label %55
52: ; preds = %31
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %31
store i32 0, i32* %8
br label %56
56: ; preds = %85, %55
%57 = load i32, i32* %8
%58 = load i32, i32* %10
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %88
60: ; preds = %56
store i32 0, i32* %9
br label %61
61: ; preds = %81, %60
%62 = load i32, i32* %9
%63 = load i32, i32* %10
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %84
65: ; preds = %61
%66 = load i32, i32* %8
%67 = load i32, i32* %10
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %9
%70 = add nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %37, i64 %71
%73 = load i32, i32* %72
%74 = load i32, i32* %9
%75 = load i32, i32* %10
%76 = mul nsw i32 %74, %75
%77 = load i32, i32* %8
%78 = add nsw i32 %76, %77
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i32, i32* %42, i64 %79
store i32 %73, i32* %80
br label %81
81: ; preds = %65
%82 = load i32, i32* %9
%83 = add nsw i32 %82, 1
store i32 %83, i32* %9
br label %61
84: ; preds = %61
br label %85
85: ; preds = %84
%86 = load i32, i32* %8
%87 = add nsw i32 %86, 1
store i32 %87, i32* %8
br label %56
88: ; preds = %56
%89 = load i32*, i32** %7
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%91 = load i32*, i32** %7
%92 = load i32, i32* %10
%93 = load i32, i32* %10
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %92, i32 %93)
store i32 0, i32* %8
br label %95
95: ; preds = %122, %88
%96 = load i32, i32* %8
%97 = load i32, i32* %10
%98 = load i32, i32* %10
%99 = mul nsw i32 %97, %98
%100 = icmp slt i32 %96, %99
br i1 %100, label %101, label %125
101: ; preds = %95
%102 = load i32*, i32** %7
%103 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %9
br label %104
104: ; preds = %116, %101
%105 = load i32, i32* %9
%106 = icmp slt i32 %105, 8
br i1 %106, label %107, label %119
107: ; preds = %104
%108 = load i32*, i32** %7
%109 = load i32, i32* %8
%110 = load i32, i32* %9
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %37, i64 %112
%114 = load i32, i32* %113
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %114)
br label %116
116: ; preds = %107
%117 = load i32, i32* %9
%118 = add nsw i32 %117, 1
store i32 %118, i32* %9
br label %104
119: ; preds = %104
%120 = load i32*, i32** %7
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %122
122: ; preds = %119
%123 = load i32, i32* %8
%124 = add nsw i32 %123, 8
store i32 %124, i32* %8
br label %95
125: ; preds = %95
%126 = load i32*, i32** %7
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%128 = load i32*, i32** %7
%129 = load i32, i32* %10
%130 = load i32, i32* %10
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %128, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %129, i32 %130)
store i32 0, i32* %8
br label %132
132: ; preds = %159, %125
%133 = load i32, i32* %8
%134 = load i32, i32* %10
%135 = load i32, i32* %10
%136 = mul nsw i32 %134, %135
%137 = icmp slt i32 %133, %136
br i1 %137, label %138, label %162
138: ; preds = %132
%139 = load i32*, i32** %7
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %9
br label %141
141: ; preds = %153, %138
%142 = load i32, i32* %9
%143 = icmp slt i32 %142, 8
br i1 %143, label %144, label %156
144: ; preds = %141
%145 = load i32*, i32** %7
%146 = load i32, i32* %8
%147 = load i32, i32* %9
%148 = add nsw i32 %146, %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %42, i64 %149
%151 = load i32, i32* %150
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %144
%154 = load i32, i32* %9
%155 = add nsw i32 %154, 1
store i32 %155, i32* %9
br label %141
156: ; preds = %141
%157 = load i32*, i32** %7
%158 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %159
159: ; preds = %156
%160 = load i32, i32* %8
%161 = add nsw i32 %160, 8
store i32 %161, i32* %8
br label %132
162: ; preds = %132
%163 = load i32*, i32** %7
%164 = call i32 (i32*, i8*, ...) @fprintf(i32* %163, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
%165 = load i32*, i32** %7
%166 = call i32 @fclose(i32* %165)
store i32 0, i32* %3
%167 = load i8*, i8** %11
br label %168
168: ; preds = %162, %29
%169 = load i32, i32* %3
ret i32 %169
}

LLVM IR (-O2):
@.str = [8 x i8] c"lwe_a.h\00"
@.str.1 = [27 x i8] c"Writing matrix to file %s\0A\00"
@.str.2 = [3 x i8] c"wt\00"
@.str.3 = [31 x i8] c"ERROR: Could not open the file\00"
@.str.5 = [38 x i8] c"#ifndef _LWE_A_H_\0A#define _LWE_A_H_\0A\0A\00"
@.str.6 = [29 x i8] c"uint16_t lwe_a[%d * %d] = {\0A\00"
@.str.7 = [3 x i8] c" \00"
@.str.8 = [9 x i8] c"0x%04X, \00"
@.str.10 = [5 x i8] c"};\0A\0A\00"
@.str.11 = [39 x i8] c"uint16_t lwe_a_transpose[%d * %d] = {\0A\00"
@.str.12 = [26 x i8] c"};\0A#endif /* _LWE_A_H_ */\00"
@str = [6 x i8] c"ERROR\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %130
14: ; preds = %7
%15 = tail call i8* @llvm.stacksave()
%16 = alloca [565504 x i32]
%17 = alloca [565504 x i32]
%18 = bitcast [565504 x i32]* %16 to i8*
%19 = call i32 @RAND_bytes(i8* %18, i32 2262016)
%20 = icmp eq i32 %19, 1
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %14, %44
%25 = phi i64 [ %45, %44 ], [ 0, %14 ]
%26 = mul nuw nsw i64 %25, 752
br label %27
27: ; preds = %27, %24
%28 = phi i64 [ 0, %24 ], [ %42, %27 ]
%29 = add nuw nsw i64 %28, %26
%30 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = mul nuw nsw i64 %28, 752
%33 = add nuw nsw i64 %32, %25
%34 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %33
store i32 %31, i32* %34
%35 = or i64 %28, 1
%36 = add nuw nsw i64 %35, %26
%37 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = mul nuw nsw i64 %35, 752
%40 = add nuw nsw i64 %39, %25
%41 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %40
store i32 %38, i32* %41
%42 = add nuw nsw i64 %28, 2
%43 = icmp eq i64 %42, 752
br i1 %43, label %44, label %27
44: ; preds = %27
%45 = add nuw nsw i64 %25, 1
%46 = icmp eq i64 %45, 752
br i1 %46, label %47, label %24
47: ; preds = %44
%48 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i64 37, i64 1, i32* %10)
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 752, i32 752)
br label %50
50: ; preds = %47, %50
%51 = phi i64 [ 0, %47 ], [ %85, %50 ]
%52 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i64 2, i64 1, i32* %10)
%53 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %51
%54 = load i32, i32* %53
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %54)
%56 = or i64 %51, 1
%57 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %58)
%60 = or i64 %51, 2
%61 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %62)
%64 = or i64 %51, 3
%65 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %66)
%68 = or i64 %51, 4
%69 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %70)
%72 = or i64 %51, 5
%73 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %74)
%76 = or i64 %51, 6
%77 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %76
%78 = load i32, i32* %77
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %78)
%80 = or i64 %51, 7
%81 = getelementptr inbounds [565504 x i32], [565504 x i32]* %16, i64 0, i64 %80
%82 = load i32, i32* %81
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %82)
%84 = call i32 @fputc(i32 10, i32* %10)
%85 = add nuw nsw i64 %51, 8
%86 = icmp ult i64 %51, 565496
br i1 %86, label %50, label %87
87: ; preds = %50
%88 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %10)
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 752, i32 752)
br label %90
90: ; preds = %87, %90
%91 = phi i64 [ 0, %87 ], [ %125, %90 ]
%92 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i64 2, i64 1, i32* %10)
%93 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %91
%94 = load i32, i32* %93
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %94)
%96 = or i64 %91, 1
%97 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %96
%98 = load i32, i32* %97
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %98)
%100 = or i64 %91, 2
%101 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %102)
%104 = or i64 %91, 3
%105 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %104
%106 = load i32, i32* %105
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %106)
%108 = or i64 %91, 4
%109 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %110)
%112 = or i64 %91, 5
%113 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %114)
%116 = or i64 %91, 6
%117 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %116
%118 = load i32, i32* %117
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %118)
%120 = or i64 %91, 7
%121 = getelementptr inbounds [565504 x i32], [565504 x i32]* %17, i64 0, i64 %120
%122 = load i32, i32* %121
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %122)
%124 = call i32 @fputc(i32 10, i32* %10)
%125 = add nuw nsw i64 %91, 8
%126 = icmp ult i64 %91, 565496
br i1 %126, label %90, label %127
127: ; preds = %90
%128 = call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i64 25, i64 1, i32* %10)
%129 = call i32 @fclose(i32* %10)
br label %130
130: ; preds = %127, %12
ret i32 0
}