#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*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ libaft_3d_warn(char *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int read_front(char *filename, int *pnV, double *vertex, int *pnF, int *face,
               int *facematerial, int maxnV, int maxnF, int zeroindex,
               int invert, int verbose) {
  int nF = *pnF, nV = *pnV;
  FILE *f;
  char buf[10240];
  int i, j, r, nv, nf;
  if (!(f = fopen(filename, "r"))) {
    libaft_3d_warn("read_front: %s: %s", filename, strerror(errno));
    return 1;
  }
  if (verbose)
    printf("Reading mesh file %s.\n", filename);
  fgets(buf, 10240, f);
  i = sscanf(buf, "%d %d", &nv, &nf);
  nV += nv;
  nF += nf;
  if (nV > maxnV) {
    libaft_3d_warn("read_front: %s: maxnV", filename);
    fclose(f);
    return 2;
  }
  if (nF > maxnF) {
    libaft_3d_warn("read_front: %s: maxnF", filename);
    fclose(f);
    return 2;
  }
  for (i = nV - nv; i < nV; i++) {
    fgets(buf, 10240, f);
    sscanf(buf, "%lf %lf %lf", vertex + 3 * i + 0, vertex + 3 * i + 1,
           vertex + 3 * i + 2);
  }
  for (i = nF - nf; i < nF; i++) {
    fgets(buf, 10240, f);
    r = sscanf(buf, "%d %d %d %d", face + 3 * i + 0 + invert,
               face + 3 * i + 1 - invert, face + 3 * i + 2, facematerial + i);
    if (r < 4)
      facematerial[i] = 1;
    if (zeroindex) {
      face[3 * i + 0]++;
      face[3 * i + 1]++;
      face[3 * i + 2]++;
    }
    for (j = 0; j < 3; j++)
      face[3 * i + j] += nV - nv;
  }
  fclose(f);
  if (verbose)
    printf("nV = %d, nF = %d\n", nv, nf);
  *pnF = nF;
  *pnV = nV;
  return 0;
}


