#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*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
void importdict(FILE *ifp, int length, char dictionary[][7]) {
  int i = 0;
  if (1)
    printf("enters import\n");
  if (ifp == NULL)
    printf(
        "DICTIONARY NOT FOUND\nFEED ME A DICTIONARY\nI AM HUNGRY FOR WORDS\n");
  else {
    if (1)
      printf("enters ELSE import\n");
    for (i = 0; i < length; i++) {
      fscanf(ifp, "%s", dictionary[i]);
      if (1)
        printf("passes fscanf\n");
      if (1)
        printf("%s\n", dictionary[i]);
    }
  }
}


x86 assembly (clang, -O0):
<importdict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
jne    1166 <importdict+0x46>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <importdict+0xc4>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11df <importdict+0xbf>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
movslq -0x1c(%rbp),%rax
imul   $0x7,%rax,%rax
add    %rax,%rdx
lea    0xec3(%rip),%rsi
call   1040 <fscanf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
imul   $0x7,%rax,%rax
add    %rax,%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117b <importdict+0x5b>
jmp    11e4 <importdict+0xc4>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<importdict>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
test   %r14,%r14
je     11a1 <importdict+0x81>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    1198 <importdict+0x78>
mov    %ebp,%ebp
lea    0xea6(%rip),%r15
lea    0xec3(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <fscanf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x7,%rbx
add    $0xffffffffffffffff,%rbp
jne    1170 <importdict+0x50>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8a(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"enters import\0A\00"
@.str.1 = [65 x i8] c"DICTIONARY NOT FOUND\0AFEED ME A DICTIONARY\0AI AM HUNGRY FOR WORDS\0A\00"
@.str.2 = [20 x i8] c"enters ELSE import\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [15 x i8] c"passes fscanf\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @importdict(i32* %0, i32 %1, [7 x i8]* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [7 x i8]*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store [7 x i8]* %2, [7 x i8]** %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
br label %38
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %15
15: ; preds = %34, %13
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i32*, i32** %4
%21 = load [7 x i8]*, [7 x i8]** %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %21, i64 %23
%25 = getelementptr inbounds [7 x i8], [7 x i8]* %24, i64 0, i64 0
%26 = call i32 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%28 = load [7 x i8]*, [7 x i8]** %6
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [7 x i8], [7 x i8]* %28, i64 %30
%32 = getelementptr inbounds [7 x i8], [7 x i8]* %31, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %19
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %15
37: ; preds = %15
br label %38
38: ; preds = %37, %11
ret void
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%s\00"
@str = [14 x i8] c"enters import\00"
@str.6 = [19 x i8] c"enters ELSE import\00"
@str.7 = [14 x i8] c"passes fscanf\00"
@str.8 = [64 x i8] c"DICTIONARY NOT FOUND\0AFEED ME A DICTIONARY\0AI AM HUNGRY FOR WORDS\00"
define void @importdict(i32* %0, i32 %1, [7 x i8]* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = icmp eq i32* %0, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.8, i64 0, i64 0))
br label %21
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0))
%10 = icmp sgt i32 %1, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = zext i32 %1 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %19, %13 ]
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 %14, i64 0
%16 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) %15)
%19 = add nuw nsw i64 %14, 1
%20 = icmp eq i64 %19, %12
br i1 %20, label %21, label %13
21: ; preds = %13, %8, %6
ret void
}