#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 */

/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ fatal_error(char *, char const *);
int /*<<< orphan*/ free(struct local_struct *);
scalar_t__ malloc(int);
scalar_t__ strcmp(char const *, char *);
int f_error_final(int mode, unsigned char **sec, float *data,
                  unsigned int ndata, char *inv_out, void **local,
                  const char *arg1, const char *arg2, const char *arg3) {
  int error, i;
  struct local_struct {
    int op, val;
    int count;
  };
  struct local_struct *save;
  error = 0;
  if (mode == -1) {
    if (strcmp(arg1, "count"))
      fatal_error("error_final: X=%s is not allowed", arg1);
    i = 0;
    if (strcmp(arg2, "ne") == 0) {
      i = 0;
    } else if (strcmp(arg2, "eq") == 0) {
      i = 1;
    } else if (strcmp(arg2, "lt") == 0) {
      i = 2;
    } else if (strcmp(arg2, "le") == 0) {
      i = 3;
    } else if (strcmp(arg2, "gt") == 0) {
      i = 4;
    } else if (strcmp(arg2, "ge") == 0) {
      i = 5;
    } else
      fatal_error("error_final: Y=%s is not allowed", arg2);
    *local = save = (struct local_struct *)malloc(sizeof(struct local_struct));
    if (save == NULL)
      fatal_error("error_final memory allocation ", "");
    save->count = 0;
    save->op = i;
    save->val = atoi(arg3);
  } else if (mode >= 0) {
    save = (struct local_struct *)*local;
    save->count += 1;
  } else if (mode == -2) {
    save = (struct local_struct *)*local;
    error = save->count != atoi(arg1);
    switch (save->op) {
    case 0:
      error = save->count != save->val;
      break;
    case 1:
      error = save->count == save->val;
      break;
    case 2:
      error = save->count < save->val;
      break;
    case 3:
      error = save->count <= save->val;
      break;
    case 4:
      error = save->count > save->val;
      break;
    case 5:
      error = save->count >= save->val;
      break;
    }
    free(save);
  }
  return error;
}


