#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 main() {
  int i = 0;
  int n = 10000;
  FILE *fout = fopen("inp.txt", "w");
  fprintf(fout, "%d", n);
  fprintf(fout, "\n");
  for (i = 0; i < n; ++i) {
    fprintf(fout, "%f ", 1. + .01 * (float)i / (float)n);
  }
  fprintf(fout, "\n");
  for (i = 0; i < n; ++i) {
    fprintf(fout, "%f ", 100. + 10. * (float)i / (float)n);
  }
  fprintf(fout, "\n");
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2710,-0xc(%rbp)
lea    0xecc(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ec <main+0xbc>
mov    -0x18(%rbp),%rdi
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe65(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe44(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xe58(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <main+0x62>
mov    -0x18(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    125f <main+0x12f>
mov    -0x18(%rbp),%rdi
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde2(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  0xdc1(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xde5(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1205 <main+0xd5>
mov    -0x18(%rbp),%rdi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xedd(%rip),%rdi
lea    0xede(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xed1(%rip),%rsi
xor    %ebp,%ebp
mov    %rax,%rdi
mov    $0x2710,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe5d(%rip),%xmm0
divsd  0xe5d(%rip),%xmm0
addsd  0xe5d(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    1190 <main+0x50>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
xor    %ebp,%ebp
lea    0xe54(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe15(%rip),%xmm0
divsd  0xdfd(%rip),%xmm0
addsd  0xe0d(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    11f0 <main+0xb0>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"inp.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 10000, i32* %3
%5 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %3
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %4
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %11
11: ; preds = %27, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = load i32, i32* %2
%18 = sitofp i32 %17 to float
%19 = fpext float %18 to double
%20 = fmul double 1.000000e-02, %19
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = fpext float %22 to double
%24 = fdiv double %20, %23
%25 = fadd double 1.000000e+00, %24
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %25)
br label %27
27: ; preds = %15
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %11
30: ; preds = %11
%31 = load i32*, i32** %4
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %33
33: ; preds = %49, %30
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %52
37: ; preds = %33
%38 = load i32*, i32** %4
%39 = load i32, i32* %2
%40 = sitofp i32 %39 to float
%41 = fpext float %40 to double
%42 = fmul double 1.000000e+01, %41
%43 = load i32, i32* %3
%44 = sitofp i32 %43 to float
%45 = fpext float %44 to double
%46 = fdiv double %42, %45
%47 = fadd double 1.000000e+02, %46
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %47)
br label %49
49: ; preds = %37
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %33
52: ; preds = %33
%53 = load i32*, i32** %4
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%55 = load i32*, i32** %4
%56 = call i32 @fclose(i32* %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"inp.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 10000)
%3 = tail call i32 @fputc(i32 10, i32* %1)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %12, %4 ]
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = fmul double %7, 1.000000e-02
%9 = fdiv double %8, 1.000000e+04
%10 = fadd double %9, 1.000000e+00
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %10)
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 10000
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = tail call i32 @fputc(i32 10, i32* %1)
br label %16
16: ; preds = %14, %16
%17 = phi i32 [ 0, %14 ], [ %24, %16 ]
%18 = sitofp i32 %17 to float
%19 = fpext float %18 to double
%20 = fmul double %19, 1.000000e+01
%21 = fdiv double %20, 1.000000e+04
%22 = fadd double %21, 1.000000e+02
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %22)
%24 = add nuw nsw i32 %17, 1
%25 = icmp eq i32 %24, 10000
br i1 %25, label %26, label %16
26: ; preds = %16
%27 = tail call i32 @fputc(i32 10, i32* %1)
%28 = tail call i32 @fclose(i32* %1)
ret i32 0
}