#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*/ print_clb(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ print_footer(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_header(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int main(void) {
  FILE *fpout;
  char fname[100];
  for (int i_FI = 5; i_FI <= 10; i_FI++) {
    for (int i_clbI = 50; i_clbI <= 100; i_clbI += 10) {
      sprintf(fname, "chain_FI%d_I%d.xml", i_FI, i_clbI);
      fpout = fopen(fname, "w");
      print_header(fpout);
      print_clb(fpout, i_FI, i_clbI);
      print_footer(fpout);
      fclose(fpout);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x84(%rbp)
cmpl   $0xa,-0x84(%rbp)
jg     122d <main+0xcd>
movl   $0x32,-0x88(%rbp)
cmpl   $0x64,-0x88(%rbp)
jg     1214 <main+0xb4>
lea    -0x80(%rbp),%rdi
mov    -0x84(%rbp),%edx
mov    -0x88(%rbp),%ecx
lea    0xe49(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x80(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <print_header@plt>
mov    -0x10(%rbp),%rdi
mov    -0x84(%rbp),%esi
mov    -0x88(%rbp),%edx
call   1030 <print_clb@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print_footer@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x88(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x88(%rbp)
jmp    1193 <main+0x33>
jmp    1219 <main+0xb9>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    117c <main+0x1c>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    $0x5,%ebp
lea    0xe88(%rip),%r14
mov    %rsp,%r15
lea    0xe91(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x32,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x32,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x3c,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x3c,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x46,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x46,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x50,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x50,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x5a,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x5a,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1080 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <print_header@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x64,%edx
call   1030 <print_clb@plt>
mov    %rbx,%rdi
call   1050 <print_footer@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x1,%ebp
cmp    $0xb,%ebp
jne    1190 <main+0x30>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"chain_FI%d_I%d.xml\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %4
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %37
9: ; preds = %6
store i32 50, i32* %5
br label %10
10: ; preds = %30, %9
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 100
br i1 %12, label %13, label %33
13: ; preds = %10
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %2
%20 = load i32*, i32** %2
%21 = call i32 @print_header(i32* %20)
%22 = load i32*, i32** %2
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = call i32 @print_clb(i32* %22, i32 %23, i32 %24)
%26 = load i32*, i32** %2
%27 = call i32 @print_footer(i32* %26)
%28 = load i32*, i32** %2
%29 = call i32 @fclose(i32* %28)
br label %30
30: ; preds = %13
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 10
store i32 %32, i32* %5
br label %10
33: ; preds = %10
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %6
37: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"chain_FI%d_I%d.xml\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 5, %0 ], [ %41, %3 ]
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 50)
%6 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @print_header(i32* %6)
%8 = tail call i32 @print_clb(i32* %6, i32 %4, i32 50)
%9 = tail call i32 @print_footer(i32* %6)
%10 = tail call i32 @fclose(i32* %6)
%11 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 60)
%12 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @print_header(i32* %12)
%14 = tail call i32 @print_clb(i32* %12, i32 %4, i32 60)
%15 = tail call i32 @print_footer(i32* %12)
%16 = tail call i32 @fclose(i32* %12)
%17 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 70)
%18 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @print_header(i32* %18)
%20 = tail call i32 @print_clb(i32* %18, i32 %4, i32 70)
%21 = tail call i32 @print_footer(i32* %18)
%22 = tail call i32 @fclose(i32* %18)
%23 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 80)
%24 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 @print_header(i32* %24)
%26 = tail call i32 @print_clb(i32* %24, i32 %4, i32 80)
%27 = tail call i32 @print_footer(i32* %24)
%28 = tail call i32 @fclose(i32* %24)
%29 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 90)
%30 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = tail call i32 @print_header(i32* %30)
%32 = tail call i32 @print_clb(i32* %30, i32 %4, i32 90)
%33 = tail call i32 @print_footer(i32* %30)
%34 = tail call i32 @fclose(i32* %30)
%35 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 100)
%36 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @print_header(i32* %36)
%38 = tail call i32 @print_clb(i32* %36, i32 %4, i32 100)
%39 = tail call i32 @print_footer(i32* %36)
%40 = tail call i32 @fclose(i32* %36)
%41 = add nuw nsw i32 %4, 1
%42 = icmp eq i32 %41, 11
br i1 %42, label %43, label %3
43: ; preds = %3
ret i32 0
}