x86 assembly (clang, -O0):
<f_error_final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    132a <f_error_final+0x1da>
mov    0x10(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11b5 <f_error_final+0x65>
mov    0x10(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1050 <fatal_error@plt>
movl   $0x0,-0x38(%rbp)
mov    0x18(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e2 <f_error_final+0x92>
movl   $0x0,-0x38(%rbp)
jmp    12c9 <f_error_final+0x179>
mov    0x18(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1208 <f_error_final+0xb8>
movl   $0x1,-0x38(%rbp)
jmp    12c4 <f_error_final+0x174>
mov    0x18(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    122e <f_error_final+0xde>
movl   $0x2,-0x38(%rbp)
jmp    12bf <f_error_final+0x16f>
mov    0x18(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1254 <f_error_final+0x104>
movl   $0x3,-0x38(%rbp)
jmp    12ba <f_error_final+0x16a>
mov    0x18(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    127a <f_error_final+0x12a>
movl   $0x4,-0x38(%rbp)
jmp    12b5 <f_error_final+0x165>
mov    0x18(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12a0 <f_error_final+0x150>
movl   $0x5,-0x38(%rbp)
jmp    12b0 <f_error_final+0x160>
mov    0x18(%rbp),%rsi
lea    0xda6(%rip),%rdi
call   1050 <fatal_error@plt>
jmp    12b5 <f_error_final+0x165>
jmp    12ba <f_error_final+0x16a>
jmp    12bf <f_error_final+0x16f>
jmp    12c4 <f_error_final+0x174>
jmp    12c9 <f_error_final+0x179>
mov    $0xc,%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x40(%rbp)
jne    12ff <f_error_final+0x1af>
lea    0xd7f(%rip),%rdi
lea    0xd96(%rip),%rsi
call   1050 <fatal_error@plt>
mov    -0x40(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    0x20(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1473 <f_error_final+0x323>
cmpl   $0x0,-0x4(%rbp)
jl     1351 <f_error_final+0x201>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x8(%rax)
jmp    146e <f_error_final+0x31e>
cmpl   $0xfffffffe,-0x4(%rbp)
jne    1469 <f_error_final+0x319>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x10(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
sub    %ecx,%eax
setne  %al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x48(%rbp)
sub    $0x5,%rax
ja     1460 <f_error_final+0x310>
mov    -0x48(%rbp),%rax
lea    0xc58(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
jmp    1460 <f_error_final+0x310>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
jmp    1460 <f_error_final+0x310>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
jmp    1460 <f_error_final+0x310>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
jmp    1460 <f_error_final+0x310>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
jmp    1460 <f_error_final+0x310>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x40(%rbp),%rcx
cmp    0x4(%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    146e <f_error_final+0x31e>
jmp    1473 <f_error_final+0x323>
mov    -0x34(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_error_final>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9,%r15
mov    0x30(%rsp),%rbx
cmp    $0xffffffff,%edi
je     1178 <f_error_final+0x28>
test   %edi,%edi
js     1246 <f_error_final+0xf6>
mov    (%r15),%rax
addl   $0x1,0x8(%rax)
jmp    1321 <f_error_final+0x1d1>
mov    0x38(%rsp),%r14
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a0 <f_error_final+0x50>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
call   1050 <fatal_error@plt>
lea    0xe98(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     12e0 <f_error_final+0x190>
lea    0xe81(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1287 <f_error_final+0x137>
lea    0xe6c(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     128e <f_error_final+0x13e>
lea    0xe57(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1295 <f_error_final+0x145>
lea    0xe42(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     129c <f_error_final+0x14c>
lea    0xe2d(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12db <f_error_final+0x18b>
lea    0xe18(%rip),%rdi
mov    %r14,%rsi
call   1050 <fatal_error@plt>
jmp    12e0 <f_error_final+0x190>
xor    %ebp,%ebp
cmp    $0xfffffffe,%edi
jne    1323 <f_error_final+0x1d3>
mov    (%r15),%r14
mov    0x8(%r14),%ebp
mov    %rbx,%rdi
call   1070 <atoi@plt>
cmp    %eax,%ebp
setne  %al
mov    (%r14),%ecx
cmp    $0x5,%rcx
ja     12ce <f_error_final+0x17e>
lea    0xd8b(%rip),%rax
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
cmp    0x4(%r14),%ebp
setne  %al
jmp    12ce <f_error_final+0x17e>
mov    $0x1,%ebp
jmp    12e0 <f_error_final+0x190>
mov    $0x2,%ebp
jmp    12e0 <f_error_final+0x190>
mov    $0x3,%ebp
jmp    12e0 <f_error_final+0x190>
mov    $0x4,%ebp
jmp    12e0 <f_error_final+0x190>
cmp    0x4(%r14),%ebp
sete   %al
jmp    12ce <f_error_final+0x17e>
cmp    0x4(%r14),%ebp
setl   %al
jmp    12ce <f_error_final+0x17e>
cmp    0x4(%r14),%ebp
setle  %al
jmp    12ce <f_error_final+0x17e>
cmp    0x4(%r14),%ebp
setg   %al
jmp    12ce <f_error_final+0x17e>
cmp    0x4(%r14),%ebp
setge  %al
movzbl %al,%ebp
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1323 <f_error_final+0x1d3>
mov    $0x5,%ebp
mov    0x40(%rsp),%r14
mov    $0xc,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,(%r15)
test   %rax,%rax
jne    130d <f_error_final+0x1bd>
lea    0xd71(%rip),%rdi
lea    0xd88(%rip),%rsi
call   1050 <fatal_error@plt>
movl   $0x0,0x8(%rbx)
mov    %ebp,(%rbx)
mov    %r14,%rdi
call   1070 <atoi@plt>
mov    %eax,0x4(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.local_struct = type { i32, i32, i32 }
%struct.local_struct.0 = type opaque
@.str = [6 x i8] c"count\00"
@.str.1 = [33 x i8] c"error_final: X=%s is not allowed\00"
@.str.2 = [3 x i8] c"ne\00"
@.str.3 = [3 x i8] c"eq\00"
@.str.4 = [3 x i8] c"lt\00"
@.str.5 = [3 x i8] c"le\00"
@.str.6 = [3 x i8] c"gt\00"
@.str.7 = [3 x i8] c"ge\00"
@.str.8 = [33 x i8] c"error_final: Y=%s is not allowed\00"
@.str.9 = [31 x i8] c"error_final memory allocation \00"
@.str.10 = [1 x i8] zeroinitializer
define i32 @f_error_final(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i32
%11 = alloca i8**
%12 = alloca float*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8**
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca %struct.local_struct*
store i32 %0, i32* %10
store i8** %1, i8*** %11
store float* %2, float** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i8** %5, i8*** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
store i32 0, i32* %19
%22 = load i32, i32* %10
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %88
24: ; preds = %9
%25 = load i8*, i8** %16
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8*, i8** %16
%30 = call i32 @fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %24
store i32 0, i32* %20
%32 = load i8*, i8** %17
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
store i32 0, i32* %20
br label %69
36: ; preds = %31
%37 = load i8*, i8** %17
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 1, i32* %20
br label %68
41: ; preds = %36
%42 = load i8*, i8** %17
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 2, i32* %20
br label %67
46: ; preds = %41
%47 = load i8*, i8** %17
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %46
store i32 3, i32* %20
br label %66
51: ; preds = %46
%52 = load i8*, i8** %17
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %51
store i32 4, i32* %20
br label %65
56: ; preds = %51
%57 = load i8*, i8** %17
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %56
store i32 5, i32* %20
br label %64
61: ; preds = %56
%62 = load i8*, i8** %17
%63 = call i32 @fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i8* %62)
br label %64
64: ; preds = %61, %60
br label %65
65: ; preds = %64, %55
br label %66
66: ; preds = %65, %50
br label %67
67: ; preds = %66, %45
br label %68
68: ; preds = %67, %40
br label %69
69: ; preds = %68, %35
%70 = call i64 @malloc(i32 12)
%71 = inttoptr i64 %70 to %struct.local_struct*
store %struct.local_struct* %71, %struct.local_struct** %21
%72 = bitcast %struct.local_struct* %71 to i8*
%73 = load i8**, i8*** %15
store i8* %72, i8** %73
%74 = load %struct.local_struct*, %struct.local_struct** %21
%75 = icmp eq %struct.local_struct* %74, null
br i1 %75, label %76, label %78
76: ; preds = %69
%77 = call i32 @fatal_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %78
78: ; preds = %76, %69
%79 = load %struct.local_struct*, %struct.local_struct** %21
%80 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %79, i32 0, i32 2
store i32 0, i32* %80
%81 = load i32, i32* %20
%82 = load %struct.local_struct*, %struct.local_struct** %21
%83 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %82, i32 0, i32 0
store i32 %81, i32* %83
%84 = load i8*, i8** %18
%85 = call i32 @atoi(i8* %84)
%86 = load %struct.local_struct*, %struct.local_struct** %21
%87 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %86, i32 0, i32 1
store i32 %85, i32* %87
br label %176
88: ; preds = %9
%89 = load i32, i32* %10
%90 = icmp sge i32 %89, 0
br i1 %90, label %91, label %99
91: ; preds = %88
%92 = load i8**, i8*** %15
%93 = load i8*, i8** %92
%94 = bitcast i8* %93 to %struct.local_struct*
store %struct.local_struct* %94, %struct.local_struct** %21
%95 = load %struct.local_struct*, %struct.local_struct** %21
%96 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %95, i32 0, i32 2
%97 = load i32, i32* %96
%98 = add nsw i32 %97, 1
store i32 %98, i32* %96
br label %175
99: ; preds = %88
%100 = load i32, i32* %10
%101 = icmp eq i32 %100, -2
br i1 %101, label %102, label %174
102: ; preds = %99
%103 = load i8**, i8*** %15
%104 = load i8*, i8** %103
%105 = bitcast i8* %104 to %struct.local_struct*
store %struct.local_struct* %105, %struct.local_struct** %21
%106 = load %struct.local_struct*, %struct.local_struct** %21
%107 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %106, i32 0, i32 2
%108 = load i32, i32* %107
%109 = load i8*, i8** %16
%110 = call i32 @atoi(i8* %109)
%111 = icmp ne i32 %108, %110
%112 = zext i1 %111 to i32
store i32 %112, i32* %19
%113 = load %struct.local_struct*, %struct.local_struct** %21
%114 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %113, i32 0, i32 0
%115 = load i32, i32* %114
switch i32 %115, label %170 [
i32 0, label %116
i32 1, label %125
i32 2, label %134
i32 3, label %143
i32 4, label %152
i32 5, label %161
]
116: ; preds = %102
%117 = load %struct.local_struct*, %struct.local_struct** %21
%118 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %117, i32 0, i32 2
%119 = load i32, i32* %118
%120 = load %struct.local_struct*, %struct.local_struct** %21
%121 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %120, i32 0, i32 1
%122 = load i32, i32* %121
%123 = icmp ne i32 %119, %122
%124 = zext i1 %123 to i32
store i32 %124, i32* %19
br label %170
125: ; preds = %102
%126 = load %struct.local_struct*, %struct.local_struct** %21
%127 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %126, i32 0, i32 2
%128 = load i32, i32* %127
%129 = load %struct.local_struct*, %struct.local_struct** %21
%130 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %129, i32 0, i32 1
%131 = load i32, i32* %130
%132 = icmp eq i32 %128, %131
%133 = zext i1 %132 to i32
store i32 %133, i32* %19
br label %170
134: ; preds = %102
%135 = load %struct.local_struct*, %struct.local_struct** %21
%136 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %135, i32 0, i32 2
%137 = load i32, i32* %136
%138 = load %struct.local_struct*, %struct.local_struct** %21
%139 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %138, i32 0, i32 1
%140 = load i32, i32* %139
%141 = icmp slt i32 %137, %140
%142 = zext i1 %141 to i32
store i32 %142, i32* %19
br label %170
143: ; preds = %102
%144 = load %struct.local_struct*, %struct.local_struct** %21
%145 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %144, i32 0, i32 2
%146 = load i32, i32* %145
%147 = load %struct.local_struct*, %struct.local_struct** %21
%148 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %147, i32 0, i32 1
%149 = load i32, i32* %148
%150 = icmp sle i32 %146, %149
%151 = zext i1 %150 to i32
store i32 %151, i32* %19
br label %170
152: ; preds = %102
%153 = load %struct.local_struct*, %struct.local_struct** %21
%154 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %153, i32 0, i32 2
%155 = load i32, i32* %154
%156 = load %struct.local_struct*, %struct.local_struct** %21
%157 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %156, i32 0, i32 1
%158 = load i32, i32* %157
%159 = icmp sgt i32 %155, %158
%160 = zext i1 %159 to i32
store i32 %160, i32* %19
br label %170
161: ; preds = %102
%162 = load %struct.local_struct*, %struct.local_struct** %21
%163 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %162, i32 0, i32 2
%164 = load i32, i32* %163
%165 = load %struct.local_struct*, %struct.local_struct** %21
%166 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %165, i32 0, i32 1
%167 = load i32, i32* %166
%168 = icmp sge i32 %164, %167
%169 = zext i1 %168 to i32
store i32 %169, i32* %19
br label %170
170: ; preds = %102, %161, %152, %143, %134, %125, %116
%171 = load %struct.local_struct*, %struct.local_struct** %21
%172 = bitcast %struct.local_struct* %171 to %struct.local_struct.0*
%173 = call i32 @free(%struct.local_struct.0* %172)
br label %174
174: ; preds = %170, %99
br label %175
175: ; preds = %174, %91
br label %176
176: ; preds = %175, %78
%177 = load i32, i32* %19
ret i32 %177
}

LLVM IR (-O2):
%struct.local_struct = type { i32, i32, i32 }
%struct.local_struct.0 = type opaque
@.str = [6 x i8] c"count\00"
@.str.1 = [33 x i8] c"error_final: X=%s is not allowed\00"
@.str.2 = [3 x i8] c"ne\00"
@.str.3 = [3 x i8] c"eq\00"
@.str.4 = [3 x i8] c"lt\00"
@.str.5 = [3 x i8] c"le\00"
@.str.6 = [3 x i8] c"gt\00"
@.str.7 = [3 x i8] c"ge\00"
@.str.8 = [33 x i8] c"error_final: Y=%s is not allowed\00"
@.str.9 = [31 x i8] c"error_final memory allocation \00"
@.str.10 = [1 x i8] zeroinitializer
define i32 @f_error_final(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture %5, i8* %6, i8* %7, i8* nocapture %8) {
%10 = icmp eq i32 %0, -1
br i1 %10, label %11, label %49
11: ; preds = %9
%12 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %16
16: ; preds = %14, %11
%17 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %36, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %36, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %36, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %28
%32 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 @fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i8* %7)
br label %36
36: ; preds = %31, %28, %25, %22, %19, %16, %34
%37 = phi i32 [ 0, %34 ], [ 0, %16 ], [ 1, %19 ], [ 2, %22 ], [ 3, %25 ], [ 4, %28 ], [ 5, %31 ]
%38 = tail call i64 @malloc(i32 12)
%39 = inttoptr i64 %38 to %struct.local_struct*
%40 = inttoptr i64 %38 to i8*
store i8* %40, i8** %5
%41 = icmp eq i64 %38, 0
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = tail call i32 @fatal_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %44
44: ; preds = %42, %36
%45 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %39, i64 0, i32 2
store i32 0, i32* %45
%46 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %39, i64 0, i32 0
store i32 %37, i32* %46
%47 = tail call i32 @atoi(i8* %8)
%48 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %39, i64 0, i32 1
store i32 %47, i32* %48
br label %97
49: ; preds = %9
%50 = icmp sgt i32 %0, -1
br i1 %50, label %51, label %57
51: ; preds = %49
%52 = bitcast i8** %5 to %struct.local_struct**
%53 = load %struct.local_struct*, %struct.local_struct** %52
%54 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %53, i64 0, i32 2
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
store i32 %56, i32* %54
br label %97
57: ; preds = %49
%58 = icmp eq i32 %0, -2
br i1 %58, label %59, label %97
59: ; preds = %57
%60 = bitcast i8** %5 to %struct.local_struct**
%61 = load %struct.local_struct*, %struct.local_struct** %60
%62 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 2
%63 = load i32, i32* %62
%64 = tail call i32 @atoi(i8* %6)
%65 = icmp ne i32 %63, %64
%66 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 0
%67 = load i32, i32* %66
switch i32 %67, label %92 [
i32 0, label %68
i32 1, label %72
i32 2, label %76
i32 3, label %80
i32 4, label %84
i32 5, label %88
]
68: ; preds = %59
%69 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%70 = load i32, i32* %69
%71 = icmp ne i32 %63, %70
br label %92
72: ; preds = %59
%73 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%74 = load i32, i32* %73
%75 = icmp eq i32 %63, %74
br label %92
76: ; preds = %59
%77 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%78 = load i32, i32* %77
%79 = icmp slt i32 %63, %78
br label %92
80: ; preds = %59
%81 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%82 = load i32, i32* %81
%83 = icmp sle i32 %63, %82
br label %92
84: ; preds = %59
%85 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%86 = load i32, i32* %85
%87 = icmp sgt i32 %63, %86
br label %92
88: ; preds = %59
%89 = getelementptr inbounds %struct.local_struct, %struct.local_struct* %61, i64 0, i32 1
%90 = load i32, i32* %89
%91 = icmp sge i32 %63, %90
br label %92
92: ; preds = %59, %88, %84, %80, %76, %72, %68
%93 = phi i1 [ %65, %59 ], [ %91, %88 ], [ %87, %84 ], [ %83, %80 ], [ %79, %76 ], [ %75, %72 ], [ %71, %68 ]
%94 = zext i1 %93 to i32
%95 = bitcast %struct.local_struct* %61 to %struct.local_struct.0*
%96 = tail call i32 @free(%struct.local_struct.0* %95)
br label %97
97: ; preds = %51, %92, %57, %44
%98 = phi i32 [ 0, %44 ], [ 0, %51 ], [ %94, %92 ], [ 0, %57 ]
ret i32 %98
}