#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int save_ugly_int(double *vertex, int a, int b, int c, int d, int x) {
  FILE *f;
  static int fn = 0;
  char buf[1024];
  sprintf(buf, "ugly_int%d.raw", fn);
  f = fopen(buf, "w");
  if (!f)
    return 1;
  fprintf(f, "5 4 1 5\n");
  fprintf(f, "%lf %lf %lf\n", vertex[3 * a + 0], vertex[3 * a + 1],
          vertex[3 * a + 2]);
  fprintf(f, "%lf %lf %lf\n", vertex[3 * b + 0], vertex[3 * b + 1],
          vertex[3 * b + 2]);
  fprintf(f, "%lf %lf %lf\n", vertex[3 * c + 0], vertex[3 * c + 1],
          vertex[3 * c + 2]);
  fprintf(f, "%lf %lf %lf\n", vertex[3 * d + 0], vertex[3 * d + 1],
          vertex[3 * d + 2]);
  fprintf(f, "%lf %lf %lf\n", vertex[3 * x + 0], vertex[3 * x + 1],
          vertex[3 * x + 2]);
  fprintf(f, "1 2 3\n");
  fprintf(f, "2 3 4\n");
  fprintf(f, "3 4 1\n");
  fprintf(f, "4 1 2\n");
  fprintf(f, "1 5\n");
  fprintf(f, "1 A\n");
  fprintf(f, "2 B\n");
  fprintf(f, "3 C\n");
  fprintf(f, "4 D\n");
  fprintf(f, "5 X\n");
  fclose(f);
  return fn++;
}


x86 assembly (clang, -O0):
<save_ugly_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    -0x430(%rbp),%rdi
mov    0x2ed7(%rip),%edx
lea    0xe8c(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x430(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11a7 <save_ugly_int+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1401 <save_ugly_int+0x2c1>
mov    -0x30(%rbp),%rdi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x14(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xe1b(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xdd0(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xd85(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xd3a(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xcef(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcea(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcdf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcc9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc92(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2c51(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2c46(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_ugly_int>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,(%rsp)
mov    %ecx,%r13d
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%rbx
mov    0x2ed0(%rip),%edx
lea    0xe7d(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <sprintf@plt>
lea    0xe76(%rip),%rsi
mov    %rbp,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     139a <save_ugly_int+0x24a>
mov    %rax,%r15
lea    0xe5d(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1070 <fwrite@plt>
lea    (%r12,%r12,2),%eax
cltq
movsd  (%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  0x10(%rbx,%rax,8),%xmm2
lea    0xe36(%rip),%rbp
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
lea    (%r14,%r14,2),%eax
cltq
movsd  (%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  0x10(%rbx,%rax,8),%xmm2
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
lea    0x0(%r13,%r13,2),%eax
cltq
movsd  (%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  0x10(%rbx,%rax,8),%xmm2
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    (%rsp),%rax
lea    (%rax,%rax,2),%eax
cltq
movsd  (%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  0x10(%rbx,%rax,8),%xmm2
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    0x8(%rsp),%rax
lea    (%rax,%rax,2),%eax
cltq
movsd  (%rbx,%rax,8),%xmm0
movsd  0x8(%rbx,%rax,8),%xmm1
movsd  0x10(%rbx,%rax,8),%xmm2
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
lea    0xd97(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd85(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd73(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd61(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd21(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd36(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd22(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xd0e(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xcfa(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
lea    0xce6(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1070 <fwrite@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    0x2cbd(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2cb4(%rip)
jmp    139f <save_ugly_int+0x24f>
mov    $0x1,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@save_ugly_int.fn = internal unnamed_addr global i32 0
@.str = [15 x i8] c"ugly_int%d.raw\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [9 x i8] c"5 4 1 5\0A\00"
@.str.3 = [13 x i8] c"%lf %lf %lf\0A\00"
@.str.4 = [7 x i8] c"1 2 3\0A\00"
@.str.5 = [7 x i8] c"2 3 4\0A\00"
@.str.6 = [7 x i8] c"3 4 1\0A\00"
@.str.7 = [7 x i8] c"4 1 2\0A\00"
@.str.8 = [5 x i8] c"1 5\0A\00"
@.str.9 = [5 x i8] c"1 A\0A\00"
@.str.10 = [5 x i8] c"2 B\0A\00"
@.str.11 = [5 x i8] c"3 C\0A\00"
@.str.12 = [5 x i8] c"4 D\0A\00"
@.str.13 = [5 x i8] c"5 X\0A\00"
define i32 @save_ugly_int(double* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [1024 x i8]
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* @save_ugly_int.fn
%10 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %93, label %13
13: ; preds = %6
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 1, i32* %11)
%15 = mul nsw i32 %1, 3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %0, i64 %16
%18 = load double, double* %17
%19 = add nsw i32 %15, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %0, i64 %20
%22 = load double, double* %21
%23 = add nsw i32 %15, 2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = load double, double* %25
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %18, double %22, double %26)
%28 = mul nsw i32 %2, 3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %0, i64 %29
%31 = load double, double* %30
%32 = add nsw i32 %28, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %0, i64 %33
%35 = load double, double* %34
%36 = add nsw i32 %28, 2
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %0, i64 %37
%39 = load double, double* %38
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %31, double %35, double %39)
%41 = mul nsw i32 %3, 3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %0, i64 %42
%44 = load double, double* %43
%45 = add nsw i32 %41, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %0, i64 %46
%48 = load double, double* %47
%49 = add nsw i32 %41, 2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = load double, double* %51
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %44, double %48, double %52)
%54 = mul nsw i32 %4, 3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %0, i64 %55
%57 = load double, double* %56
%58 = add nsw i32 %54, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = load double, double* %60
%62 = add nsw i32 %54, 2
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %0, i64 %63
%65 = load double, double* %64
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %57, double %61, double %65)
%67 = mul nsw i32 %5, 3
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %0, i64 %68
%70 = load double, double* %69
%71 = add nsw i32 %67, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %0, i64 %72
%74 = load double, double* %73
%75 = add nsw i32 %67, 2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %0, i64 %76
%78 = load double, double* %77
%79 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %70, double %74, double %78)
%80 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 6, i64 1, i32* %11)
%81 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 6, i64 1, i32* %11)
%82 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i64 6, i64 1, i32* %11)
%83 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i64 6, i64 1, i32* %11)
%84 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 4, i64 1, i32* %11)
%85 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 4, i64 1, i32* %11)
%86 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %11)
%87 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 4, i64 1, i32* %11)
%88 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i64 4, i64 1, i32* %11)
%89 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i64 4, i64 1, i32* %11)
%90 = tail call i32 @fclose(i32* %11)
%91 = load i32, i32* @save_ugly_int.fn
%92 = add nsw i32 %91, 1
store i32 %92, i32* @save_ugly_int.fn
br label %93
93: ; preds = %6, %13
%94 = phi i32 [ %91, %13 ], [ 1, %6 ]
ret i32 %94
}