x86 assembly (clang, -O0):
<read_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2870,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    120e <read_front+0x9e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x2870(%rbp)
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    -0x2870(%rbp),%rsi
mov    %eax,%edx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1070 <libaft_3d_warn@plt>
movl   $0x1,-0x4(%rbp)
jmp    1569 <read_front+0x3f9>
cmpl   $0x0,0x30(%rbp)
je     122a <read_front+0xba>
mov    -0x10(%rbp),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2850(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x2800,%esi
call   1050 <fgets@plt>
lea    -0x2850(%rbp),%rdi
lea    0xe1d(%rip),%rsi
lea    -0x2860(%rbp),%rdx
lea    -0x2864(%rbp),%rcx
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    %eax,-0x2854(%rbp)
mov    -0x2860(%rbp),%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x2864(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x10(%rbp),%eax
jle    12b3 <read_front+0x143>
mov    -0x10(%rbp),%rsi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1070 <libaft_3d_warn@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x2,-0x4(%rbp)
jmp    1569 <read_front+0x3f9>
mov    -0x3c(%rbp),%eax
cmp    0x18(%rbp),%eax
jle    12e6 <read_front+0x176>
mov    -0x10(%rbp),%rsi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1070 <libaft_3d_warn@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x2,-0x4(%rbp)
jmp    1569 <read_front+0x3f9>
mov    -0x40(%rbp),%eax
sub    -0x2860(%rbp),%eax
mov    %eax,-0x2854(%rbp)
mov    -0x2854(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1386 <read_front+0x216>
lea    -0x2850(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x2800,%esi
call   1050 <fgets@plt>
lea    -0x2850(%rbp),%rdi
mov    -0x20(%rbp),%rdx
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x20(%rbp),%rcx
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
add    $0x8,%rcx
mov    -0x20(%rbp),%r8
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
add    $0x10,%r8
lea    0xced(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    -0x2854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2854(%rbp)
jmp    12f5 <read_front+0x185>
mov    -0x3c(%rbp),%eax
sub    -0x2864(%rbp),%eax
mov    %eax,-0x2854(%rbp)
mov    -0x2854(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1523 <read_front+0x3b3>
lea    -0x2850(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x2800,%esi
call   1050 <fgets@plt>
lea    -0x2850(%rbp),%rdi
mov    -0x30(%rbp),%rdx
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
movslq 0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x30(%rbp),%rcx
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
add    $0x4,%rcx
movslq 0x28(%rbp),%rsi
xor    %eax,%eax
sub    %rsi,%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x30(%rbp),%r8
imul   $0x3,-0x2854(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%r8
add    $0x8,%r8
mov    -0x38(%rbp),%r9
movslq -0x2854(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r9
lea    0xc2c(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    %eax,-0x285c(%rbp)
cmpl   $0x4,-0x285c(%rbp)
jge    1464 <read_front+0x2f4>
mov    -0x38(%rbp),%rax
movslq -0x2854(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
cmpl   $0x0,0x20(%rbp)
je     14bc <read_front+0x34c>
mov    -0x30(%rbp),%rax
imul   $0x3,-0x2854(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
imul   $0x3,-0x2854(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
imul   $0x3,-0x2854(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x0,-0x2858(%rbp)
cmpl   $0x3,-0x2858(%rbp)
jge    150a <read_front+0x39a>
mov    -0x40(%rbp),%edx
sub    -0x2860(%rbp),%edx
mov    -0x30(%rbp),%rax
imul   $0x3,-0x2854(%rbp),%ecx
add    -0x2858(%rbp),%ecx
movslq %ecx,%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x2858(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2858(%rbp)
jmp    14c6 <read_front+0x356>
jmp    150f <read_front+0x39f>
mov    -0x2854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2854(%rbp)
jmp    1395 <read_front+0x225>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,0x30(%rbp)
je     1550 <read_front+0x3e0>
mov    -0x2860(%rbp),%esi
mov    -0x2864(%rbp),%edx
lea    0xb27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x40(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_front>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2848,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x28(%rsp)
mov    %rcx,%rbp
mov    %rdx,0x10(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r12
movslq (%rcx),%r14
movslq (%rsi),%r13
lea    0xe5a(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1224 <read_front+0xb4>
mov    %rax,%r15
mov    %rbx,0x30(%rsp)
mov    %rbp,0x38(%rsp)
mov    0x2880(%rsp),%ebx
cmpl   $0x0,0x28a0(%rsp)
je     11df <read_front+0x6f>
lea    0xe40(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x2800,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
lea    0xe6f(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    0xc(%rsp),%ecx
lea    (%rcx,%r13,1),%edx
cmp    %ebx,%edx
jle    124f <read_front+0xdf>
lea    0xe0a(%rip),%rdi
jmp    126d <read_front+0xfd>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xdc9(%rip),%rdi
mov    %r12,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <libaft_3d_warn@plt>
mov    $0x1,%eax
jmp    144d <read_front+0x2dd>
movslq 0x8(%rsp),%rax
add    %rax,%r14
mov    %r14,0x20(%rsp)
cmp    0x2888(%rsp),%r14d
jle    1289 <read_front+0x119>
lea    0xdd5(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <libaft_3d_warn@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    $0x2,%eax
jmp    144d <read_front+0x2dd>
test   %ecx,%ecx
mov    %edx,0x4(%rsp)
jle    12f9 <read_front+0x189>
movslq %edx,%r12
lea    0x0(,%r13,2),%rax
add    %r13,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rbx
lea    0x40(%rsp),%rbp
lea    0xda4(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    $0x2800,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
lea    0x8(%rbx),%rcx
lea    0x10(%rbx),%r8
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <sscanf@plt>
add    $0x1,%r13
add    $0x18,%rbx
cmp    %r12,%r13
jl     12c0 <read_front+0x150>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    140c <read_front+0x29c>
mov    0x20(%rsp),%rcx
sub    %eax,%ecx
movslq 0x2898(%rsp),%rdx
movslq %ecx,%r14
mov    0x18(%rsp),%rax
lea    (%rax,%r14,4),%rbx
lea    (%r14,%r14,2),%rax
lea    (%r14,%r14,2),%rbp
add    $0x2,%rbp
mov    0x28(%rsp),%rcx
lea    (%rcx,%rax,4),%r13
shl    $0x2,%rdx
mov    $0x4,%ecx
mov    %rdx,%rax
mov    %rdx,0x18(%rsp)
sub    %rdx,%rcx
mov    %rcx,0x10(%rsp)
jmp    13ab <read_front+0x23b>
nopl   0x0(%rax)
mov    0x0(%r13),%eax
cmpl   $0x0,0x2890(%rsp)
je     1400 <read_front+0x290>
lea    (%r14,%r14,2),%rcx
add    $0x1,%eax
lea    0x1(%rcx),%rdx
addl   $0x1,0x4(%r13)
add    $0x2,%rcx
addl   $0x1,0x8(%r13)
mov    0x4(%rsp),%esi
sub    0xc(%rsp),%esi
add    %esi,%eax
mov    %eax,0x0(%r13)
mov    0x28(%rsp),%rax
add    %esi,(%rax,%rdx,4)
add    %esi,(%rax,%rcx,4)
add    $0x1,%r14
add    $0x4,%rbx
add    $0x3,%rbp
add    $0xc,%r13
cmp    0x20(%rsp),%r14
jge    140c <read_front+0x29c>
lea    0x40(%rsp),%r12
mov    %r12,%rdi
mov    $0x2800,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
mov    0x18(%rsp),%rax
lea    (%rax,%r13,1),%rdx
mov    0x10(%rsp),%rax
lea    (%rax,%r13,1),%rcx
lea    0x8(%r13),%r8
mov    %r12,%rdi
lea    0xc84(%rip),%rsi
mov    %rbx,%r9
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jg     1350 <read_front+0x1e0>
movl   $0x1,(%rbx)
jmp    1350 <read_front+0x1e0>
xchg   %ax,%ax
lea    -0x1(%rbp),%rdx
mov    %rbp,%rcx
jmp    137b <read_front+0x20b>
mov    %r15,%rdi
call   1030 <fclose@plt>
cmpl   $0x0,0x28a0(%rsp)
je     1434 <read_front+0x2c4>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xc43(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    %ecx,(%rax)
mov    0x30(%rsp),%rax
mov    0x4(%rsp),%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x2848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [19 x i8] c"read_front: %s: %s\00"
@errno = global i32 0
@.str.2 = [23 x i8] c"Reading mesh file %s.\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [22 x i8] c"read_front: %s: maxnV\00"
@.str.5 = [22 x i8] c"read_front: %s: maxnF\00"
@.str.6 = [12 x i8] c"%lf %lf %lf\00"
@.str.7 = [12 x i8] c"%d %d %d %d\00"
@.str.8 = [18 x i8] c"nV = %d, nF = %d\0A\00"
define i32 @read_front(i8* %0, i32* %1, double* %2, i32* %3, i32* %4, i32* %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca double*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32*
%27 = alloca [10240 x i8]
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
store i8* %0, i8** %13
store i32* %1, i32** %14
store double* %2, double** %15
store i32* %3, i32** %16
store i32* %4, i32** %17
store i32* %5, i32** %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
%33 = load i32*, i32** %16
%34 = load i32, i32* %33
store i32 %34, i32* %24
%35 = load i32*, i32** %14
%36 = load i32, i32* %35
store i32 %36, i32* %25
%37 = load i8*, i8** %13
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %38, i32** %26
%39 = icmp ne i32* %38, null
br i1 %39, label %45, label %40
40: ; preds = %11
%41 = load i8*, i8** %13
%42 = load i32, i32* @errno
%43 = call i32 @strerror(i32 %42)
%44 = call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %41, i32 %43)
store i32 1, i32* %12
br label %231
45: ; preds = %11
%46 = load i32, i32* %23
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i8*, i8** %13
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %48, %45
%52 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%53 = load i32*, i32** %26
%54 = call i32 @fgets(i8* %52, i32 10240, i32* %53)
%55 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%56 = call i32 (i8*, i8*, ...) @sscanf(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %31, i32* %32)
store i32 %56, i32* %28
%57 = load i32, i32* %31
%58 = load i32, i32* %25
%59 = add nsw i32 %58, %57
store i32 %59, i32* %25
%60 = load i32, i32* %32
%61 = load i32, i32* %24
%62 = add nsw i32 %61, %60
store i32 %62, i32* %24
%63 = load i32, i32* %25
%64 = load i32, i32* %19
%65 = icmp sgt i32 %63, %64
br i1 %65, label %66, label %71
66: ; preds = %51
%67 = load i8*, i8** %13
%68 = call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %67)
%69 = load i32*, i32** %26
%70 = call i32 @fclose(i32* %69)
store i32 2, i32* %12
br label %231
71: ; preds = %51
%72 = load i32, i32* %24
%73 = load i32, i32* %20
%74 = icmp sgt i32 %72, %73
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = load i8*, i8** %13
%77 = call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = load i32*, i32** %26
%79 = call i32 @fclose(i32* %78)
store i32 2, i32* %12
br label %231
80: ; preds = %71
%81 = load i32, i32* %25
%82 = load i32, i32* %31
%83 = sub nsw i32 %81, %82
store i32 %83, i32* %28
br label %84
84: ; preds = %112, %80
%85 = load i32, i32* %28
%86 = load i32, i32* %25
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %115
88: ; preds = %84
%89 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%90 = load i32*, i32** %26
%91 = call i32 @fgets(i8* %89, i32 10240, i32* %90)
%92 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%93 = load double*, double** %15
%94 = load i32, i32* %28
%95 = mul nsw i32 3, %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %93, i64 %96
%98 = getelementptr inbounds double, double* %97, i64 0
%99 = load double*, double** %15
%100 = load i32, i32* %28
%101 = mul nsw i32 3, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %99, i64 %102
%104 = getelementptr inbounds double, double* %103, i64 1
%105 = load double*, double** %15
%106 = load i32, i32* %28
%107 = mul nsw i32 3, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
%110 = getelementptr inbounds double, double* %109, i64 2
%111 = call i32 (i8*, i8*, ...) @sscanf(i8* %92, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double* %98, double* %104, double* %110)
br label %112
112: ; preds = %88
%113 = load i32, i32* %28
%114 = add nsw i32 %113, 1
store i32 %114, i32* %28
br label %84
115: ; preds = %84
%116 = load i32, i32* %24
%117 = load i32, i32* %32
%118 = sub nsw i32 %116, %117
store i32 %118, i32* %28
br label %119
119: ; preds = %214, %115
%120 = load i32, i32* %28
%121 = load i32, i32* %24
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %217
123: ; preds = %119
%124 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%125 = load i32*, i32** %26
%126 = call i32 @fgets(i8* %124, i32 10240, i32* %125)
%127 = getelementptr inbounds [10240 x i8], [10240 x i8]* %27, i64 0, i64 0
%128 = load i32*, i32** %17
%129 = load i32, i32* %28
%130 = mul nsw i32 3, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32, i32* %128, i64 %131
%133 = getelementptr inbounds i32, i32* %132, i64 0
%134 = load i32, i32* %22
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i32, i32* %133, i64 %135
%137 = load i32*, i32** %17
%138 = load i32, i32* %28
%139 = mul nsw i32 3, %138
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32, i32* %137, i64 %140
%142 = getelementptr inbounds i32, i32* %141, i64 1
%143 = load i32, i32* %22
%144 = sext i32 %143 to i64
%145 = sub i64 0, %144
%146 = getelementptr inbounds i32, i32* %142, i64 %145
%147 = load i32*, i32** %17
%148 = load i32, i32* %28
%149 = mul nsw i32 3, %148
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32, i32* %147, i64 %150
%152 = getelementptr inbounds i32, i32* %151, i64 2
%153 = load i32*, i32** %18
%154 = load i32, i32* %28
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i32, i32* %153, i64 %155
%157 = call i32 (i8*, i8*, ...) @sscanf(i8* %127, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32* %136, i32* %146, i32* %152, i32* %156)
store i32 %157, i32* %30
%158 = load i32, i32* %30
%159 = icmp slt i32 %158, 4
br i1 %159, label %160, label %165
160: ; preds = %123
%161 = load i32*, i32** %18
%162 = load i32, i32* %28
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i32, i32* %161, i64 %163
store i32 1, i32* %164
br label %165
165: ; preds = %160, %123
%166 = load i32, i32* %21
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %193
168: ; preds = %165
%169 = load i32*, i32** %17
%170 = load i32, i32* %28
%171 = mul nsw i32 3, %170
%172 = add nsw i32 %171, 0
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i32, i32* %169, i64 %173
%175 = load i32, i32* %174
%176 = add nsw i32 %175, 1
store i32 %176, i32* %174
%177 = load i32*, i32** %17
%178 = load i32, i32* %28
%179 = mul nsw i32 3, %178
%180 = add nsw i32 %179, 1
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i32, i32* %177, i64 %181
%183 = load i32, i32* %182
%184 = add nsw i32 %183, 1
store i32 %184, i32* %182
%185 = load i32*, i32** %17
%186 = load i32, i32* %28
%187 = mul nsw i32 3, %186
%188 = add nsw i32 %187, 2
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %185, i64 %189
%191 = load i32, i32* %190
%192 = add nsw i32 %191, 1
store i32 %192, i32* %190
br label %193
193: ; preds = %168, %165
store i32 0, i32* %29
br label %194
194: ; preds = %210, %193
%195 = load i32, i32* %29
%196 = icmp slt i32 %195, 3
br i1 %196, label %197, label %213
197: ; preds = %194
%198 = load i32, i32* %25
%199 = load i32, i32* %31
%200 = sub nsw i32 %198, %199
%201 = load i32*, i32** %17
%202 = load i32, i32* %28
%203 = mul nsw i32 3, %202
%204 = load i32, i32* %29
%205 = add nsw i32 %203, %204
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i32, i32* %201, i64 %206
%208 = load i32, i32* %207
%209 = add nsw i32 %208, %200
store i32 %209, i32* %207
br label %210
210: ; preds = %197
%211 = load i32, i32* %29
%212 = add nsw i32 %211, 1
store i32 %212, i32* %29
br label %194
213: ; preds = %194
br label %214
214: ; preds = %213
%215 = load i32, i32* %28
%216 = add nsw i32 %215, 1
store i32 %216, i32* %28
br label %119
217: ; preds = %119
%218 = load i32*, i32** %26
%219 = call i32 @fclose(i32* %218)
%220 = load i32, i32* %23
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %226
222: ; preds = %217
%223 = load i32, i32* %31
%224 = load i32, i32* %32
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %223, i32 %224)
br label %226
226: ; preds = %222, %217
%227 = load i32, i32* %24
%228 = load i32*, i32** %16
store i32 %227, i32* %228
%229 = load i32, i32* %25
%230 = load i32*, i32** %14
store i32 %229, i32* %230
store i32 0, i32* %12
br label %231
231: ; preds = %226, %75, %66, %40
%232 = load i32, i32* %12
ret i32 %232
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [19 x i8] c"read_front: %s: %s\00"
@errno = global i32 0
@.str.2 = [23 x i8] c"Reading mesh file %s.\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [22 x i8] c"read_front: %s: maxnV\00"
@.str.5 = [22 x i8] c"read_front: %s: maxnF\00"
@.str.6 = [12 x i8] c"%lf %lf %lf\00"
@.str.7 = [12 x i8] c"%d %d %d %d\00"
@.str.8 = [18 x i8] c"nV = %d, nF = %d\0A\00"
define i32 @read_front(i8* %0, i32* nocapture %1, double* %2, i32* nocapture %3, i32* %4, i32* %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca [10240 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = load i32, i32* %3
%16 = load i32, i32* %1
%17 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%18 = bitcast i32* %13 to i8*
%19 = bitcast i32* %14 to i8*
%20 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %26
22: ; preds = %11
%23 = load i32, i32* @errno
%24 = tail call i32 @strerror(i32 %23)
%25 = tail call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %24)
br label %123
26: ; preds = %11
%27 = icmp eq i32 %10, 0
br i1 %27, label %30, label %28
28: ; preds = %26
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %30
30: ; preds = %28, %26
%31 = call i32 @fgets(i8* %17, i32 10240, i32* %20)
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %13, i32* %14)
%33 = load i32, i32* %13
%34 = add nsw i32 %33, %16
%35 = load i32, i32* %14
%36 = add nsw i32 %35, %15
%37 = icmp sgt i32 %34, %6
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%40 = call i32 @fclose(i32* %20)
br label %123
41: ; preds = %30
%42 = icmp sgt i32 %36, %7
br i1 %42, label %48, label %43
43: ; preds = %41
%44 = icmp sgt i32 %33, 0
br i1 %44, label %45, label %63
45: ; preds = %43
%46 = sext i32 %16 to i64
%47 = sext i32 %34 to i64
br label %51
48: ; preds = %41
%49 = call i32 (i8*, i8*, ...) @libaft_3d_warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%50 = call i32 @fclose(i32* %20)
br label %123
51: ; preds = %45, %51
%52 = phi i64 [ %46, %45 ], [ %59, %51 ]
%53 = call i32 @fgets(i8* %17, i32 10240, i32* %20)
%54 = mul nsw i64 %52, 3
%55 = getelementptr inbounds double, double* %2, i64 %54
%56 = getelementptr inbounds double, double* %55, i64 1
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = call i32 (i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double* %55, double* %56, double* %57)
%59 = add nsw i64 %52, 1
%60 = icmp slt i64 %59, %47
br i1 %60, label %51, label %61
61: ; preds = %51
%62 = load i32, i32* %14
br label %63
63: ; preds = %61, %43
%64 = phi i32 [ %62, %61 ], [ %35, %43 ]
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %116
66: ; preds = %63
%67 = sub i32 %36, %64
%68 = sext i32 %9 to i64
%69 = sub nsw i64 0, %68
%70 = icmp eq i32 %8, 0
%71 = sext i32 %67 to i64
%72 = sext i32 %36 to i64
br label %73
73: ; preds = %66, %101
%74 = phi i64 [ %71, %66 ], [ %114, %101 ]
%75 = call i32 @fgets(i8* %17, i32 10240, i32* %20)
%76 = mul nsw i64 %74, 3
%77 = getelementptr inbounds i32, i32* %4, i64 %76
%78 = getelementptr inbounds i32, i32* %77, i64 %68
%79 = getelementptr inbounds i32, i32* %77, i64 1
%80 = getelementptr inbounds i32, i32* %79, i64 %69
%81 = getelementptr inbounds i32, i32* %77, i64 2
%82 = getelementptr inbounds i32, i32* %5, i64 %74
%83 = call i32 (i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32* %78, i32* %80, i32* %81, i32* %82)
%84 = icmp slt i32 %83, 4
br i1 %84, label %85, label %86
85: ; preds = %73
store i32 1, i32* %82
br label %86
86: ; preds = %85, %73
%87 = load i32, i32* %77
br i1 %70, label %88, label %91
88: ; preds = %86
%89 = add nsw i64 %76, 1
%90 = add nsw i64 %76, 2
br label %101
91: ; preds = %86
%92 = add nsw i32 %87, 1
%93 = add nsw i64 %76, 1
%94 = getelementptr inbounds i32, i32* %4, i64 %93
%95 = load i32, i32* %94
%96 = add nsw i32 %95, 1
store i32 %96, i32* %94
%97 = add nsw i64 %76, 2
%98 = getelementptr inbounds i32, i32* %4, i64 %97
%99 = load i32, i32* %98
%100 = add nsw i32 %99, 1
store i32 %100, i32* %98
br label %101
101: ; preds = %88, %91
%102 = phi i64 [ %90, %88 ], [ %97, %91 ]
%103 = phi i64 [ %89, %88 ], [ %93, %91 ]
%104 = phi i32 [ %87, %88 ], [ %92, %91 ]
%105 = load i32, i32* %13
%106 = sub i32 %34, %105
%107 = add nsw i32 %106, %104
store i32 %107, i32* %77
%108 = getelementptr inbounds i32, i32* %4, i64 %103
%109 = load i32, i32* %108
%110 = add nsw i32 %106, %109
store i32 %110, i32* %108
%111 = getelementptr inbounds i32, i32* %4, i64 %102
%112 = load i32, i32* %111
%113 = add nsw i32 %106, %112
store i32 %113, i32* %111
%114 = add nsw i64 %74, 1
%115 = icmp slt i64 %114, %72
br i1 %115, label %73, label %116
116: ; preds = %101, %63
%117 = call i32 @fclose(i32* %20)
br i1 %27, label %122, label %118
118: ; preds = %116
%119 = load i32, i32* %13
%120 = load i32, i32* %14
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %119, i32 %120)
br label %122
122: ; preds = %118, %116
store i32 %36, i32* %3
store i32 %34, i32* %1
br label %123
123: ; preds = %122, %48, %38, %22
%124 = phi i32 [ 2, %38 ], [ 2, %48 ], [ 0, %122 ], [ 1, %22 ]
ret i32 %124
}