#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
void generateAnswers(FILE *inputFile, unsigned int **answers) {
  unsigned int *outMsg(unsigned int **orgMsg, int radix, int sz);
  unsigned int **orgMsg;
  int sz;
  int cnt;
  short radix = 2;
  fscanf(inputFile, "%d", &sz);
  orgMsg = (unsigned int **)calloc(sz + 1, sizeof(int));
  cnt = sz;
  while (cnt-- > 0)
    fscanf(inputFile, "%s", *orgMsg++);
  fclose(inputFile);
  cnt = 0;
  while (cnt < 15)
    answers[cnt++] = outMsg(orgMsg, radix++, sz);
}


x86 assembly (clang, -O0):
<generateAnswers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x2,-0x22(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0x0,%eax
jle    11bf <generateAnswers+0x7f>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rdx
lea    0xe4e(%rip),%rsi
call   1050 <fscanf@plt>
jmp    1184 <generateAnswers+0x44>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0xf,-0x20(%rbp)
jge    1215 <generateAnswers+0xd5>
mov    -0x18(%rbp),%rdi
mov    -0x22(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x22(%rbp)
movswl %ax,%esi
mov    -0x1c(%rbp),%edx
call   1030 <outMsg@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x20(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    11cf <generateAnswers+0x8f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateAnswers>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xea7(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <fscanf@plt>
mov    0xc(%rsp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    11aa <generateAnswers+0x6a>
add    $0x1,%ebp
lea    0xe7a(%rip),%r12
nopl   0x0(%rax)
mov    (%rbx),%rdx
add    $0x8,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <fscanf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1190 <generateAnswers+0x50>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <outMsg@plt>
mov    %rax,(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <outMsg@plt>
mov    %rax,0x8(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <outMsg@plt>
mov    %rax,0x10(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <outMsg@plt>
mov    %rax,0x18(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <outMsg@plt>
mov    %rax,0x20(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <outMsg@plt>
mov    %rax,0x28(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <outMsg@plt>
mov    %rax,0x30(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <outMsg@plt>
mov    %rax,0x38(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <outMsg@plt>
mov    %rax,0x40(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <outMsg@plt>
mov    %rax,0x48(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <outMsg@plt>
mov    %rax,0x50(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <outMsg@plt>
mov    %rax,0x58(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <outMsg@plt>
mov    %rax,0x60(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <outMsg@plt>
mov    %rax,0x68(%r14)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <outMsg@plt>
mov    %rax,0x70(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define void @generateAnswers(i32* nocapture %0, i32** nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = call i64 @calloc(i32 %7, i32 4)
%9 = inttoptr i64 %8 to i32**
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %2, %12
%13 = phi i32 [ %15, %12 ], [ %10, %2 ]
%14 = phi i32** [ %16, %12 ], [ %9, %2 ]
%15 = add nsw i32 %13, -1
%16 = getelementptr inbounds i32*, i32** %14, i64 1
%17 = load i32*, i32** %14
%18 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %17)
%19 = icmp ugt i32 %13, 1
br i1 %19, label %12, label %20
20: ; preds = %12, %2
%21 = phi i32** [ %9, %2 ], [ %16, %12 ]
%22 = call i32 @fclose(i32* %0)
%23 = load i32, i32* %3
%24 = call i32* @outMsg(i32** %21, i32 2, i32 %23)
store i32* %24, i32** %1
%25 = load i32, i32* %3
%26 = call i32* @outMsg(i32** %21, i32 3, i32 %25)
%27 = getelementptr inbounds i32*, i32** %1, i64 1
store i32* %26, i32** %27
%28 = load i32, i32* %3
%29 = call i32* @outMsg(i32** %21, i32 4, i32 %28)
%30 = getelementptr inbounds i32*, i32** %1, i64 2
store i32* %29, i32** %30
%31 = load i32, i32* %3
%32 = call i32* @outMsg(i32** %21, i32 5, i32 %31)
%33 = getelementptr inbounds i32*, i32** %1, i64 3
store i32* %32, i32** %33
%34 = load i32, i32* %3
%35 = call i32* @outMsg(i32** %21, i32 6, i32 %34)
%36 = getelementptr inbounds i32*, i32** %1, i64 4
store i32* %35, i32** %36
%37 = load i32, i32* %3
%38 = call i32* @outMsg(i32** %21, i32 7, i32 %37)
%39 = getelementptr inbounds i32*, i32** %1, i64 5
store i32* %38, i32** %39
%40 = load i32, i32* %3
%41 = call i32* @outMsg(i32** %21, i32 8, i32 %40)
%42 = getelementptr inbounds i32*, i32** %1, i64 6
store i32* %41, i32** %42
%43 = load i32, i32* %3
%44 = call i32* @outMsg(i32** %21, i32 9, i32 %43)
%45 = getelementptr inbounds i32*, i32** %1, i64 7
store i32* %44, i32** %45
%46 = load i32, i32* %3
%47 = call i32* @outMsg(i32** %21, i32 10, i32 %46)
%48 = getelementptr inbounds i32*, i32** %1, i64 8
store i32* %47, i32** %48
%49 = load i32, i32* %3
%50 = call i32* @outMsg(i32** %21, i32 11, i32 %49)
%51 = getelementptr inbounds i32*, i32** %1, i64 9
store i32* %50, i32** %51
%52 = load i32, i32* %3
%53 = call i32* @outMsg(i32** %21, i32 12, i32 %52)
%54 = getelementptr inbounds i32*, i32** %1, i64 10
store i32* %53, i32** %54
%55 = load i32, i32* %3
%56 = call i32* @outMsg(i32** %21, i32 13, i32 %55)
%57 = getelementptr inbounds i32*, i32** %1, i64 11
store i32* %56, i32** %57
%58 = load i32, i32* %3
%59 = call i32* @outMsg(i32** %21, i32 14, i32 %58)
%60 = getelementptr inbounds i32*, i32** %1, i64 12
store i32* %59, i32** %60
%61 = load i32, i32* %3
%62 = call i32* @outMsg(i32** %21, i32 15, i32 %61)
%63 = getelementptr inbounds i32*, i32** %1, i64 13
store i32* %62, i32** %63
%64 = load i32, i32* %3
%65 = call i32* @outMsg(i32** %21, i32 16, i32 %64)
%66 = getelementptr inbounds i32*, i32** %1, i64 14
store i32* %65, i32** %66
ret void
}