#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 EOF;
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int read_word(int /*<<< orphan*/ *, char *, int);
scalar_t__ strcmp(char *, char *);
char tolower(char);
int read_one_edge(FILE *f, int *from, int *to, double *weight) {
  int r = 0, ifrom = 0, ito = 0, iweight = 0;
  static char buf[64];
  r = read_word(f, buf, 64);
  if (r == EOF)
    return EOF;
  if (r == 0)
    return 0;
  if ('0' <= buf[0] && buf[0] <= '9') {
    *from = atoi(buf);
    if ((r = read_word(f, buf, 64)) <= 0)
      return 1;
    *to = atoi(buf);
    if ((r = read_word(f, buf, 64)) <= 0)
      return 2;
    *weight = atof(buf);
    if ((r = read_word(f, buf, 64)) > 0) {
      printf(
          "Unexpected item after reading 'from', 'to' and 'weight': \"%s\"\n",
          buf);
    }
    return 3;
  }
  while (1) {
    for (r = 0; buf[r] != '\0'; r++)
      buf[r] = tolower(buf[r]);
    if (0 == strcmp(buf, "from:")) {
      if ((r = read_word(f, buf, 64)) <= 0)
        break;
      *from = atoi(buf);
      ifrom = 1;
    } else if (0 == strcmp(buf, "to:")) {
      if ((r = read_word(f, buf, 64)) <= 0)
        break;
      *to = atoi(buf);
      ito = 1;
    } else if (0 == strcmp(buf, "coef:") || 0 == strcmp(buf, "effect:") ||
               0 == strcmp(buf, "score:")) {
      if ((r = read_word(f, buf, 64)) <= 0)
        break;
      *weight = atof(buf);
      iweight = 1;
    } else {
      if ((r = read_word(f, buf, 64)) <= 0)
        break;
    }
    if ((r = read_word(f, buf, 64)) <= 0)
      break;
  }
  return ifrom + ito + iweight;
}


