#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);
int /*<<< orphan*/ free(int *);
void Save_Seq2(char *Filename, int N) {
  int counter = 0;
  int integer = N;
  int gap[counter];
  while (N >= 1) {
    gap[counter] = integer / 1.3;
    counter++;
    if (integer == 9 || integer == 10)
      integer = 11;
  }
  FILE *fptr = NULL;
  fptr = fopen(Filename, "w");
  if (fptr == NULL)
    return;
  int j = 0;
  while (gap[j + 1]) {
    j++;
  }
  fprintf(fptr, "%d\n", j);
  int i = 0;
  while (i < j) {
    fprintf(fptr, "%d\n", j);
    i++;
  }
  fclose(fptr);
  free(gap);
}


x86 assembly (clang, -O0):
<Save_Seq2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     11d6 <Save_Seq2+0x96>
mov    -0x48(%rbp),%rax
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x9,-0x14(%rbp)
je     11ca <Save_Seq2+0x8a>
cmpl   $0xa,-0x14(%rbp)
jne    11d1 <Save_Seq2+0x91>
movl   $0xb,-0x14(%rbp)
jmp    1183 <Save_Seq2+0x43>
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1209 <Save_Seq2+0xc9>
movl   $0x1,-0x34(%rbp)
jmp    1295 <Save_Seq2+0x155>
movl   $0x0,-0x38(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1235 <Save_Seq2+0xf5>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1210 <Save_Seq2+0xd0>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xdc7(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    127c <Save_Seq2+0x13c>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xda1(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    124f <Save_Seq2+0x10f>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Save_Seq2>:
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    115c <Save_Seq2+0x1c>
cvtsi2sd %esi,%xmm0
divsd  0xeab(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rsp)
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1191 <Save_Seq2+0x51>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %rsp,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @Save_Seq2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %7
%17 = alloca i32, i64 %15
store i64 %15, i64* %8
br label %18
18: ; preds = %37, %2
%19 = load i32, i32* %4
%20 = icmp sge i32 %19, 1
br i1 %20, label %21, label %38
21: ; preds = %18
%22 = load i32, i32* %6
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 1.300000e+00
%25 = fptosi double %24 to i32
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %17, i64 %27
store i32 %25, i32* %28
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, 9
br i1 %32, label %36, label %33
33: ; preds = %21
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 10
br i1 %35, label %36, label %37
36: ; preds = %33, %21
store i32 11, i32* %6
br label %37
37: ; preds = %36, %33
br label %18
38: ; preds = %18
store i32* null, i32** %9
%39 = load i8*, i8** %3
%40 = call i32* @fopen(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %40, i32** %9
%41 = load i32*, i32** %9
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %44
43: ; preds = %38
store i32 1, i32* %10
br label %73
44: ; preds = %38
store i32 0, i32* %11
br label %45
45: ; preds = %52, %44
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %17, i64 %48
%50 = load i32, i32* %49
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %45
%53 = load i32, i32* %11
%54 = add nsw i32 %53, 1
store i32 %54, i32* %11
br label %45
55: ; preds = %45
%56 = load i32*, i32** %9
%57 = load i32, i32* %11
%58 = call i32 @fprintf(i32* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
store i32 0, i32* %12
br label %59
59: ; preds = %63, %55
%60 = load i32, i32* %12
%61 = load i32, i32* %11
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %69
63: ; preds = %59
%64 = load i32*, i32** %9
%65 = load i32, i32* %11
%66 = call i32 @fprintf(i32* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %12
%68 = add nsw i32 %67, 1
store i32 %68, i32* %12
br label %59
69: ; preds = %59
%70 = load i32*, i32** %9
%71 = call i32 @fclose(i32* %70)
%72 = call i32 @free(i32* %17)
store i32 0, i32* %10
br label %73
73: ; preds = %69, %43
%74 = load i8*, i8** %7
%75 = load i32, i32* %10
switch i32 %75, label %77 [
i32 0, label %76
i32 1, label %76
]
76: ; preds = %73, %73
ret void
77: ; preds = %73
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @Save_Seq2(i8* nocapture %0, i32 %1) {
%3 = alloca [0 x i32]
%4 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = sitofp i32 %1 to double
%8 = fdiv double %7, 1.300000e+00
%9 = fptosi double %8 to i32
store i32 %9, i32* %4
br label %10
10: ; preds = %6, %2
%11 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = tail call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%15 = tail call i32 @fclose(i32* %11)
%16 = call i32 @free(i32* %4)
br label %17
17: ; preds = %10, %13
ret void
}