Dear all,<br><br>First of all, Merry Christmas! :)<br><br>While testing a File I/O sample program, I've encountered a link failure due to missing implementation of "\01__isoc99_fscanf" function. I think this function should be named "__isoc99_fscanf" instead. Please see the program code and LLVM IR generated by DragonEgg and clang below. It shows that clang generates "__isoc99_fscanf", while DragonEgg gives "\01__isoc99_fscanf". We generally use DragonEgg as our compiler frontend, so it is more important. What could be the reason of "\01" issue?<br>
<br>Thanks,<br>- Dima.<br><br>marcusmae@M17xR4:~/forge/kernelgen/tests/behavior/fileio$ cat fileio.c<br>#include <inttypes.h><br>#include <stdio.h><br><br>const char* filename = "fileio.txt";<br><br>
int main(int argc, char* argv[])<br>{<br> if (argc != 2)<br> {<br> printf("Test KernelGen support for File I/O\n");<br> printf("Usage: %s <szarray>\n", argv[0]);<br> return 0;<br>
}<br><br> size_t szarray = (size_t)strtoumax(argv[1], NULL, 0);<br><br> // Write data to file.<br> FILE* wfile = fopen(filename, "w");<br> if (!wfile)<br> {<br> fprintf(stderr, "Cannot open output file %s\n", filename);<br>
return 1;<br> }<br> for (int i = 0; i < szarray; i++)<br> fprintf(wfile, "%d ", i);<br> fclose(wfile);<br><br> // Read data from file.<br> FILE* rfile = fopen(filename, "r");<br>
if (!rfile)<br> {<br> fprintf(stderr, "Cannot open input file %s\n", filename);<br> return 1;<br> }<br> for (int i = 0; i < szarray; i++)<br> {<br> int val;<br> fscanf(rfile, "%d", &val);<br>
printf("%d ", val);<br> }<br> printf("\n");<br> fclose(rfile);<br><br> return 0;<br>}<br><br>marcusmae@M17xR4:~/forge/kernelgen/tests/behavior/fileio$ kernelgen-dragonegg -v -std=c99 fileio.c -o-<br>
Using built-in specs.<br>COLLECT_GCC=kernelgen-gfortran<br>COLLECT_LTO_WRAPPER=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.4/lto-wrapper<br>Target: x86_64-unknown-linux-gnu<br>
Configured with: ../configure --prefix=/home/marcusmae/rpmbuild/BUILDROOT/opt/kernelgen --program-prefix=kernelgen- --enable-languages=fortran,c++ --with-mpfr-include=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/include/ --with-mpfr-lib=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/lib --with-gmp-include=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/include/ --with-gmp-lib=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/lib --with-mpc-include=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/include/ --with-mpc-lib=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/lib --enable-plugin --enable-gold=default --disable-ld --with-ld=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/kernelgen-ld --disable-bootstrap<br>
Thread model: posix<br>gcc version 4.6.4 20120720 (prerelease) (GCC) <br>COLLECT_GCC_OPTIONS='-fplugin=dragonegg.so' '-fplugin-arg-dragonegg-emit-ir' '-fplugin-arg-dragonegg-llvm-ir-optimize=0' '-S' '-v' '-std=c99' '-o' '-' '-mtune=generic' '-march=x86-64'<br>
/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.4/cc1 -quiet -v -imultilib . -imultiarch x86_64-linux-gnu -iprefix /home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/ -iplugindir=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/plugin fileio.c -iplugindir=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/plugin -quiet -dumpbase fileio.c -mtune=generic -march=x86-64 -auxbase-strip - -std=c99 -version -fplugin=dragonegg.so -fplugin-arg-dragonegg-emit-ir -fplugin-arg-dragonegg-llvm-ir-optimize=0 -o -<br>
GNU C (GCC) version 4.6.4 20120720 (prerelease) (x86_64-unknown-linux-gnu)<br> compiled by GNU C version 4.6.4 20120720 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1<br>GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>
Versions of loaded plugins:<br> dragonegg: 3.2svn<br>ignoring nonexistent directory "/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/../../../../x86_64-unknown-linux-gnu/include"<br>
ignoring duplicate directory "/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/include"<br>ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"<br>
ignoring duplicate directory "/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/include-fixed"<br>ignoring nonexistent directory "/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/../../../../x86_64-unknown-linux-gnu/include"<br>
#include "..." search starts here:<br>#include <...> search starts here:<br> /home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/include<br> /home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/include-fixed<br>
/usr/local/include<br> /home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/../../include<br> /usr/include/x86_64-linux-gnu<br> /usr/include<br>End of search list.<br>GNU C (GCC) version 4.6.4 20120720 (prerelease) (x86_64-unknown-linux-gnu)<br>
compiled by GNU C version 4.6.4 20120720 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1<br>GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>Versions of loaded plugins:<br>
dragonegg: 3.2svn<br>Compiler executable checksum: 64cde6062a88e8edfe37057c679689e2<br>; ModuleID = 'fileio.c'<br>target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"<br>
target triple = "x86_64-unknown-linux-gnu"<br><br>%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }<br>
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32, [4 x i8] }<br><br>@filename = unnamed_addr global i8* getelementptr inbounds ([11 x i8]* @.cst, i64 0, i64 0)<br>@.cst = linker_private constant [11 x i8] c"fileio.txt\00", align 8<br>
@.cst1 = linker_private constant [36 x i8] c"Test KernelGen support for File I/O\00", align 64<br>@.cst2 = linker_private constant [21 x i8] c"Usage: %s <szarray>\0A\00", align 8<br>@.cst3 = linker_private constant [2 x i8] c"w\00", align 8<br>
@.cst4 = linker_private constant [28 x i8] c"Cannot open output file %s\0A\00", align 8<br>@stderr = external global %struct._IO_FILE*<br>@.cst5 = linker_private constant [4 x i8] c"%d \00", align 8<br>
@.cst6 = linker_private constant [2 x i8] c"r\00", align 8<br>@.cst7 = linker_private constant [27 x i8] c"Cannot open input file %s\0A\00", align 8<br>@.cst8 = linker_private constant [3 x i8] c"%d\00", align 8<br>
<br>define i32 @main(i32 %argc, i8** %argv) nounwind uwtable {<br>entry:<br> %argc_addr = alloca i32, align 4<br> %argv_addr = alloca i8**, align 8<br> %szarray = alloca i64<br> %wfile = alloca %struct._IO_FILE*<br> %rfile = alloca %struct._IO_FILE*<br>
%i = alloca i32<br> %i1 = alloca i32<br> %val = alloca i32<br> %"<retval>" = alloca i32<br> %"alloca point" = bitcast i32 0 to i32<br> store i32 %argc, i32* %argc_addr<br> store i8** %argv, i8*** %argv_addr<br>
%0 = load i32* %argc_addr, align 32<br> %1 = load i8*** %argv_addr, align 64<br> %"ssa point" = bitcast i32 0 to i32<br> br label %"2"<br><br>"2": ; preds = %entry<br>
%2 = icmp ne i32 %0, 2<br> br i1 %2, label %"3", label %"4"<br><br>"3": ; preds = %"2"<br> %3 = call i32 @puts(i8* getelementptr inbounds ([36 x i8]* @.cst1, i64 0, i64 0)) nounwind<br>
%4 = load i8** %1, align 8<br> %5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21 x i8]* @.cst2, i64 0, i64 0), i8* %4) nounwind<br> br label %"15"<br><br>"4": ; preds = %"2"<br>
%6 = bitcast i8** %1 to i8*<br> %7 = getelementptr i8* %6, i64 8<br> %8 = bitcast i8* %7 to i8**<br> %9 = load i8** %8, align 8<br> %10 = call i64 @strtoumax(i8* noalias %9, i8** noalias null, i32 0) nounwind<br> %11 = load i8** @filename, align 8<br>
%12 = call %struct._IO_FILE* @fopen(i8* noalias %11, i8* noalias getelementptr inbounds ([2 x i8]* @.cst3, i64 0, i64 0)) nounwind<br> %13 = icmp eq %struct._IO_FILE* %12, null<br> br i1 %13, label %"5", label %"6"<br>
<br>"5": ; preds = %"4"<br> %14 = load i8** @filename, align 8<br> %15 = load %struct._IO_FILE** @stderr, align 8<br> %16 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* noalias %15, i8* noalias getelementptr inbounds ([28 x i8]* @.cst4, i64 0, i64 0), i8* %14) nounwind<br>
br label %"15"<br><br>"6": ; preds = %"4"<br> br label %"8"<br><br>"7": ; preds = %"8"<br>
%17 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* noalias %12, i8* noalias getelementptr inbounds ([4 x i8]* @.cst5, i64 0, i64 0), i32 %19) nounwind<br> %18 = add i32 %19, 1<br> br label %"8"<br>
<br>"8": ; preds = %"7", %"6"<br> %19 = phi i32 [ %18, %"7" ], [ 0, %"6" ]<br> %20 = sext i32 %19 to i64<br> %21 = icmp ult i64 %20, %10<br>
br i1 %21, label %"7", label %"9"<br><br>"9": ; preds = %"8"<br> %22 = call i32 @fclose(%struct._IO_FILE* %12) nounwind<br> %23 = load i8** @filename, align 8<br>
%24 = call %struct._IO_FILE* @fopen(i8* noalias %23, i8* noalias getelementptr inbounds ([2 x i8]* @.cst6, i64 0, i64 0)) nounwind<br> %25 = icmp eq %struct._IO_FILE* %24, null<br> br i1 %25, label %"10", label %"11"<br>
<br>"10": ; preds = %"9"<br> %26 = load i8** @filename, align 8<br> %27 = load %struct._IO_FILE** @stderr, align 8<br> %28 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* noalias %27, i8* noalias getelementptr inbounds ([27 x i8]* @.cst7, i64 0, i64 0), i8* %26) nounwind<br>
br label %"15"<br><br>"11": ; preds = %"9"<br> br label %"13"<br><br>"12": ; preds = %"13"<br>
%29 = call i32 (%struct._IO_FILE*, i8*, ...)* @"\01__isoc99_fscanf"(%struct._IO_FILE* noalias %24, i8* noalias getelementptr inbounds ([3 x i8]* @.cst8, i64 0, i64 0), i32* %val) nounwind<br> %30 = load i32* %val, align 4<br>
%31 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.cst5, i64 0, i64 0), i32 %30) nounwind<br> %32 = add i32 %33, 1<br> br label %"13"<br><br>"13": ; preds = %"12", %"11"<br>
%33 = phi i32 [ %32, %"12" ], [ 0, %"11" ]<br> %34 = sext i32 %33 to i64<br> %35 = icmp ult i64 %34, %10<br> br i1 %35, label %"12", label %"14"<br><br>"14": ; preds = %"13"<br>
%36 = call i32 @putchar(i32 10) nounwind<br> %37 = call i32 @fclose(%struct._IO_FILE* %24) nounwind<br> br label %"15"<br><br>"15": ; preds = %"14", %"10", %"5", %"3"<br>
%38 = phi i32 [ 0, %"14" ], [ 1, %"10" ], [ 1, %"5" ], [ 0, %"3" ]<br> store i32 %38, i32* %"<retval>", align 1<br> br label %return<br><br>return: ; preds = %"15"<br>
%retval = load i32* %"<retval>"<br> ret i32 %retval<br>}<br><br>declare i32 @puts(i8*)<br><br>declare i32 @printf(i8*, ...)<br><br>declare i64 @strtoumax(i8* noalias, i8** noalias, i32) nounwind<br><br>
declare %struct._IO_FILE* @fopen(i8* noalias, i8* noalias)<br><br>declare i32 @fprintf(%struct._IO_FILE* noalias, i8* noalias, ...)<br><br>declare i32 @fclose(%struct._IO_FILE*)<br><br>declare i32 @"\01__isoc99_fscanf"(%struct._IO_FILE* noalias, i8* noalias, ...)<br>
<br>declare i32 @putchar(i32)<br>COMPILER_PATH=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.4/:/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../libexec/gcc/:/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/../../../../x86_64-unknown-linux-gnu/bin/<br>
LIBRARY_PATH=/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/:/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/:/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/../../../../lib64/:/lib/x86_64-linux-gnu/:/lib/../lib64/:/usr/lib/x86_64-linux-gnu/:/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/../../../:/lib/:/usr/lib/<br>
COLLECT_GCC_OPTIONS='-fplugin=dragonegg.so' '-fplugin-arg-dragonegg-emit-ir' '-fplugin-arg-dragonegg-llvm-ir-optimize=0' '-S' '-v' '-std=c99' '-o' '-' '-mtune=generic' '-march=x86-64'<br>
<br>marcusmae@M17xR4:~/forge/kernelgen/tests/behavior/fileio$ clang -cc1 -I/usr/include -I/home/marcusmae/rpmbuild/CHROOT/opt/kernelgen/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.4/include -emit-llvm -std=c99 fileio.c -o-<br>
; ModuleID = 'fileio.c'<br>target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"<br>target triple = "x86_64-unknown-linux-gnu"<br>
<br>%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }<br>%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }<br>
<br>@.str = private unnamed_addr constant [11 x i8] c"fileio.txt\00", align 1<br>@filename = global i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), align 8<br>@.str1 = private unnamed_addr constant [37 x i8] c"Test KernelGen support for File I/O\0A\00", align 1<br>
@.str2 = private unnamed_addr constant [21 x i8] c"Usage: %s <szarray>\0A\00", align 1<br>@.str3 = private unnamed_addr constant [2 x i8] c"w\00", align 1<br>@stderr = external global %struct._IO_FILE*<br>
@.str4 = private unnamed_addr constant [28 x i8] c"Cannot open output file %s\0A\00", align 1<br>@.str5 = private unnamed_addr constant [4 x i8] c"%d \00", align 1<br>@.str6 = private unnamed_addr constant [2 x i8] c"r\00", align 1<br>
@.str7 = private unnamed_addr constant [27 x i8] c"Cannot open input file %s\0A\00", align 1<br>@.str8 = private unnamed_addr constant [3 x i8] c"%d\00", align 1<br>@.str9 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1<br>
<br>define i32 @main(i32 %argc, i8** %argv) nounwind {<br>entry:<br> %retval = alloca i32, align 4<br> %argc.addr = alloca i32, align 4<br> %argv.addr = alloca i8**, align 8<br> %szarray = alloca i64, align 8<br> %wfile = alloca %struct._IO_FILE*, align 8<br>
%i = alloca i32, align 4<br> %rfile = alloca %struct._IO_FILE*, align 8<br> %i17 = alloca i32, align 4<br> %val = alloca i32, align 4<br> store i32 0, i32* %retval<br> store i32 %argc, i32* %argc.addr, align 4<br> store i8** %argv, i8*** %argv.addr, align 8<br>
%0 = load i32* %argc.addr, align 4<br> %cmp = icmp ne i32 %0, 2<br> br i1 %cmp, label %if.then, label %if.end<br><br>if.then: ; preds = %entry<br> %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([37 x i8]* @.str1, i32 0, i32 0))<br>
%1 = load i8*** %argv.addr, align 8<br> %arrayidx = getelementptr inbounds i8** %1, i64 0<br> %2 = load i8** %arrayidx, align 8<br> %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21 x i8]* @.str2, i32 0, i32 0), i8* %2)<br>
store i32 0, i32* %retval<br> br label %return<br><br>if.end: ; preds = %entry<br> %3 = load i8*** %argv.addr, align 8<br> %arrayidx2 = getelementptr inbounds i8** %3, i64 1<br>
%4 = load i8** %arrayidx2, align 8<br> %call3 = call i64 @strtoumax(i8* %4, i8** null, i32 0) nounwind<br> store i64 %call3, i64* %szarray, align 8<br> %5 = load i8** @filename, align 8<br> %call4 = call %struct._IO_FILE* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8]* @.str3, i32 0, i32 0))<br>
store %struct._IO_FILE* %call4, %struct._IO_FILE** %wfile, align 8<br> %6 = load %struct._IO_FILE** %wfile, align 8<br> %tobool = icmp ne %struct._IO_FILE* %6, null<br> br i1 %tobool, label %if.end7, label %if.then5<br>
<br>if.then5: ; preds = %if.end<br> %7 = load %struct._IO_FILE** @stderr, align 8<br> %8 = load i8** @filename, align 8<br> %call6 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %7, i8* getelementptr inbounds ([28 x i8]* @.str4, i32 0, i32 0), i8* %8)<br>
store i32 1, i32* %retval<br> br label %return<br><br>if.end7: ; preds = %if.end<br> store i32 0, i32* %i, align 4<br> br label %for.cond<br><br>for.cond: ; preds = %for.inc, %if.end7<br>
%9 = load i32* %i, align 4<br> %conv = sext i32 %9 to i64<br> %10 = load i64* %szarray, align 8<br> %cmp8 = icmp ult i64 %conv, %10<br> br i1 %cmp8, label %for.body, label %for.end<br><br>for.body: ; preds = %for.cond<br>
%11 = load %struct._IO_FILE** %wfile, align 8<br> %12 = load i32* %i, align 4<br> %call10 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %11, i8* getelementptr inbounds ([4 x i8]* @.str5, i32 0, i32 0), i32 %12)<br>
br label %for.inc<br><br>for.inc: ; preds = %for.body<br> %13 = load i32* %i, align 4<br> %inc = add nsw i32 %13, 1<br> store i32 %inc, i32* %i, align 4<br> br label %for.cond<br>
<br>for.end: ; preds = %for.cond<br> %14 = load %struct._IO_FILE** %wfile, align 8<br> %call11 = call i32 @fclose(%struct._IO_FILE* %14)<br> %15 = load i8** @filename, align 8<br>
%call12 = call %struct._IO_FILE* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8]* @.str6, i32 0, i32 0))<br> store %struct._IO_FILE* %call12, %struct._IO_FILE** %rfile, align 8<br> %16 = load %struct._IO_FILE** %rfile, align 8<br>
%tobool13 = icmp ne %struct._IO_FILE* %16, null<br> br i1 %tobool13, label %if.end16, label %if.then14<br><br>if.then14: ; preds = %for.end<br> %17 = load %struct._IO_FILE** @stderr, align 8<br>
%18 = load i8** @filename, align 8<br> %call15 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %17, i8* getelementptr inbounds ([27 x i8]* @.str7, i32 0, i32 0), i8* %18)<br> store i32 1, i32* %retval<br>
br label %return<br><br>if.end16: ; preds = %for.end<br> store i32 0, i32* %i17, align 4<br> br label %for.cond18<br><br>for.cond18: ; preds = %for.inc25, %if.end16<br>
%19 = load i32* %i17, align 4<br> %conv19 = sext i32 %19 to i64<br> %20 = load i64* %szarray, align 8<br> %cmp20 = icmp ult i64 %conv19, %20<br> br i1 %cmp20, label %for.body22, label %for.end27<br><br>for.body22: ; preds = %for.cond18<br>
%21 = load %struct._IO_FILE** %rfile, align 8<br> %call23 = call i32 (%struct._IO_FILE*, i8*, ...)* @__isoc99_fscanf(%struct._IO_FILE* %21, i8* getelementptr inbounds ([3 x i8]* @.str8, i32 0, i32 0), i32* %val)<br> %22 = load i32* %val, align 4<br>
%call24 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str5, i32 0, i32 0), i32 %22)<br> br label %for.inc25<br><br>for.inc25: ; preds = %for.body22<br> %23 = load i32* %i17, align 4<br>
%inc26 = add nsw i32 %23, 1<br> store i32 %inc26, i32* %i17, align 4<br> br label %for.cond18<br><br>for.end27: ; preds = %for.cond18<br> %call28 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8]* @.str9, i32 0, i32 0))<br>
%24 = load %struct._IO_FILE** %rfile, align 8<br> %call29 = call i32 @fclose(%struct._IO_FILE* %24)<br> store i32 0, i32* %retval<br> br label %return<br><br>return: ; preds = %for.end27, %if.then14, %if.then5, %if.then<br>
%25 = load i32* %retval<br> ret i32 %25<br>}<br><br>declare i32 @printf(i8*, ...)<br><br>declare i64 @strtoumax(i8*, i8**, i32) nounwind<br><br>declare %struct._IO_FILE* @fopen(i8*, i8*)<br><br>declare i32 @fprintf(%struct._IO_FILE*, i8*, ...)<br>
<br>declare i32 @fclose(%struct._IO_FILE*)<br><br>declare i32 @__isoc99_fscanf(%struct._IO_FILE*, i8*, ...)<br><br>