#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*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ nrerror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sort3(int, float *, float *, float *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
float *vector(int, int);
int main(void) {
  int i, j;
  char dummy[64], amsg[64 + 1], bmsg[64 + 1], cmsg[64 + 1];
  float *a, *b, *c;
  FILE *fp;
  a = vector(1, 64);
  b = vector(1, 64);
  c = vector(1, 64);
  (void)strcpy(amsg, "I'd rather have a bottle in front of");
  (void)strcat(amsg, " me than a frontal lobotomy.");
  printf("\noriginal message:\n%s\n", amsg);
  if ((fp = fopen("tarray.dat", "r")) == NULL)
    nrerror("Data file tarray.dat not found\n");
  fgets(dummy, 64, fp);
  for (i = 1; i <= 64; i++)
    fscanf(fp, "%f", &a[i]);
  fclose(fp);
  for (i = 1; i <= 64; i++) {
    b[i] = i;
    c[i] = 64 + 1 - i;
  }
  sort3(64, a, b, c);
  bmsg[64] = amsg[64];
  for (i = 1; i <= 64; i++) {
    j = b[i];
    bmsg[i - 1] = amsg[j - 1];
  }
  printf("\nscrambled message:\n%s\n", bmsg);
  cmsg[64] = amsg[64];
  for (i = 1; i <= 64; i++) {
    j = c[i];
    cmsg[j - 1] = bmsg[i - 1];
  }
  printf("\nmirrored message:\n%s\n", cmsg);
  free_vector(c, 1, 64);
  free_vector(b, 1, 64);
  free_vector(a, 1, 64);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,-0x148(%rbp)
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,-0x150(%rbp)
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,-0x158(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe0a(%rip),%rdi
call   1060 <printf@plt>
lea    0xe15(%rip),%rdi
lea    0xe19(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x160(%rbp)
cmp    $0x0,%rax
jne    126d <main+0xbd>
lea    0xdfe(%rip),%rdi
call   1040 <nrerror@plt>
lea    -0x50(%rbp),%rdi
mov    -0x160(%rbp),%rdx
mov    $0x40,%esi
call   1090 <fgets@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jg     12c6 <main+0x116>
mov    -0x160(%rbp),%rdi
mov    -0x148(%rbp),%rdx
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xdd3(%rip),%rsi
call   1080 <fscanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1289 <main+0xd9>
mov    -0x160(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jg     1322 <main+0x172>
cvtsi2ssl -0x8(%rbp),%xmm0
mov    -0x150(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    $0x41,%eax
sub    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x158(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d9 <main+0x129>
mov    -0x148(%rbp),%rsi
mov    -0x150(%rbp),%rdx
mov    -0x158(%rbp),%rcx
mov    $0x40,%edi
call   10d0 <sort3@plt>
mov    -0x60(%rbp),%al
mov    %al,-0xb0(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jg     139a <main+0x1ea>
mov    -0x150(%rbp),%rax
movslq -0x8(%rbp),%rcx
cvttss2si (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xa0(%rbp,%rax,1),%cl
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1351 <main+0x1a1>
lea    -0xf0(%rbp),%rsi
lea    0xce1(%rip),%rdi
call   1060 <printf@plt>
mov    -0x60(%rbp),%al
mov    %al,-0x100(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jg     1406 <main+0x256>
mov    -0x158(%rbp),%rax
movslq -0x8(%rbp),%rcx
cvttss2si (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xf0(%rbp,%rax,1),%cl
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13bd <main+0x20d>
lea    -0x140(%rbp),%rsi
lea    0xc8d(%rip),%rdi
call   1060 <printf@plt>
mov    -0x158(%rbp),%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
mov    -0x150(%rbp),%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
mov    -0x148(%rbp),%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    $0x40,%esi
call   10a0 <vector@plt>
mov    %rax,%r13
lea    0x1000(%rip),%rsi
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x1011(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0x101f(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0x1027(%rip),%rdi
lea    0x102b(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1252 <main+0xa2>
lea    0x1019(%rip),%rdi
call   1040 <nrerror@plt>
lea    0x100(%rsp),%rdi
mov    $0x40,%esi
mov    %rbx,%rdx
call   1090 <fgets@plt>
mov    $0x4,%r14d
lea    0x1012(%rip),%rbp
mov    0x8(%rsp),%r12
nopl   0x0(%rax)
lea    (%r12,%r14,1),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <fscanf@plt>
add    $0x4,%r14
cmp    $0x104,%r14
jne    1280 <main+0xd0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0x4(%r15),%rax
lea    0x104(%r13),%rcx
cmp    %rcx,%rax
jae    132a <main+0x17a>
mov    %r15,%rdx
add    $0x104,%rdx
mov    %r13,%rcx
add    $0x4,%rcx
cmp    %rdx,%rcx
jae    132a <main+0x17a>
mov    $0x1,%edx
mov    $0x40,%esi
mov    0x8(%rsp),%rbp
lea    0x60(%rsp),%rbx
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
movss  %xmm0,-0x4(%rax,%rdx,4)
movss  %xmm1,-0x4(%rcx,%rdx,4)
lea    0x1(%rdx),%edi
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
movss  %xmm0,(%rax,%rdx,4)
lea    -0x1(%rsi),%edi
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
movss  %xmm0,(%rcx,%rdx,4)
add    $0xfffffffe,%esi
add    $0x2,%rdx
cmp    $0x41,%rdx
jne    12e0 <main+0x130>
jmp    14e4 <main+0x334>
movaps 0xccf(%rip),%xmm0
movups %xmm0,0x4(%r15)
movaps 0xcd3(%rip),%xmm0
movups %xmm0,0x4(%r13)
movaps 0xcd7(%rip),%xmm0
movups %xmm0,0x14(%r15)
movaps 0xcdb(%rip),%xmm0
movups %xmm0,0x14(%r13)
movaps 0xcdf(%rip),%xmm0
movups %xmm0,0x24(%r15)
movaps 0xce3(%rip),%xmm0
movups %xmm0,0x24(%r13)
movaps 0xce7(%rip),%xmm0
movups %xmm0,0x34(%r15)
movaps 0xceb(%rip),%xmm0
movups %xmm0,0x34(%r13)
movaps 0xcef(%rip),%xmm0
movups %xmm0,0x44(%r15)
movaps 0xcf3(%rip),%xmm0
movups %xmm0,0x44(%r13)
movaps 0xcf7(%rip),%xmm0
movups %xmm0,0x54(%r15)
movaps 0xcfb(%rip),%xmm0
movups %xmm0,0x54(%r13)
movaps 0xcff(%rip),%xmm0
movups %xmm0,0x64(%r15)
movaps 0xd03(%rip),%xmm0
movups %xmm0,0x64(%r13)
movaps 0xd07(%rip),%xmm0
movups %xmm0,0x74(%r15)
movaps 0xd0b(%rip),%xmm0
movups %xmm0,0x74(%r13)
movaps 0xd0f(%rip),%xmm0
movups %xmm0,0x84(%r15)
movaps 0xd10(%rip),%xmm0
movups %xmm0,0x84(%r13)
movaps 0xd11(%rip),%xmm0
movups %xmm0,0x94(%r15)
movaps 0xd12(%rip),%xmm0
movups %xmm0,0x94(%r13)
movaps 0xd13(%rip),%xmm0
movups %xmm0,0xa4(%r15)
movaps 0xd14(%rip),%xmm0
movups %xmm0,0xa4(%r13)
movaps 0xd15(%rip),%xmm0
movups %xmm0,0xb4(%r15)
movaps 0xd16(%rip),%xmm0
movups %xmm0,0xb4(%r13)
movaps 0xd17(%rip),%xmm0
movups %xmm0,0xc4(%r15)
movaps 0xd18(%rip),%xmm0
movups %xmm0,0xc4(%r13)
movaps 0xd19(%rip),%xmm0
movups %xmm0,0xd4(%r15)
movaps 0xd1a(%rip),%xmm0
movups %xmm0,0xd4(%r13)
movaps 0xd1b(%rip),%xmm0
movups %xmm0,0xe4(%r15)
movaps 0xd1c(%rip),%xmm0
movups %xmm0,0xe4(%r13)
movaps 0xd1d(%rip),%xmm0
movups %xmm0,0xf4(%r15)
movaps 0xd1e(%rip),%xmm0
movups %xmm0,0xf4(%r13)
mov    0x8(%rsp),%rbp
lea    0x60(%rsp),%rbx
mov    $0x40,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
call   10d0 <sort3@plt>
mov    0xa0(%rsp),%al
mov    %al,0x50(%rsp)
mov    $0x2,%eax
nopw   0x0(%rax,%rax,1)
cvttss2si -0x4(%r15,%rax,4),%ecx
movslq %ecx,%rcx
movzbl -0x1(%rcx,%rbx,1),%ecx
mov    %cl,0xe(%rsp,%rax,1)
cvttss2si (%r15,%rax,4),%ecx
movslq %ecx,%rcx
movzbl -0x1(%rcx,%rbx,1),%ecx
mov    %cl,0xf(%rsp,%rax,1)
add    $0x2,%rax
cmp    $0x42,%rax
jne    1510 <main+0x360>
lea    0xd43(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1060 <printf@plt>
mov    0xa0(%rsp),%al
mov    %al,0xf0(%rsp)
mov    $0x2,%eax
lea    0xb0(%rsp),%rsi
nopl   0x0(%rax,%rax,1)
cvttss2si -0x4(%r13,%rax,4),%edx
movslq %edx,%rdx
movzbl 0xe(%rsp,%rax,1),%ebx
movzbl 0xf(%rsp,%rax,1),%ecx
mov    %bl,-0x1(%rdx,%rsi,1)
cvttss2si 0x0(%r13,%rax,4),%edx
movslq %edx,%rdx
mov    %cl,-0x1(%rdx,%rsi,1)
add    $0x2,%rax
cmp    $0x42,%rax
jne    1570 <main+0x3c0>
lea    0xcfa(%rip),%rdi
lea    0xb0(%rsp),%rsi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x40,%edx
call   1070 <free_vector@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"I'd rather have a bottle in front of\00"
@.str.1 = [29 x i8] c" me than a frontal lobotomy.\00"
@.str.2 = [23 x i8] c"\0Aoriginal message:\0A%s\0A\00"
@.str.3 = [11 x i8] c"tarray.dat\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [32 x i8] c"Data file tarray.dat not found\0A\00"
@.str.6 = [3 x i8] c"%f\00"
@.str.7 = [24 x i8] c"\0Ascrambled message:\0A%s\0A\00"
@.str.8 = [23 x i8] c"\0Amirrored message:\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [64 x i8]
%5 = alloca [65 x i8]
%6 = alloca [65 x i8]
%7 = alloca [65 x i8]
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32*
store i32 0, i32* %1
%12 = call float* @vector(i32 1, i32 64)
store float* %12, float** %8
%13 = call float* @vector(i32 1, i32 64)
store float* %13, float** %9
%14 = call float* @vector(i32 1, i32 64)
store float* %14, float** %10
%15 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 0
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 0
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%19 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %21, i32** %11
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23, %0
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%27 = load i32*, i32** %11
%28 = call i32 @fgets(i8* %26, i32 64, i32* %27)
store i32 1, i32* %2
br label %29
29: ; preds = %39, %25
%30 = load i32, i32* %2
%31 = icmp sle i32 %30, 64
br i1 %31, label %32, label %42
32: ; preds = %29
%33 = load i32*, i32** %11
%34 = load float*, float** %8
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
%38 = call i32 @fscanf(i32* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %37)
br label %39
39: ; preds = %32
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %29
42: ; preds = %29
%43 = load i32*, i32** %11
%44 = call i32 @fclose(i32* %43)
store i32 1, i32* %2
br label %45
45: ; preds = %62, %42
%46 = load i32, i32* %2
%47 = icmp sle i32 %46, 64
br i1 %47, label %48, label %65
48: ; preds = %45
%49 = load i32, i32* %2
%50 = sitofp i32 %49 to float
%51 = load float*, float** %9
%52 = load i32, i32* %2
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds float, float* %51, i64 %53
store float %50, float* %54
%55 = load i32, i32* %2
%56 = sub nsw i32 65, %55
%57 = sitofp i32 %56 to float
%58 = load float*, float** %10
%59 = load i32, i32* %2
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds float, float* %58, i64 %60
store float %57, float* %61
br label %62
62: ; preds = %48
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
br label %45
65: ; preds = %45
%66 = load float*, float** %8
%67 = load float*, float** %9
%68 = load float*, float** %10
%69 = call i32 @sort3(i32 64, float* %66, float* %67, float* %68)
%70 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 64
%71 = load i8, i8* %70
%72 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 64
store i8 %71, i8* %72
store i32 1, i32* %2
br label %73
73: ; preds = %92, %65
%74 = load i32, i32* %2
%75 = icmp sle i32 %74, 64
br i1 %75, label %76, label %95
76: ; preds = %73
%77 = load float*, float** %9
%78 = load i32, i32* %2
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds float, float* %77, i64 %79
%81 = load float, float* %80
%82 = fptosi float %81 to i32
store i32 %82, i32* %3
%83 = load i32, i32* %3
%84 = sub nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = load i32, i32* %2
%89 = sub nsw i32 %88, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 %90
store i8 %87, i8* %91
br label %92
92: ; preds = %76
%93 = load i32, i32* %2
%94 = add nsw i32 %93, 1
store i32 %94, i32* %2
br label %73
95: ; preds = %73
%96 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 0
%97 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %96)
%98 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 64
%99 = load i8, i8* %98
%100 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 64
store i8 %99, i8* %100
store i32 1, i32* %2
br label %101
101: ; preds = %120, %95
%102 = load i32, i32* %2
%103 = icmp sle i32 %102, 64
br i1 %103, label %104, label %123
104: ; preds = %101
%105 = load float*, float** %10
%106 = load i32, i32* %2
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds float, float* %105, i64 %107
%109 = load float, float* %108
%110 = fptosi float %109 to i32
store i32 %110, i32* %3
%111 = load i32, i32* %2
%112 = sub nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = load i32, i32* %3
%117 = sub nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 %118
store i8 %115, i8* %119
br label %120
120: ; preds = %104
%121 = load i32, i32* %2
%122 = add nsw i32 %121, 1
store i32 %122, i32* %2
br label %101
123: ; preds = %101
%124 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
%125 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %124)
%126 = load float*, float** %10
%127 = call i32 @free_vector(float* %126, i32 1, i32 64)
%128 = load float*, float** %9
%129 = call i32 @free_vector(float* %128, i32 1, i32 64)
%130 = load float*, float** %8
%131 = call i32 @free_vector(float* %130, i32 1, i32 64)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"I'd rather have a bottle in front of\00"
@.str.1 = [29 x i8] c" me than a frontal lobotomy.\00"
@.str.2 = [23 x i8] c"\0Aoriginal message:\0A%s\0A\00"
@.str.3 = [11 x i8] c"tarray.dat\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [32 x i8] c"Data file tarray.dat not found\0A\00"
@.str.6 = [3 x i8] c"%f\00"
@.str.7 = [24 x i8] c"\0Ascrambled message:\0A%s\0A\00"
@.str.8 = [23 x i8] c"\0Amirrored message:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca [65 x i8]
%3 = alloca [65 x i8]
%4 = alloca [65 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 0
%9 = tail call float* @vector(i32 1, i32 64)
%10 = tail call float* @vector(i32 1, i32 64)
%11 = tail call float* @vector(i32 1, i32 64)
%12 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%15 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17, %0
%20 = call i32 @fgets(i8* %5, i32 64, i32* %15)
br label %21
21: ; preds = %19, %21
%22 = phi i64 [ 1, %19 ], [ %25, %21 ]
%23 = getelementptr inbounds float, float* %9, i64 %22
%24 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %23)
%25 = add nuw nsw i64 %22, 1
%26 = icmp eq i64 %25, 65
br i1 %26, label %27, label %21
27: ; preds = %21
%28 = call i32 @fclose(i32* %15)
%29 = getelementptr float, float* %10, i64 1
%30 = getelementptr float, float* %10, i64 65
%31 = getelementptr float, float* %11, i64 1
%32 = getelementptr float, float* %11, i64 65
%33 = icmp ult float* %29, %32
%34 = icmp ult float* %31, %30
%35 = and i1 %33, %34
br i1 %35, label %101, label %36
36: ; preds = %27
%37 = getelementptr inbounds float, float* %10, i64 1
%38 = bitcast float* %37 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>, <4 x float>* %38
%39 = getelementptr inbounds float, float* %11, i64 1
%40 = bitcast float* %39 to <4 x float>*
store <4 x float> <float 6.400000e+01, float 6.300000e+01, float 6.200000e+01, float 6.100000e+01>, <4 x float>* %40
%41 = getelementptr inbounds float, float* %10, i64 5
%42 = bitcast float* %41 to <4 x float>*
store <4 x float> <float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00>, <4 x float>* %42
%43 = getelementptr inbounds float, float* %11, i64 5
%44 = bitcast float* %43 to <4 x float>*
store <4 x float> <float 6.000000e+01, float 5.900000e+01, float 5.800000e+01, float 5.700000e+01>, <4 x float>* %44
%45 = getelementptr inbounds float, float* %10, i64 9
%46 = bitcast float* %45 to <4 x float>*
store <4 x float> <float 9.000000e+00, float 1.000000e+01, float 1.100000e+01, float 1.200000e+01>, <4 x float>* %46
%47 = getelementptr inbounds float, float* %11, i64 9
%48 = bitcast float* %47 to <4 x float>*
store <4 x float> <float 5.600000e+01, float 5.500000e+01, float 5.400000e+01, float 5.300000e+01>, <4 x float>* %48
%49 = getelementptr inbounds float, float* %10, i64 13
%50 = bitcast float* %49 to <4 x float>*
store <4 x float> <float 1.300000e+01, float 1.400000e+01, float 1.500000e+01, float 1.600000e+01>, <4 x float>* %50
%51 = getelementptr inbounds float, float* %11, i64 13
%52 = bitcast float* %51 to <4 x float>*
store <4 x float> <float 5.200000e+01, float 5.100000e+01, float 5.000000e+01, float 4.900000e+01>, <4 x float>* %52
%53 = getelementptr inbounds float, float* %10, i64 17
%54 = bitcast float* %53 to <4 x float>*
store <4 x float> <float 1.700000e+01, float 1.800000e+01, float 1.900000e+01, float 2.000000e+01>, <4 x float>* %54
%55 = getelementptr inbounds float, float* %11, i64 17
%56 = bitcast float* %55 to <4 x float>*
store <4 x float> <float 4.800000e+01, float 4.700000e+01, float 4.600000e+01, float 4.500000e+01>, <4 x float>* %56
%57 = getelementptr inbounds float, float* %10, i64 21
%58 = bitcast float* %57 to <4 x float>*
store <4 x float> <float 2.100000e+01, float 2.200000e+01, float 2.300000e+01, float 2.400000e+01>, <4 x float>* %58
%59 = getelementptr inbounds float, float* %11, i64 21
%60 = bitcast float* %59 to <4 x float>*
store <4 x float> <float 4.400000e+01, float 4.300000e+01, float 4.200000e+01, float 4.100000e+01>, <4 x float>* %60
%61 = getelementptr inbounds float, float* %10, i64 25
%62 = bitcast float* %61 to <4 x float>*
store <4 x float> <float 2.500000e+01, float 2.600000e+01, float 2.700000e+01, float 2.800000e+01>, <4 x float>* %62
%63 = getelementptr inbounds float, float* %11, i64 25
%64 = bitcast float* %63 to <4 x float>*
store <4 x float> <float 4.000000e+01, float 3.900000e+01, float 3.800000e+01, float 3.700000e+01>, <4 x float>* %64
%65 = getelementptr inbounds float, float* %10, i64 29
%66 = bitcast float* %65 to <4 x float>*
store <4 x float> <float 2.900000e+01, float 3.000000e+01, float 3.100000e+01, float 3.200000e+01>, <4 x float>* %66
%67 = getelementptr inbounds float, float* %11, i64 29
%68 = bitcast float* %67 to <4 x float>*
store <4 x float> <float 3.600000e+01, float 3.500000e+01, float 3.400000e+01, float 3.300000e+01>, <4 x float>* %68
%69 = getelementptr inbounds float, float* %10, i64 33
%70 = bitcast float* %69 to <4 x float>*
store <4 x float> <float 3.300000e+01, float 3.400000e+01, float 3.500000e+01, float 3.600000e+01>, <4 x float>* %70
%71 = getelementptr inbounds float, float* %11, i64 33
%72 = bitcast float* %71 to <4 x float>*
store <4 x float> <float 3.200000e+01, float 3.100000e+01, float 3.000000e+01, float 2.900000e+01>, <4 x float>* %72
%73 = getelementptr inbounds float, float* %10, i64 37
%74 = bitcast float* %73 to <4 x float>*
store <4 x float> <float 3.700000e+01, float 3.800000e+01, float 3.900000e+01, float 4.000000e+01>, <4 x float>* %74
%75 = getelementptr inbounds float, float* %11, i64 37
%76 = bitcast float* %75 to <4 x float>*
store <4 x float> <float 2.800000e+01, float 2.700000e+01, float 2.600000e+01, float 2.500000e+01>, <4 x float>* %76
%77 = getelementptr inbounds float, float* %10, i64 41
%78 = bitcast float* %77 to <4 x float>*
store <4 x float> <float 4.100000e+01, float 4.200000e+01, float 4.300000e+01, float 4.400000e+01>, <4 x float>* %78
%79 = getelementptr inbounds float, float* %11, i64 41
%80 = bitcast float* %79 to <4 x float>*
store <4 x float> <float 2.400000e+01, float 2.300000e+01, float 2.200000e+01, float 2.100000e+01>, <4 x float>* %80
%81 = getelementptr inbounds float, float* %10, i64 45
%82 = bitcast float* %81 to <4 x float>*
store <4 x float> <float 4.500000e+01, float 4.600000e+01, float 4.700000e+01, float 4.800000e+01>, <4 x float>* %82
%83 = getelementptr inbounds float, float* %11, i64 45
%84 = bitcast float* %83 to <4 x float>*
store <4 x float> <float 2.000000e+01, float 1.900000e+01, float 1.800000e+01, float 1.700000e+01>, <4 x float>* %84
%85 = getelementptr inbounds float, float* %10, i64 49
%86 = bitcast float* %85 to <4 x float>*
store <4 x float> <float 4.900000e+01, float 5.000000e+01, float 5.100000e+01, float 5.200000e+01>, <4 x float>* %86
%87 = getelementptr inbounds float, float* %11, i64 49
%88 = bitcast float* %87 to <4 x float>*
store <4 x float> <float 1.600000e+01, float 1.500000e+01, float 1.400000e+01, float 1.300000e+01>, <4 x float>* %88
%89 = getelementptr inbounds float, float* %10, i64 53
%90 = bitcast float* %89 to <4 x float>*
store <4 x float> <float 5.300000e+01, float 5.400000e+01, float 5.500000e+01, float 5.600000e+01>, <4 x float>* %90
%91 = getelementptr inbounds float, float* %11, i64 53
%92 = bitcast float* %91 to <4 x float>*
store <4 x float> <float 1.200000e+01, float 1.100000e+01, float 1.000000e+01, float 9.000000e+00>, <4 x float>* %92
%93 = getelementptr inbounds float, float* %10, i64 57
%94 = bitcast float* %93 to <4 x float>*
store <4 x float> <float 5.700000e+01, float 5.800000e+01, float 5.900000e+01, float 6.000000e+01>, <4 x float>* %94
%95 = getelementptr inbounds float, float* %11, i64 57
%96 = bitcast float* %95 to <4 x float>*
store <4 x float> <float 8.000000e+00, float 7.000000e+00, float 6.000000e+00, float 5.000000e+00>, <4 x float>* %96
%97 = getelementptr inbounds float, float* %10, i64 61
%98 = bitcast float* %97 to <4 x float>*
store <4 x float> <float 6.100000e+01, float 6.200000e+01, float 6.300000e+01, float 6.400000e+01>, <4 x float>* %98
%99 = getelementptr inbounds float, float* %11, i64 61
%100 = bitcast float* %99 to <4 x float>*
store <4 x float> <float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00>, <4 x float>* %100
br label %120
101: ; preds = %27, %101
%102 = phi i64 [ %118, %101 ], [ 1, %27 ]
%103 = trunc i64 %102 to i32
%104 = sitofp i32 %103 to float
%105 = getelementptr inbounds float, float* %10, i64 %102
store float %104, float* %105
%106 = trunc i64 %102 to i32
%107 = sub nuw nsw i32 65, %106
%108 = sitofp i32 %107 to float
%109 = getelementptr inbounds float, float* %11, i64 %102
store float %108, float* %109
%110 = add nuw nsw i64 %102, 1
%111 = trunc i64 %110 to i32
%112 = sitofp i32 %111 to float
%113 = getelementptr inbounds float, float* %10, i64 %110
store float %112, float* %113
%114 = trunc i64 %110 to i32
%115 = sub nuw nsw i32 65, %114
%116 = sitofp i32 %115 to float
%117 = getelementptr inbounds float, float* %11, i64 %110
store float %116, float* %117
%118 = add nuw nsw i64 %102, 2
%119 = icmp eq i64 %118, 65
br i1 %119, label %120, label %101
120: ; preds = %101, %36
%121 = call i32 @sort3(i32 64, float* %9, float* %10, float* %11)
%122 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 64
%123 = load i8, i8* %122
%124 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 64
store i8 %123, i8* %124
br label %125
125: ; preds = %125, %120
%126 = phi i64 [ 1, %120 ], [ %145, %125 ]
%127 = getelementptr inbounds float, float* %10, i64 %126
%128 = load float, float* %127
%129 = fptosi float %128 to i32
%130 = add nsw i32 %129, -1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 %131
%133 = load i8, i8* %132
%134 = add nsw i64 %126, -1
%135 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 %134
store i8 %133, i8* %135
%136 = add nuw nsw i64 %126, 1
%137 = getelementptr inbounds float, float* %10, i64 %136
%138 = load float, float* %137
%139 = fptosi float %138 to i32
%140 = add nsw i32 %139, -1
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 %141
%143 = load i8, i8* %142
%144 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 %126
store i8 %143, i8* %144
%145 = add nuw nsw i64 %126, 2
%146 = icmp eq i64 %145, 65
br i1 %146, label %147, label %125
147: ; preds = %125
%148 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%149 = load i8, i8* %122
%150 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 64
store i8 %149, i8* %150
br label %151
151: ; preds = %151, %147
%152 = phi i64 [ 1, %147 ], [ %171, %151 ]
%153 = getelementptr inbounds float, float* %11, i64 %152
%154 = load float, float* %153
%155 = fptosi float %154 to i32
%156 = add nsw i64 %152, -1
%157 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 %156
%158 = load i8, i8* %157
%159 = add nsw i32 %155, -1
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 %160
store i8 %158, i8* %161
%162 = add nuw nsw i64 %152, 1
%163 = getelementptr inbounds float, float* %11, i64 %162
%164 = load float, float* %163
%165 = fptosi float %164 to i32
%166 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 %152
%167 = load i8, i8* %166
%168 = add nsw i32 %165, -1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 %169
store i8 %167, i8* %170
%171 = add nuw nsw i64 %152, 2
%172 = icmp eq i64 %171, 65
br i1 %172, label %173, label %151
173: ; preds = %151
%174 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %8)
%175 = call i32 @free_vector(float* %11, i32 1, i32 64)
%176 = call i32 @free_vector(float* %10, i32 1, i32 64)
%177 = call i32 @free_vector(float* %9, i32 1, i32 64)
ret i32 0
}