#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 */

/* Variables and functions */
int /*<<< orphan*/ dat2h(char *, char *, char *, char *, char *);
scalar_t__ getenv(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int main(int argc, char *argv[]) {
  char infname[512];
  char outfname[512];
  char deffname[512];
  char varname[128];
  char *rt28xxdir;
  int SKUTableIdx;
  char cc[20];
  rt28xxdir = (char *)getenv("RT28xx_DIR");
  for (SKUTableIdx = 1; SKUTableIdx <= 20; SKUTableIdx++) {
    memset(infname, 0, 512);
    strcat(infname, rt28xxdir);
    strcat(infname, "/txpwr/sku_tables/");
    strcat(infname, "7615_SingleSKU_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(infname, cc);
    strcat(infname, ".dat");
    printf("Input: [%d] %s\n", SKUTableIdx, infname);
    memset(outfname, 0, 512);
    strcat(outfname, rt28xxdir);
    strcat(outfname, "/include/txpwr/");
    strcat(outfname, "SKUTable_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(outfname, cc);
    strcat(outfname, ".h");
    printf("Output: [%d] %s\n", SKUTableIdx, outfname);
    memset(deffname, 0, 512);
    strcat(deffname, rt28xxdir);
    strcat(deffname, "/txpwr/sku_tables/");
    strcat(deffname, "7615_SingleSKU_default.dat");
    printf("Def Input: [%d] %s\n", SKUTableIdx, deffname);
    memset(varname, 0, 128);
    strcat(varname, "SKUvalue_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(varname, cc);
    dat2h(infname, outfname, varname, deffname, "w");
  }
  for (SKUTableIdx = 1; SKUTableIdx <= 20; SKUTableIdx++) {
    memset(infname, 0, 512);
    strcat(infname, rt28xxdir);
    strcat(infname, "/txpwr/sku_tables/");
    strcat(infname, "7615_SingleSKU_BF_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(infname, cc);
    strcat(infname, ".dat");
    printf("Input: [%d] %s\n", SKUTableIdx, infname);
    memset(outfname, 0, 512);
    strcat(outfname, rt28xxdir);
    strcat(outfname, "/include/txpwr/");
    strcat(outfname, "BFBackoffTable_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(outfname, cc);
    strcat(outfname, ".h");
    printf("Output: [%d] %s\n", SKUTableIdx, outfname);
    memset(deffname, 0, 512);
    strcat(deffname, rt28xxdir);
    strcat(deffname, "/txpwr/sku_tables/");
    strcat(deffname, "7615_SingleSKU_BF_default.dat");
    printf("Def Input: [%d] %s\n", SKUTableIdx, deffname);
    memset(varname, 0, 128);
    strcat(varname, "BFBackoffvalue_");
    sprintf(cc, "%d", SKUTableIdx);
    strcat(varname, cc);
    dat2h(infname, outfname, varname, deffname, "w");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe80(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x698(%rbp)
movl   $0x1,-0x69c(%rbp)
cmpl   $0x14,-0x69c(%rbp)
jg     13de <main+0x27e>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x210(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xe2b(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x210(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x210(%rbp),%rdx
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x410(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xdb3(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xd87(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x410(%rbp),%rdx
lea    0xd68(%rip),%rdi
call   1040 <printf@plt>
lea    -0x610(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x610(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x610(%rbp),%rdi
lea    0xcec(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x610(%rbp),%rdi
lea    0xd2d(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x610(%rbp),%rdx
lea    0xd2f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x690(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x690(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xca4(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x690(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
lea    -0x690(%rbp),%rdx
lea    -0x610(%rbp),%rcx
lea    0xcd3(%rip),%r8
call   1080 <dat2h@plt>
mov    -0x69c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x69c(%rbp)
jmp    1196 <main+0x36>
movl   $0x1,-0x69c(%rbp)
cmpl   $0x14,-0x69c(%rbp)
jg     1630 <main+0x4d0>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x210(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xbe2(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xc5e(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xbd9(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x210(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xc5b(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x210(%rbp),%rdx
lea    0xbea(%rip),%rdi
call   1040 <printf@plt>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x410(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xb64(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xbcd(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xb35(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rdi
lea    0xb2c(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x410(%rbp),%rdx
lea    0xb16(%rip),%rdi
call   1040 <printf@plt>
lea    -0x610(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x610(%rbp),%rdi
mov    -0x698(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x610(%rbp),%rdi
lea    0xa9a(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x610(%rbp),%rdi
lea    0xb39(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x69c(%rbp),%esi
lea    -0x610(%rbp),%rdx
lea    0xadd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x690(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x690(%rbp),%rdi
lea    0xb18(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x69c(%rbp),%edx
lea    0xa52(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x690(%rbp),%rdi
lea    -0x6b0(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
lea    -0x690(%rbp),%rdx
lea    -0x610(%rbp),%rcx
lea    0xa81(%rip),%r8
call   1080 <dat2h@plt>
mov    -0x69c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x69c(%rbp)
jmp    13e8 <main+0x288>
mov    -0x4(%rbp),%eax
add    $0x6b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x6a8,%rsp
lea    0xe88(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xa0(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xe4f(%rip),%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xe53(%rip),%rsi
call   1060 <strcat@plt>
mov    %rsp,%r14
mov    %r14,%rdi
lea    0xe51(%rip),%r13
mov    %r13,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r14,%r12
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xed7(%rip),%rsi
call   1060 <strcat@plt>
lea    0xe73(%rip),%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1040 <printf@plt>
lea    0x4a0(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
lea    0xdf0(%rip),%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
lea    0xdf1(%rip),%rsi
call   1060 <strcat@plt>
mov    %r12,%r15
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
lea    0xdd1(%rip),%rsi
call   1060 <strcat@plt>
lea    0xdc8(%rip),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0x2a0(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0xd4f(%rip),%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0xd94(%rip),%rsi
call   1060 <strcat@plt>
lea    0xda3(%rip),%rdi
mov    %ebp,%esi
mov    %r13,%rdx
call   1040 <printf@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    %r12,%rdi
lea    0xd8f(%rip),%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xd20(%rip),%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
lea    0xa0(%rsp),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
lea    0xd60(%rip),%r8
call   1080 <dat2h@plt>
add    $0x1,%ebp
cmp    $0x15,%ebp
jne    1190 <main+0x30>
mov    $0x1,%ebp
xchg   %ax,%ax
lea    0xa0(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xc8f(%rip),%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xd0f(%rip),%rsi
call   1060 <strcat@plt>
mov    %rsp,%r13
mov    %r13,%rdi
lea    0xc91(%rip),%r12
mov    %r12,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r13,%r14
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xd17(%rip),%rsi
call   1060 <strcat@plt>
lea    0xcb3(%rip),%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1040 <printf@plt>
lea    0x4a0(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0xc30(%rip),%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0xc9d(%rip),%rsi
call   1060 <strcat@plt>
mov    %r14,%r15
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0xc11(%rip),%rsi
call   1060 <strcat@plt>
lea    0xc08(%rip),%rdi
mov    %ebp,%esi
mov    %r13,%rdx
call   1040 <printf@plt>
lea    0x2a0(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
lea    0xb8f(%rip),%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
lea    0xc32(%rip),%rsi
call   1060 <strcat@plt>
lea    0xbe3(%rip),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    %r12,%rdi
lea    0xc1c(%rip),%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
lea    0xb60(%rip),%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
lea    0xa0(%rsp),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
lea    0xba0(%rip),%r8
call   1080 <dat2h@plt>
add    $0x1,%ebp
cmp    $0x15,%ebp
jne    1350 <main+0x1f0>
xor    %eax,%eax
add    $0x6a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"RT28xx_DIR\00"
@.str.1 = [19 x i8] c"/txpwr/sku_tables/\00"
@.str.2 = [16 x i8] c"7615_SingleSKU_\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [5 x i8] c".dat\00"
@.str.5 = [16 x i8] c"Input: [%d] %s\0A\00"
@.str.6 = [16 x i8] c"/include/txpwr/\00"
@.str.7 = [10 x i8] c"SKUTable_\00"
@.str.8 = [3 x i8] c".h\00"
@.str.9 = [17 x i8] c"Output: [%d] %s\0A\00"
@.str.10 = [27 x i8] c"7615_SingleSKU_default.dat\00"
@.str.11 = [20 x i8] c"Def Input: [%d] %s\0A\00"
@.str.12 = [10 x i8] c"SKUvalue_\00"
@.str.13 = [2 x i8] c"w\00"
@.str.14 = [19 x i8] c"7615_SingleSKU_BF_\00"
@.str.15 = [16 x i8] c"BFBackoffTable_\00"
@.str.16 = [30 x i8] c"7615_SingleSKU_BF_default.dat\00"
@.str.17 = [16 x i8] c"BFBackoffvalue_\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = alloca [128 x i8]
%7 = alloca [20 x i8]
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%13 = tail call i64 @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = inttoptr i64 %13 to i8*
br label %15
15: ; preds = %2, %15
%16 = phi i32 [ 1, %2 ], [ %43, %15 ]
%17 = call i32 @memset(i8* %8, i32 0, i32 512)
%18 = call i32 @strcat(i8* %8, i8* %14)
%19 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%22 = call i32 @strcat(i8* %8, i8* %12)
%23 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %16, i8* %8)
%25 = call i32 @memset(i8* %9, i32 0, i32 512)
%26 = call i32 @strcat(i8* %9, i8* %14)
%27 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%30 = call i32 @strcat(i8* %9, i8* %12)
%31 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%32 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %16, i8* %9)
%33 = call i32 @memset(i8* %10, i32 0, i32 512)
%34 = call i32 @strcat(i8* %10, i8* %14)
%35 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%37 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %16, i8* %10)
%38 = call i32 @memset(i8* %11, i32 0, i32 128)
%39 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%40 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%41 = call i32 @strcat(i8* %11, i8* %12)
%42 = call i32 @dat2h(i8* %8, i8* %9, i8* %11, i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%43 = add nuw nsw i32 %16, 1
%44 = icmp eq i32 %43, 21
br i1 %44, label %45, label %15
45: ; preds = %15, %45
%46 = phi i32 [ %73, %45 ], [ 1, %15 ]
%47 = call i32 @memset(i8* %8, i32 0, i32 512)
%48 = call i32 @strcat(i8* %8, i8* %14)
%49 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%50 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
%51 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%52 = call i32 @strcat(i8* %8, i8* %12)
%53 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %46, i8* %8)
%55 = call i32 @memset(i8* %9, i32 0, i32 512)
%56 = call i32 @strcat(i8* %9, i8* %14)
%57 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%58 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
%59 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%60 = call i32 @strcat(i8* %9, i8* %12)
%61 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%62 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %46, i8* %9)
%63 = call i32 @memset(i8* %10, i32 0, i32 512)
%64 = call i32 @strcat(i8* %10, i8* %14)
%65 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%66 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%67 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %46, i8* %10)
%68 = call i32 @memset(i8* %11, i32 0, i32 128)
%69 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0))
%70 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%71 = call i32 @strcat(i8* %11, i8* %12)
%72 = call i32 @dat2h(i8* %8, i8* %9, i8* %11, i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%73 = add nuw nsw i32 %46, 1
%74 = icmp eq i32 %73, 21
br i1 %74, label %75, label %45
75: ; preds = %45
ret i32 0
}