#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 /*<<< orphan*/ debug(int *, int *, int *, int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
unsigned int scanf(char *, ...);
int execute(int *memoryPtr, int *accumulatorPtr, int *instructionCounterPtr,
            int *instructionRegisterPtr, int *operationCodePtr, int *operandPtr,
            int debugMode) {
  unsigned int esitoScanf;
  char *violation = "*** Simpletron execution abnormally terminated ***";
  puts("*** Program execution begins ***");
  while (*instructionRegisterPtr != -99999) {
    *instructionRegisterPtr = memoryPtr[*instructionCounterPtr];
    *operationCodePtr = *instructionRegisterPtr / 100;
    *operandPtr = *instructionRegisterPtr % 100;
    if (*operationCodePtr == 10) {
      do {
        printf("? ");
        if ((esitoScanf = scanf("%d", &memoryPtr[*operandPtr])) == 0) {
          scanf("%*[^\n]");
          puts("Attenzione, sono consentiti solo numeri interi.");
        }
      } while (esitoScanf == 0);
    } else if (*operationCodePtr == 11) {
      printf("Risultato dell'elaborazione: %+5d\n", memoryPtr[*operandPtr]);
    } else if (*operationCodePtr == 20) {
      *accumulatorPtr = memoryPtr[*operandPtr];
    } else if (*operationCodePtr == 21) {
      memoryPtr[*operandPtr] = *accumulatorPtr;
    } else if (*operationCodePtr == 30) {
      *accumulatorPtr += memoryPtr[*operandPtr];
      if (*accumulatorPtr > 9999 || *accumulatorPtr < -9999) {
        puts(violation);
        puts("*** Aritmetic overflow ***");
        return 0;
      }
    } else if (*operationCodePtr == 31) {
      *accumulatorPtr -= memoryPtr[*operandPtr];
      if (*accumulatorPtr < -9999) {
        puts(violation);
        puts("*** Aritmetic overflow ***");
        return 0;
      }
    } else if (*operationCodePtr == 32) {
      if (memoryPtr[*operandPtr] == 0 || *accumulatorPtr == 0) {
        puts(violation);
        puts("*** Attempt to divide by zero ***");
        return 0;
      } else {
        *accumulatorPtr /= memoryPtr[*operandPtr];
      }
    } else if (*operationCodePtr == 33) {
      *accumulatorPtr *= memoryPtr[*operandPtr];
      if (*accumulatorPtr > 9999 || *accumulatorPtr < -9999) {
        puts(violation);
        puts("*** Aritmetic overflow ***");
        return 0;
      }
    } else if (*operationCodePtr == 40) {
      *instructionCounterPtr = *operandPtr - 1;
    } else if (*operationCodePtr == 41) {
      if (*accumulatorPtr < 0) {
        *instructionCounterPtr = *operandPtr - 1;
      }
    } else if (*operationCodePtr == 42) {
      if (*accumulatorPtr == 0) {
        *instructionCounterPtr = *operandPtr - 1;
      }
    } else if (*operationCodePtr == 43) {
      puts("*** Simpletron execution terminated ***");
      return 1;
    } else if (*operationCodePtr <= 0) {
      puts("*** Loop detected ***");
      puts(violation);
      return 0;
    } else {
      puts("*** Atempt to use unrecognized operation code ***");
      puts(violation);
      return 0;
    }
    if (debugMode == 1) {
      debug(memoryPtr, accumulatorPtr, instructionCounterPtr,
            instructionRegisterPtr, operationCodePtr, operandPtr);
    }
    ++(*instructionCounterPtr);
  }
  return 1;
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
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)
lea    0xe96(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    -0x28(%rbp),%rax
cmpl   $0xfffe7961,(%rax)
je     15bc <execute+0x47c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%rax
mov    %edx,(%rax)
mov    -0x30(%rbp),%rax
cmpl   $0xa,(%rax)
jne    1242 <execute+0x102>
jmp    11da <execute+0x9a>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jne    122e <execute+0xee>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
jmp    1233 <execute+0xf3>
cmpl   $0x0,-0x3c(%rbp)
je     11da <execute+0x9a>
jmp    1585 <execute+0x445>
mov    -0x30(%rbp),%rax
cmpl   $0xb,(%rax)
jne    1270 <execute+0x130>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1580 <execute+0x440>
mov    -0x30(%rbp),%rax
cmpl   $0x14,(%rax)
jne    1296 <execute+0x156>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    157b <execute+0x43b>
mov    -0x30(%rbp),%rax
cmpl   $0x15,(%rax)
jne    12bc <execute+0x17c>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1576 <execute+0x436>
mov    -0x30(%rbp),%rax
cmpl   $0x1e,(%rax)
jne    1325 <execute+0x1e5>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x270f,(%rax)
jg     12ff <execute+0x1bf>
mov    -0x18(%rbp),%rax
cmpl   $0xffffd8f1,(%rax)
jge    1320 <execute+0x1e0>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
lea    0xda5(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
jmp    1571 <execute+0x431>
mov    -0x30(%rbp),%rax
cmpl   $0x1f,(%rax)
jne    1380 <execute+0x240>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0xffffd8f1,(%rax)
jge    137b <execute+0x23b>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
lea    0xd4a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
jmp    156c <execute+0x42c>
mov    -0x30(%rbp),%rax
cmpl   $0x20,(%rax)
jne    13f8 <execute+0x2b8>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     13af <execute+0x26f>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    13d0 <execute+0x290>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
lea    0xd10(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
jmp    1567 <execute+0x427>
mov    -0x30(%rbp),%rax
cmpl   $0x21,(%rax)
jne    1462 <execute+0x322>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
imul   (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x270f,(%rax)
jg     143c <execute+0x2fc>
mov    -0x18(%rbp),%rax
cmpl   $0xffffd8f1,(%rax)
jge    145d <execute+0x31d>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
lea    0xc68(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
jmp    1562 <execute+0x422>
mov    -0x30(%rbp),%rax
cmpl   $0x28,(%rax)
jne    1483 <execute+0x343>
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    155d <execute+0x41d>
mov    -0x30(%rbp),%rax
cmpl   $0x29,(%rax)
jne    14b1 <execute+0x371>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jge    14ac <execute+0x36c>
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1558 <execute+0x418>
mov    -0x30(%rbp),%rax
cmpl   $0x2a,(%rax)
jne    14df <execute+0x39f>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    14da <execute+0x39a>
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1553 <execute+0x413>
mov    -0x30(%rbp),%rax
cmpl   $0x2b,(%rax)
jne    1504 <execute+0x3c4>
lea    0xbfe(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    15c3 <execute+0x483>
mov    -0x30(%rbp),%rax
cmpl   $0x0,(%rax)
jg     1532 <execute+0x3f2>
lea    0xc01(%rip),%rdi
call   1030 <puts@plt>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
lea    0xbf6(%rip),%rdi
call   1030 <puts@plt>
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    15c3 <execute+0x483>
jmp    1558 <execute+0x418>
jmp    155d <execute+0x41d>
jmp    1562 <execute+0x422>
jmp    1567 <execute+0x427>
jmp    156c <execute+0x42c>
jmp    1571 <execute+0x431>
jmp    1576 <execute+0x436>
jmp    157b <execute+0x43b>
jmp    1580 <execute+0x440>
jmp    1585 <execute+0x445>
cmpl   $0x1,0x10(%rbp)
jne    15ac <execute+0x46c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1040 <debug@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    117a <execute+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8,%r13
mov    %rcx,%rbp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xf57(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
cmpl   $0xfffe7961,0x0(%rbp)
je     1382 <execute+0x242>
mov    (%r14),%eax
jmp    1196 <execute+0x56>
mov    (%r14),%eax
add    $0x1,%eax
mov    %eax,(%r14)
cmpl   $0xfffe7961,0x0(%rbp)
je     132f <execute+0x1ef>
cltq
movslq (%r12,%rax,4),%rax
mov    %eax,0x0(%rbp)
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
mov    %eax,0x0(%r13)
movslq 0x0(%rbp),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rbx)
mov    0x0(%r13),%ecx
lea    -0xa(%rcx),%edx
cmp    $0x21,%edx
ja     1356 <execute+0x216>
lea    0xe13(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
cs nopw 0x0(%rax,%rax,1)
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq (%rbx),%rax
lea    (%r12,%rax,4),%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
jne    1300 <execute+0x1c0>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
jmp    1200 <execute+0xc0>
cltq
mov    (%r12,%rax,4),%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1300 <execute+0x1c0>
cltq
mov    (%r12,%rax,4),%eax
mov    %eax,(%r15)
jmp    1300 <execute+0x1c0>
mov    (%r15),%ecx
cltq
mov    %ecx,(%r12,%rax,4)
jmp    1300 <execute+0x1c0>
cltq
mov    (%r12,%rax,4),%eax
mov    (%r15),%ecx
lea    (%rcx,%rax,1),%edx
mov    %edx,(%r15)
add    %ecx,%eax
add    $0xffffd8f0,%eax
cmp    $0xffffb1e1,%eax
jae    1300 <execute+0x1c0>
jmp    1336 <execute+0x1f6>
cltq
mov    (%r15),%ecx
sub    (%r12,%rax,4),%ecx
mov    %ecx,(%r15)
cmp    $0xffffd8f1,%ecx
jge    1300 <execute+0x1c0>
jmp    1336 <execute+0x1f6>
cltq
mov    (%r12,%rax,4),%ecx
test   %ecx,%ecx
je     1346 <execute+0x206>
mov    (%r15),%eax
test   %eax,%eax
je     1346 <execute+0x206>
cltd
idiv   %ecx
mov    %eax,(%r15)
jmp    1300 <execute+0x1c0>
cltq
mov    (%r15),%ecx
imul   (%r12,%rax,4),%ecx
mov    %ecx,(%r15)
add    $0xffffd8f0,%ecx
cmp    $0xffffb1e1,%ecx
jae    1300 <execute+0x1c0>
jmp    1336 <execute+0x1f6>
cmpl   $0x0,(%r15)
jns    1300 <execute+0x1c0>
add    $0xffffffff,%eax
mov    %eax,(%r14)
nopl   (%rax)
cmpl   $0x1,0x40(%rsp)
jne    1180 <execute+0x40>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <debug@plt>
jmp    1180 <execute+0x40>
cmpl   $0x0,(%r15)
jne    1300 <execute+0x1c0>
jmp    12f7 <execute+0x1b7>
mov    $0x1,%eax
jmp    1382 <execute+0x242>
lea    0xdff(%rip),%rbx
lea    0xd44(%rip),%rdi
jmp    1371 <execute+0x231>
lea    0xe0a(%rip),%rbx
lea    0xd34(%rip),%rdi
jmp    1371 <execute+0x231>
test   %ecx,%ecx
lea    0xe42(%rip),%rax
lea    0xe51(%rip),%rdi
cmovle %rax,%rdi
lea    0xd17(%rip),%rbx
call   1030 <puts@plt>
xor    %ebp,%ebp
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
lea    0xddc(%rip),%rbx
jmp    1378 <execute+0x238>

LLVM IR (-O0):
@.str = [51 x i8] c"*** Simpletron execution abnormally terminated ***\00"
@.str.1 = [33 x i8] c"*** Program execution begins ***\00"
@.str.2 = [3 x i8] c"? \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [7 x i8] c"%*[^\0A]\00"
@.str.5 = [48 x i8] c"Attenzione, sono consentiti solo numeri interi.\00"
@.str.6 = [35 x i8] c"Risultato dell'elaborazione: %+5d\0A\00"
@.str.7 = [27 x i8] c"*** Aritmetic overflow ***\00"
@.str.8 = [34 x i8] c"*** Attempt to divide by zero ***\00"
@.str.9 = [40 x i8] c"*** Simpletron execution terminated ***\00"
@.str.10 = [22 x i8] c"*** Loop detected ***\00"
@.str.11 = [50 x i8] c"*** Atempt to use unrecognized operation code ***\00"
define i32 @execute(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32 %6, i32* %15
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8** %17
%18 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %277, %7
%20 = load i32*, i32** %12
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, -99999
br i1 %22, label %23, label %281
23: ; preds = %19
%24 = load i32*, i32** %9
%25 = load i32*, i32** %11
%26 = load i32, i32* %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %24, i64 %27
%29 = load i32, i32* %28
%30 = load i32*, i32** %12
store i32 %29, i32* %30
%31 = load i32*, i32** %12
%32 = load i32, i32* %31
%33 = sdiv i32 %32, 100
%34 = load i32*, i32** %13
store i32 %33, i32* %34
%35 = load i32*, i32** %12
%36 = load i32, i32* %35
%37 = srem i32 %36, 100
%38 = load i32*, i32** %14
store i32 %37, i32* %38
%39 = load i32*, i32** %13
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 10
br i1 %41, label %42, label %60
42: ; preds = %23
br label %43
43: ; preds = %56, %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32*, i32** %9
%46 = load i32*, i32** %14
%47 = load i32, i32* %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %45, i64 %48
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %49)
store i32 %50, i32* %16
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %43
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
br label %55
55: ; preds = %52, %43
br label %56
56: ; preds = %55
%57 = load i32, i32* %16
%58 = icmp eq i32 %57, 0
br i1 %58, label %43, label %59
59: ; preds = %56
br label %266
60: ; preds = %23
%61 = load i32*, i32** %13
%62 = load i32, i32* %61
%63 = icmp eq i32 %62, 11
br i1 %63, label %64, label %72
64: ; preds = %60
%65 = load i32*, i32** %9
%66 = load i32*, i32** %14
%67 = load i32, i32* %66
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %65, i64 %68
%70 = load i32, i32* %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %70)
br label %265
72: ; preds = %60
%73 = load i32*, i32** %13
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 20
br i1 %75, label %76, label %84
76: ; preds = %72
%77 = load i32*, i32** %9
%78 = load i32*, i32** %14
%79 = load i32, i32* %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %77, i64 %80
%82 = load i32, i32* %81
%83 = load i32*, i32** %10
store i32 %82, i32* %83
br label %264
84: ; preds = %72
%85 = load i32*, i32** %13
%86 = load i32, i32* %85
%87 = icmp eq i32 %86, 21
br i1 %87, label %88, label %96
88: ; preds = %84
%89 = load i32*, i32** %10
%90 = load i32, i32* %89
%91 = load i32*, i32** %9
%92 = load i32*, i32** %14
%93 = load i32, i32* %92
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %91, i64 %94
store i32 %90, i32* %95
br label %263
96: ; preds = %84
%97 = load i32*, i32** %13
%98 = load i32, i32* %97
%99 = icmp eq i32 %98, 30
br i1 %99, label %100, label %122
100: ; preds = %96
%101 = load i32*, i32** %9
%102 = load i32*, i32** %14
%103 = load i32, i32* %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %101, i64 %104
%106 = load i32, i32* %105
%107 = load i32*, i32** %10
%108 = load i32, i32* %107
%109 = add nsw i32 %108, %106
store i32 %109, i32* %107
%110 = load i32*, i32** %10
%111 = load i32, i32* %110
%112 = icmp sgt i32 %111, 9999
br i1 %112, label %117, label %113
113: ; preds = %100
%114 = load i32*, i32** %10
%115 = load i32, i32* %114
%116 = icmp slt i32 %115, -9999
br i1 %116, label %117, label %121
117: ; preds = %113, %100
%118 = load i8*, i8** %17
%119 = call i32 @puts(i8* %118)
%120 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %8
br label %282
121: ; preds = %113
br label %262
122: ; preds = %96
%123 = load i32*, i32** %13
%124 = load i32, i32* %123
%125 = icmp eq i32 %124, 31
br i1 %125, label %126, label %144
126: ; preds = %122
%127 = load i32*, i32** %9
%128 = load i32*, i32** %14
%129 = load i32, i32* %128
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i32, i32* %127, i64 %130
%132 = load i32, i32* %131
%133 = load i32*, i32** %10
%134 = load i32, i32* %133
%135 = sub nsw i32 %134, %132
store i32 %135, i32* %133
%136 = load i32*, i32** %10
%137 = load i32, i32* %136
%138 = icmp slt i32 %137, -9999
br i1 %138, label %139, label %143
139: ; preds = %126
%140 = load i8*, i8** %17
%141 = call i32 @puts(i8* %140)
%142 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %8
br label %282
143: ; preds = %126
br label %261
144: ; preds = %122
%145 = load i32*, i32** %13
%146 = load i32, i32* %145
%147 = icmp eq i32 %146, 32
br i1 %147, label %148, label %175
148: ; preds = %144
%149 = load i32*, i32** %9
%150 = load i32*, i32** %14
%151 = load i32, i32* %150
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32, i32* %149, i64 %152
%154 = load i32, i32* %153
%155 = icmp eq i32 %154, 0
br i1 %155, label %160, label %156
156: ; preds = %148
%157 = load i32*, i32** %10
%158 = load i32, i32* %157
%159 = icmp eq i32 %158, 0
br i1 %159, label %160, label %164
160: ; preds = %156, %148
%161 = load i8*, i8** %17
%162 = call i32 @puts(i8* %161)
%163 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %8
br label %282
164: ; preds = %156
%165 = load i32*, i32** %9
%166 = load i32*, i32** %14
%167 = load i32, i32* %166
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i32, i32* %165, i64 %168
%170 = load i32, i32* %169
%171 = load i32*, i32** %10
%172 = load i32, i32* %171
%173 = sdiv i32 %172, %170
store i32 %173, i32* %171
br label %174
174: ; preds = %164
br label %260
175: ; preds = %144
%176 = load i32*, i32** %13
%177 = load i32, i32* %176
%178 = icmp eq i32 %177, 33
br i1 %178, label %179, label %201
179: ; preds = %175
%180 = load i32*, i32** %9
%181 = load i32*, i32** %14
%182 = load i32, i32* %181
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32, i32* %180, i64 %183
%185 = load i32, i32* %184
%186 = load i32*, i32** %10
%187 = load i32, i32* %186
%188 = mul nsw i32 %187, %185
store i32 %188, i32* %186
%189 = load i32*, i32** %10
%190 = load i32, i32* %189
%191 = icmp sgt i32 %190, 9999
br i1 %191, label %196, label %192
192: ; preds = %179
%193 = load i32*, i32** %10
%194 = load i32, i32* %193
%195 = icmp slt i32 %194, -9999
br i1 %195, label %196, label %200
196: ; preds = %192, %179
%197 = load i8*, i8** %17
%198 = call i32 @puts(i8* %197)
%199 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %8
br label %282
200: ; preds = %192
br label %259
201: ; preds = %175
%202 = load i32*, i32** %13
%203 = load i32, i32* %202
%204 = icmp eq i32 %203, 40
br i1 %204, label %205, label %210
205: ; preds = %201
%206 = load i32*, i32** %14
%207 = load i32, i32* %206
%208 = sub nsw i32 %207, 1
%209 = load i32*, i32** %11
store i32 %208, i32* %209
br label %258
210: ; preds = %201
%211 = load i32*, i32** %13
%212 = load i32, i32* %211
%213 = icmp eq i32 %212, 41
br i1 %213, label %214, label %224
214: ; preds = %210
%215 = load i32*, i32** %10
%216 = load i32, i32* %215
%217 = icmp slt i32 %216, 0
br i1 %217, label %218, label %223
218: ; preds = %214
%219 = load i32*, i32** %14
%220 = load i32, i32* %219
%221 = sub nsw i32 %220, 1
%222 = load i32*, i32** %11
store i32 %221, i32* %222
br label %223
223: ; preds = %218, %214
br label %257
224: ; preds = %210
%225 = load i32*, i32** %13
%226 = load i32, i32* %225
%227 = icmp eq i32 %226, 42
br i1 %227, label %228, label %238
228: ; preds = %224
%229 = load i32*, i32** %10
%230 = load i32, i32* %229
%231 = icmp eq i32 %230, 0
br i1 %231, label %232, label %237
232: ; preds = %228
%233 = load i32*, i32** %14
%234 = load i32, i32* %233
%235 = sub nsw i32 %234, 1
%236 = load i32*, i32** %11
store i32 %235, i32* %236
br label %237
237: ; preds = %232, %228
br label %256
238: ; preds = %224
%239 = load i32*, i32** %13
%240 = load i32, i32* %239
%241 = icmp eq i32 %240, 43
br i1 %241, label %242, label %244
242: ; preds = %238
%243 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %8
br label %282
244: ; preds = %238
%245 = load i32*, i32** %13
%246 = load i32, i32* %245
%247 = icmp sle i32 %246, 0
br i1 %247, label %248, label %252
248: ; preds = %244
%249 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%250 = load i8*, i8** %17
%251 = call i32 @puts(i8* %250)
store i32 0, i32* %8
br label %282
252: ; preds = %244
%253 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
%254 = load i8*, i8** %17
%255 = call i32 @puts(i8* %254)
store i32 0, i32* %8
br label %282
256: ; preds = %237
br label %257
257: ; preds = %256, %223
br label %258
258: ; preds = %257, %205
br label %259
259: ; preds = %258, %200
br label %260
260: ; preds = %259, %174
br label %261
261: ; preds = %260, %143
br label %262
262: ; preds = %261, %121
br label %263
263: ; preds = %262, %88
br label %264
264: ; preds = %263, %76
br label %265
265: ; preds = %264, %64
br label %266
266: ; preds = %265, %59
%267 = load i32, i32* %15
%268 = icmp eq i32 %267, 1
br i1 %268, label %269, label %277
269: ; preds = %266
%270 = load i32*, i32** %9
%271 = load i32*, i32** %10
%272 = load i32*, i32** %11
%273 = load i32*, i32** %12
%274 = load i32*, i32** %13
%275 = load i32*, i32** %14
%276 = call i32 @debug(i32* %270, i32* %271, i32* %272, i32* %273, i32* %274, i32* %275)
br label %277
277: ; preds = %269, %266
%278 = load i32*, i32** %11
%279 = load i32, i32* %278
%280 = add nsw i32 %279, 1
store i32 %280, i32* %278
br label %19
281: ; preds = %19
store i32 1, i32* %8
br label %282
282: ; preds = %281, %252, %248, %242, %196, %160, %139, %117
%283 = load i32, i32* %8
ret i32 %283
}

LLVM IR (-O2):
@.str = [51 x i8] c"*** Simpletron execution abnormally terminated ***\00"
@.str.1 = [33 x i8] c"*** Program execution begins ***\00"
@.str.2 = [3 x i8] c"? \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [7 x i8] c"%*[^\0A]\00"
@.str.5 = [48 x i8] c"Attenzione, sono consentiti solo numeri interi.\00"
@.str.6 = [35 x i8] c"Risultato dell'elaborazione: %+5d\0A\00"
@.str.7 = [27 x i8] c"*** Aritmetic overflow ***\00"
@.str.8 = [34 x i8] c"*** Attempt to divide by zero ***\00"
@.str.9 = [40 x i8] c"*** Simpletron execution terminated ***\00"
@.str.10 = [22 x i8] c"*** Loop detected ***\00"
@.str.11 = [50 x i8] c"*** Atempt to use unrecognized operation code ***\00"
define i32 @execute(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6) {
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -99999
br i1 %10, label %116, label %11
11: ; preds = %7
%12 = icmp eq i32 %6, 1
%13 = load i32, i32* %2
br label %14
14: ; preds = %11, %103
%15 = phi i32 [ %13, %11 ], [ %105, %103 ]
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %3
%19 = sdiv i32 %18, 100
store i32 %19, i32* %4
%20 = load i32, i32* %3
%21 = srem i32 %20, 100
store i32 %21, i32* %5
%22 = load i32, i32* %4
switch i32 %22, label %97 [
i32 10, label %23
i32 11, label %39
i32 20, label %44
i32 21, label %48
i32 30, label %52
i32 31, label %60
i32 32, label %67
i32 33, label %77
i32 40, label %85
i32 41, label %87
i32 42, label %92
i32 43, label %112
]
23: ; preds = %14
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %0, i64 %26
%28 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %100
30: ; preds = %23, %30
%31 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %0, i64 %35
%37 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %30, label %100
39: ; preds = %14
%40 = sext i32 %21 to i64
%41 = getelementptr inbounds i32, i32* %0, i64 %40
%42 = load i32, i32* %41
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %42)
br label %100
44: ; preds = %14
%45 = sext i32 %21 to i64
%46 = getelementptr inbounds i32, i32* %0, i64 %45
%47 = load i32, i32* %46
store i32 %47, i32* %1
br label %100
48: ; preds = %14
%49 = load i32, i32* %1
%50 = sext i32 %21 to i64
%51 = getelementptr inbounds i32, i32* %0, i64 %50
store i32 %49, i32* %51
br label %100
52: ; preds = %14
%53 = sext i32 %21 to i64
%54 = getelementptr inbounds i32, i32* %0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %1
%57 = add nsw i32 %56, %55
store i32 %57, i32* %1
%58 = add i32 %57, -10000
%59 = icmp ult i32 %58, -19999
br i1 %59, label %108, label %100
60: ; preds = %14
%61 = sext i32 %21 to i64
%62 = getelementptr inbounds i32, i32* %0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %1
%65 = sub nsw i32 %64, %63
store i32 %65, i32* %1
%66 = icmp slt i32 %65, -9999
br i1 %66, label %108, label %100
67: ; preds = %14
%68 = sext i32 %21 to i64
%69 = getelementptr inbounds i32, i32* %0, i64 %68
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
br i1 %71, label %108, label %72
72: ; preds = %67
%73 = load i32, i32* %1
%74 = icmp eq i32 %73, 0
br i1 %74, label %108, label %75
75: ; preds = %72
%76 = sdiv i32 %73, %70
store i32 %76, i32* %1
br label %100
77: ; preds = %14
%78 = sext i32 %21 to i64
%79 = getelementptr inbounds i32, i32* %0, i64 %78
%80 = load i32, i32* %79
%81 = load i32, i32* %1
%82 = mul nsw i32 %81, %80
store i32 %82, i32* %1
%83 = add i32 %82, -10000
%84 = icmp ult i32 %83, -19999
br i1 %84, label %108, label %100
85: ; preds = %14
%86 = add nsw i32 %21, -1
store i32 %86, i32* %2
br label %100
87: ; preds = %14
%88 = load i32, i32* %1
%89 = icmp slt i32 %88, 0
br i1 %89, label %90, label %100
90: ; preds = %87
%91 = add nsw i32 %21, -1
store i32 %91, i32* %2
br label %100
92: ; preds = %14
%93 = load i32, i32* %1
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %92
%96 = add nsw i32 %21, -1
store i32 %96, i32* %2
br label %100
97: ; preds = %14
%98 = icmp slt i32 %22, 1
%99 = select i1 %98, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0)
br label %108
100: ; preds = %30, %23, %77, %52, %39, %48, %60, %90, %87, %92, %95, %85, %75, %44
br i1 %12, label %101, label %103
101: ; preds = %100
%102 = tail call i32 @debug(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
br label %103
103: ; preds = %101, %100
%104 = load i32, i32* %2
%105 = add nsw i32 %104, 1
store i32 %105, i32* %2
%106 = load i32, i32* %3
%107 = icmp eq i32 %106, -99999
br i1 %107, label %116, label %14
108: ; preds = %77, %67, %72, %60, %52, %97
%109 = phi i8* [ %99, %97 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %52 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %60 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %72 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %67 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %77 ]
%110 = phi i8* [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), %97 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %77 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), %67 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), %72 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %60 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %52 ]
%111 = tail call i32 @puts(i8* dereferenceable(1) %109)
br label %112
112: ; preds = %14, %108
%113 = phi i8* [ %110, %108 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), %14 ]
%114 = phi i32 [ 0, %108 ], [ 1, %14 ]
%115 = tail call i32 @puts(i8* dereferenceable(1) %113)
br label %116
116: ; preds = %103, %112, %7
%117 = phi i32 [ 1, %7 ], [ %114, %112 ], [ 1, %103 ]
ret i32 %117
}