#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*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  FILE *fp;
  int i = 0;
  char hostnames[10][20];
  fp = fopen("NodeList", "r");
  for (i = 0; i < 10; i++) {
    fscanf(fp, "%s ", hostnames[i]);
    printf("%s\n", hostnames[i]);
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11cf <main+0x8f>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
lea    -0xe0(%rbp),%rdx
imul   $0x14,%rax,%rax
add    %rax,%rdx
lea    0xe6d(%rip),%rsi
call   1050 <fscanf@plt>
movslq -0x14(%rbp),%rax
lea    -0xe0(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <main+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
lea    0xeab(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%r14
mov    %rsp,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
lea    0xe8c(%rip),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x14(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x28(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x3c(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x50(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x64(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x78(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0x8c(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xa0(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xb4(%rsp),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"NodeList\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [10 x [20 x i8]]
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 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** %2
store i32 0, i32* %3
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %4, i64 0, i64 %12
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%15 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %4, i64 0, i64 %17
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %9
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %6
%25 = load i32*, i32** %2
%26 = call i32 @fclose(i32* %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"NodeList\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x [20 x i8]]
%2 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%6 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 1, i64 0
%7 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%9 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 2, i64 0
%10 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%12 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 3, i64 0
%13 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%15 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 4, i64 0
%16 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%18 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 5, i64 0
%19 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%21 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 6, i64 0
%22 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%24 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 7, i64 0
%25 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%27 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 8, i64 0
%28 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%30 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 9, i64 0
%31 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%33 = call i32 @fclose(i32* %3)
ret i32 0
}