x86 assembly (clang, -O0):
<read_one_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x2ec1(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2e32(%rip),%rcx
cmp    (%rcx),%eax
jne    11cf <read_one_edge+0x6f>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <read_one_edge+0x3b8>
cmpl   $0x0,-0x2c(%rbp)
jne    11e5 <read_one_edge+0x85>
movl   $0x0,-0x4(%rbp)
jmp    1518 <read_one_edge+0x3b8>
movsbl 0x2e74(%rip),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     12df <read_one_edge+0x17f>
movsbl 0x2e60(%rip),%eax
cmp    $0x39,%eax
jg     12df <read_one_edge+0x17f>
lea    0x2e50(%rip),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
lea    0x2e38(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     124a <read_one_edge+0xea>
movl   $0x1,-0x4(%rbp)
jmp    1518 <read_one_edge+0x3b8>
lea    0x2e0f(%rip),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
lea    0x2df7(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     128b <read_one_edge+0x12b>
movl   $0x2,-0x4(%rbp)
jmp    1518 <read_one_edge+0x3b8>
lea    0x2dce(%rip),%rdi
call   1030 <atof@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0x2db6(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jle    12d3 <read_one_edge+0x173>
lea    0xd39(%rip),%rdi
lea    0x2d92(%rip),%rsi
call   1040 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    1518 <read_one_edge+0x3b8>
jmp    12e4 <read_one_edge+0x184>
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rcx
lea    0x2d6a(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1335 <read_one_edge+0x1d5>
movslq -0x2c(%rbp),%rcx
lea    0x2d52(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1060 <tolower@plt>
mov    %al,%dl
movslq -0x2c(%rbp),%rcx
lea    0x2d3c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12eb <read_one_edge+0x18b>
lea    0x2d24(%rip),%rdi
lea    0xcfc(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    139c <read_one_edge+0x23c>
mov    -0x10(%rbp),%rdi
lea    0x2cff(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     137c <read_one_edge+0x21c>
jmp    150c <read_one_edge+0x3ac>
lea    0x2cdd(%rip),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x30(%rbp)
jmp    14e1 <read_one_edge+0x381>
lea    0x2cbd(%rip),%rdi
lea    0xc9b(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1403 <read_one_edge+0x2a3>
mov    -0x10(%rbp),%rdi
lea    0x2c98(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     13e3 <read_one_edge+0x283>
jmp    150c <read_one_edge+0x3ac>
lea    0x2c76(%rip),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x34(%rbp)
jmp    14dc <read_one_edge+0x37c>
lea    0x2c56(%rip),%rdi
lea    0xc38(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1466 <read_one_edge+0x306>
lea    0x2c35(%rip),%rdi
lea    0xc1d(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1466 <read_one_edge+0x306>
lea    0x2c14(%rip),%rdi
lea    0xc04(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    14ac <read_one_edge+0x34c>
mov    -0x10(%rbp),%rdi
lea    0x2bef(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     148c <read_one_edge+0x32c>
jmp    150c <read_one_edge+0x3ac>
lea    0x2bcd(%rip),%rdi
call   1030 <atof@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x38(%rbp)
jmp    14d7 <read_one_edge+0x377>
mov    -0x10(%rbp),%rdi
lea    0x2ba9(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     14d2 <read_one_edge+0x372>
jmp    150c <read_one_edge+0x3ac>
jmp    14d7 <read_one_edge+0x377>
jmp    14dc <read_one_edge+0x37c>
jmp    14e1 <read_one_edge+0x381>
mov    -0x10(%rbp),%rdi
lea    0x2b74(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jg     1507 <read_one_edge+0x3a7>
jmp    150c <read_one_edge+0x3ac>
jmp    12e4 <read_one_edge+0x184>
mov    -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_one_edge>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0x2edf(%rip),%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    %eax,%r13d
mov    0x2e53(%rip),%rax
cmp    (%rax),%r13d
je     141b <read_one_edge+0x2bb>
test   %r13d,%r13d
je     1261 <read_one_edge+0x101>
mov    %rbp,0x8(%rsp)
mov    0x2eae(%rip),%al
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jae    1269 <read_one_edge+0x109>
lea    0x2e9b(%rip),%r14
mov    %r14,%rdi
call   1080 <atoi@plt>
mov    %eax,(%r12)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    140d <read_one_edge+0x2ad>
lea    0x2e70(%rip),%r14
mov    %r14,%rdi
call   1080 <atoi@plt>
mov    0x8(%rsp),%rcx
mov    %eax,(%rcx)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    1415 <read_one_edge+0x2b5>
lea    0x2e42(%rip),%r14
mov    %r14,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%r15)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
mov    $0x3,%r13d
test   %eax,%eax
jle    141b <read_one_edge+0x2bb>
lea    0xdb0(%rip),%rdi
lea    0x2e09(%rip),%rsi
call   1040 <printf@plt>
jmp    141b <read_one_edge+0x2bb>
xor    %r13d,%r13d
jmp    141b <read_one_edge+0x2bb>
mov    %r15,0x10(%rsp)
xor    %r13d,%r13d
lea    0x2de8(%rip),%rbp
lea    0xdc0(%rip),%r14
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
test   %al,%al
je     12c8 <read_one_edge+0x168>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x2dba(%rip),%r15
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1060 <tolower@plt>
mov    %al,-0x1(%r15)
movzbl (%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    12b0 <read_one_edge+0x150>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1350 <read_one_edge+0x1f0>
mov    %rbp,%rdi
lea    0xd63(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     13b0 <read_one_edge+0x250>
mov    %rbp,%rdi
lea    0xd4f(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1380 <read_one_edge+0x220>
mov    %rbp,%rdi
lea    0xd41(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1380 <read_one_edge+0x220>
mov    %rbp,%rdi
lea    0xd35(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1380 <read_one_edge+0x220>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jg     13da <read_one_edge+0x27a>
jmp    1402 <read_one_edge+0x2a2>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    1402 <read_one_edge+0x2a2>
mov    %rbp,%rdi
call   1080 <atoi@plt>
mov    %eax,(%r12)
mov    $0x1,%r13d
jmp    13da <read_one_edge+0x27a>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    1402 <read_one_edge+0x2a2>
mov    %rbp,%rdi
call   1030 <atof@plt>
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,0x4(%rsp)
jmp    13da <read_one_edge+0x27a>
nop
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    1402 <read_one_edge+0x2a2>
mov    %rbp,%rdi
call   1080 <atoi@plt>
mov    0x8(%rsp),%rcx
mov    %eax,(%rcx)
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1070 <read_word@plt>
test   %eax,%eax
jle    1402 <read_one_edge+0x2a2>
movzbl 0x2c6b(%rip),%eax
test   %al,%al
jne    12a0 <read_one_edge+0x140>
jmp    12c8 <read_one_edge+0x168>
add    (%rsp),%r13d
add    0x4(%rsp),%r13d
jmp    141b <read_one_edge+0x2bb>
mov    $0x1,%r13d
jmp    141b <read_one_edge+0x2bb>
mov    $0x2,%r13d
mov    %r13d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@read_one_edge.buf = internal global [64 x i8] zeroinitializer
@EOF = global i32 0
@.str = [63 x i8] c"Unexpected item after reading 'from', 'to' and 'weight': \22%s\22\0A\00"
@.str.1 = [6 x i8] c"from:\00"
@.str.2 = [4 x i8] c"to:\00"
@.str.3 = [6 x i8] c"coef:\00"
@.str.4 = [8 x i8] c"effect:\00"
@.str.5 = [7 x i8] c"score:\00"
define i32 @read_one_edge(i32* %0, i32* %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%14 = load i32*, i32** %6
%15 = call i32 @read_word(i32* %14, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %15, i32* %10
%16 = load i32, i32* %10
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32, i32* @EOF
store i32 %20, i32* %5
br label %136
21: ; preds = %4
%22 = load i32, i32* %10
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 0, i32* %5
br label %136
25: ; preds = %21
%26 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0)
%27 = sext i8 %26 to i32
%28 = icmp sle i32 48, %27
br i1 %28, label %29, label %56
29: ; preds = %25
%30 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0)
%31 = sext i8 %30 to i32
%32 = icmp sle i32 %31, 57
br i1 %32, label %33, label %56
33: ; preds = %29
%34 = call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%35 = load i32*, i32** %7
store i32 %34, i32* %35
%36 = load i32*, i32** %6
%37 = call i32 @read_word(i32* %36, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %37, i32* %10
%38 = icmp sle i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %33
store i32 1, i32* %5
br label %136
40: ; preds = %33
%41 = call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%42 = load i32*, i32** %8
store i32 %41, i32* %42
%43 = load i32*, i32** %6
%44 = call i32 @read_word(i32* %43, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %44, i32* %10
%45 = icmp sle i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %40
store i32 2, i32* %5
br label %136
47: ; preds = %40
%48 = call double @atof(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%49 = load double*, double** %9
store double %48, double* %49
%50 = load i32*, i32** %6
%51 = call i32 @read_word(i32* %50, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %51, i32* %10
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %47
%54 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
br label %55
55: ; preds = %53, %47
store i32 3, i32* %5
br label %136
56: ; preds = %29, %25
br label %57
57: ; preds = %56, %129
store i32 0, i32* %10
br label %58
58: ; preds = %74, %57
%59 = load i32, i32* %10
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %77
65: ; preds = %58
%66 = load i32, i32* %10
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = call signext i8 @tolower(i8 signext %69)
%71 = load i32, i32* %10
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 %72
store i8 %70, i8* %73
br label %74
74: ; preds = %65
%75 = load i32, i32* %10
%76 = add nsw i32 %75, 1
store i32 %76, i32* %10
br label %58
77: ; preds = %58
%78 = call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%79 = icmp eq i64 0, %78
br i1 %79, label %80, label %88
80: ; preds = %77
%81 = load i32*, i32** %6
%82 = call i32 @read_word(i32* %81, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %82, i32* %10
%83 = icmp sle i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %80
br label %130
85: ; preds = %80
%86 = call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%87 = load i32*, i32** %7
store i32 %86, i32* %87
store i32 1, i32* %11
br label %124
88: ; preds = %77
%89 = call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%90 = icmp eq i64 0, %89
br i1 %90, label %91, label %99
91: ; preds = %88
%92 = load i32*, i32** %6
%93 = call i32 @read_word(i32* %92, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %93, i32* %10
%94 = icmp sle i32 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %91
br label %130
96: ; preds = %91
%97 = call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%98 = load i32*, i32** %8
store i32 %97, i32* %98
store i32 1, i32* %12
br label %123
99: ; preds = %88
%100 = call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%101 = icmp eq i64 0, %100
br i1 %101, label %108, label %102
102: ; preds = %99
%103 = call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%104 = icmp eq i64 0, %103
br i1 %104, label %108, label %105
105: ; preds = %102
%106 = call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%107 = icmp eq i64 0, %106
br i1 %107, label %108, label %116
108: ; preds = %105, %102, %99
%109 = load i32*, i32** %6
%110 = call i32 @read_word(i32* %109, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %110, i32* %10
%111 = icmp sle i32 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %108
br label %130
113: ; preds = %108
%114 = call double @atof(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
%115 = load double*, double** %9
store double %114, double* %115
store i32 1, i32* %13
br label %122
116: ; preds = %105
%117 = load i32*, i32** %6
%118 = call i32 @read_word(i32* %117, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %118, i32* %10
%119 = icmp sle i32 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %116
br label %130
121: ; preds = %116
br label %122
122: ; preds = %121, %113
br label %123
123: ; preds = %122, %96
br label %124
124: ; preds = %123, %85
%125 = load i32*, i32** %6
%126 = call i32 @read_word(i32* %125, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
store i32 %126, i32* %10
%127 = icmp sle i32 %126, 0
br i1 %127, label %128, label %129
128: ; preds = %124
br label %130
129: ; preds = %124
br label %57
130: ; preds = %128, %120, %112, %95, %84
%131 = load i32, i32* %11
%132 = load i32, i32* %12
%133 = add nsw i32 %131, %132
%134 = load i32, i32* %13
%135 = add nsw i32 %133, %134
store i32 %135, i32* %5
br label %136
136: ; preds = %130, %55, %46, %39, %24, %19
%137 = load i32, i32* %5
ret i32 %137
}

LLVM IR (-O2):
@read_one_edge.buf = internal global [64 x i8] zeroinitializer
@EOF = global i32 0
@.str = [63 x i8] c"Unexpected item after reading 'from', 'to' and 'weight': \22%s\22\0A\00"
@.str.1 = [6 x i8] c"from:\00"
@.str.2 = [4 x i8] c"to:\00"
@.str.3 = [6 x i8] c"coef:\00"
@.str.4 = [8 x i8] c"effect:\00"
@.str.5 = [7 x i8] c"score:\00"
define i32 @read_one_edge(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %90, label %8
8: ; preds = %4
%9 = icmp eq i32 %5, 0
br i1 %9, label %90, label %10
10: ; preds = %8
%11 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0)
%12 = add i8 %11, -48
%13 = icmp ult i8 %12, 10
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = tail call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store i32 %15, i32* %1
%16 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%17 = icmp slt i32 %16, 1
br i1 %17, label %90, label %18
18: ; preds = %14
%19 = tail call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store i32 %19, i32* %2
%20 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%21 = icmp slt i32 %20, 1
br i1 %21, label %90, label %22
22: ; preds = %18
%23 = tail call double @atof(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store double %23, double* %3
%24 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %90
26: ; preds = %22
%27 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
br label %90
28: ; preds = %10, %82
%29 = phi i8 [ %83, %82 ], [ %11, %10 ]
%30 = phi i32 [ %77, %82 ], [ 0, %10 ]
%31 = phi i32 [ %78, %82 ], [ 0, %10 ]
%32 = phi i32 [ %79, %82 ], [ 0, %10 ]
%33 = icmp eq i8 %29, 0
br i1 %33, label %43, label %34
34: ; preds = %28, %34
%35 = phi i64 [ %39, %34 ], [ 0, %28 ]
%36 = phi i8 [ %41, %34 ], [ %29, %28 ]
%37 = phi i8* [ %40, %34 ], [ getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), %28 ]
%38 = tail call signext i8 @tolower(i8 signext %36)
store i8 %38, i8* %37
%39 = add nuw i64 %35, 1
%40 = getelementptr inbounds [64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 0
br i1 %42, label %43, label %34
43: ; preds = %34, %28
%44 = tail call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%48 = icmp slt i32 %47, 1
br i1 %48, label %84, label %49
49: ; preds = %46
%50 = tail call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store i32 %50, i32* %1
br label %76
51: ; preds = %43
%52 = tail call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%56 = icmp slt i32 %55, 1
br i1 %56, label %84, label %57
57: ; preds = %54
%58 = tail call i32 @atoi(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store i32 %58, i32* %2
br label %76
59: ; preds = %51
%60 = tail call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %68, label %62
62: ; preds = %59
%63 = tail call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = tail call i64 @strcmp(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %73
68: ; preds = %65, %62, %59
%69 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%70 = icmp slt i32 %69, 1
br i1 %70, label %84, label %71
71: ; preds = %68
%72 = tail call double @atof(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0))
store double %72, double* %3
br label %76
73: ; preds = %65
%74 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%75 = icmp slt i32 %74, 1
br i1 %75, label %84, label %76
76: ; preds = %57, %73, %71, %49
%77 = phi i32 [ 1, %49 ], [ %30, %57 ], [ %30, %71 ], [ %30, %73 ]
%78 = phi i32 [ %31, %49 ], [ 1, %57 ], [ %31, %71 ], [ %31, %73 ]
%79 = phi i32 [ %32, %49 ], [ %32, %57 ], [ 1, %71 ], [ %32, %73 ]
%80 = tail call i32 @read_word(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0), i32 64)
%81 = icmp slt i32 %80, 1
br i1 %81, label %84, label %82
82: ; preds = %76
%83 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @read_one_edge.buf, i64 0, i64 0)
br label %28
84: ; preds = %76, %73, %68, %54, %46
%85 = phi i32 [ %30, %46 ], [ %77, %76 ], [ %30, %54 ], [ %30, %68 ], [ %30, %73 ]
%86 = phi i32 [ %31, %46 ], [ %78, %76 ], [ %31, %54 ], [ %31, %68 ], [ %31, %73 ]
%87 = phi i32 [ %32, %46 ], [ %79, %76 ], [ %32, %54 ], [ %32, %68 ], [ %32, %73 ]
%88 = add nsw i32 %86, %85
%89 = add nsw i32 %88, %87
br label %90
90: ; preds = %22, %26, %18, %14, %8, %4, %84
%91 = phi i32 [ %89, %84 ], [ %5, %4 ], [ 0, %8 ], [ 1, %14 ], [ 2, %18 ], [ 3, %26 ], [ 3, %22 ]
ret i32 %91
}