#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 */
struct lineFile {
  int dummy;
};
struct hash {
  int dummy;
};
typedef int /*<<< orphan*/ row;

/* Variables and functions */
int /*<<< orphan*/ hashAddInt(struct hash *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ lineFileClose(struct lineFile **);
int /*<<< orphan*/ lineFileNeedNum(struct lineFile *, char **, int);
scalar_t__ lineFileNextRow(struct lineFile *, char **, int);
struct lineFile *lineFileOpen(char *, int);
struct hash *newHashExt(int, int);
struct hash *hashNameIntFile(char *fileName) {
  struct lineFile *lf = lineFileOpen(fileName, 1);
  char *row[2];
  struct hash *hash = newHashExt(16, 1);
  while (lineFileNextRow(lf, row, (sizeof(row) / sizeof((row)[0]))))
    hashAddInt(hash, row[0], lineFileNeedNum(lf, row, 1));
  lineFileClose(&lf);
  return hash;
}


x86 assembly (clang, -O0):
<hashNameIntFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1080 <lineFileOpen@plt>
mov    %rax,-0x10(%rbp)
mov    $0x10,%edi
mov    $0x1,%esi
call   1060 <newHashExt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x2,%edx
call   1030 <lineFileNextRow@plt>
cmp    $0x0,%rax
je     11e3 <hashNameIntFile+0x83>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1070 <lineFileNeedNum@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   1040 <hashAddInt@plt>
jmp    1191 <hashNameIntFile+0x31>
lea    -0x10(%rbp),%rdi
call   1050 <lineFileClose@plt>
mov    -0x28(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashNameIntFile>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x1,%esi
call   1080 <lineFileOpen@plt>
mov    %rax,%r12
mov    %rax,0x8(%rsp)
mov    $0x10,%edi
mov    $0x1,%esi
call   1060 <newHashExt@plt>
mov    %rax,%r14
lea    0x10(%rsp),%rsi
mov    %r12,%rdi
mov    $0x2,%edx
call   1030 <lineFileNextRow@plt>
test   %rax,%rax
je     11e7 <hashNameIntFile+0x87>
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1070 <lineFileNeedNum@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <hashAddInt@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <lineFileNextRow@plt>
test   %rax,%rax
jne    11b0 <hashNameIntFile+0x50>
lea    0x8(%rsp),%rdi
call   1050 <lineFileClose@plt>
mov    %r14,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hash = type { i32 }
%struct.lineFile = type { i32 }
define %struct.hash* @hashNameIntFile(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.lineFile*
%4 = alloca [2 x i8*]
%5 = alloca %struct.hash*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call %struct.lineFile* @lineFileOpen(i8* %6, i32 1)
store %struct.lineFile* %7, %struct.lineFile** %3
%8 = call %struct.hash* @newHashExt(i32 16, i32 1)
store %struct.hash* %8, %struct.hash** %5
br label %9
9: ; preds = %14, %1
%10 = load %struct.lineFile*, %struct.lineFile** %3
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%12 = call i64 @lineFileNextRow(%struct.lineFile* %10, i8** %11, i32 2)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %9
%15 = load %struct.hash*, %struct.hash** %5
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%17 = load i8*, i8** %16
%18 = load %struct.lineFile*, %struct.lineFile** %3
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%20 = call i32 @lineFileNeedNum(%struct.lineFile* %18, i8** %19, i32 1)
%21 = call i32 @hashAddInt(%struct.hash* %15, i8* %17, i32 %20)
br label %9
22: ; preds = %9
%23 = call i32 @lineFileClose(%struct.lineFile** %3)
%24 = load %struct.hash*, %struct.hash** %5
ret %struct.hash* %24
}

LLVM IR (-O2):
%struct.hash = type { i32 }
%struct.lineFile = type { i32 }
define %struct.hash* @hashNameIntFile(i8* %0) {
%2 = alloca %struct.lineFile*
%3 = alloca [2 x i8*]
%4 = bitcast %struct.lineFile** %2 to i8*
%5 = tail call %struct.lineFile* @lineFileOpen(i8* %0, i32 1)
store %struct.lineFile* %5, %struct.lineFile** %2
%6 = bitcast [2 x i8*]* %3 to i8*
%7 = tail call %struct.hash* @newHashExt(i32 16, i32 1)
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%9 = call i64 @lineFileNextRow(%struct.lineFile* %5, i8** %8, i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %1, %11
%12 = load i8*, i8** %8
%13 = call i32 @lineFileNeedNum(%struct.lineFile* %5, i8** %8, i32 1)
%14 = call i32 @hashAddInt(%struct.hash* %7, i8* %12, i32 %13)
%15 = call i64 @lineFileNextRow(%struct.lineFile* %5, i8** %8, i32 2)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %11
17: ; preds = %11, %1
%18 = call i32 @lineFileClose(%struct.lineFile** %2)
ret %struct.hash* %7
}